Commit 931cf0a8 authored by francescomani's avatar francescomani

more review fixes

parent c9b043eb
......@@ -618,7 +618,7 @@ void init_fep_thread(RU_t *ru,
void kill_fep_thread(RU_t *ru)
{
RU_proc_t *proc = &ru->proc;
if (proc->pthread_fep[0] == 0)
if (proc->pthread_fep == 0)
return;
pthread_mutex_lock( &proc->mutex_fep[0] );
proc->instance_cnt_fep[0] = 0;
......
......@@ -213,7 +213,7 @@ schedule_MBMS_NFAPI(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
msi_pos++;
mbms_mch_i=0;
if(subframeP==0){
if (subframeP==0) {
x=0;
mbms_mch_i=0;
}
......@@ -459,7 +459,7 @@ schedule_MBMS_NFAPI(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
module_idP, CC_id, frameP, subframeP, i, j,
cc->mbsfn_SubframeConfig[j]->subframeAllocation.choice.oneFrame.buf[0],
msi_pos);
if(subframeP==1){
if (subframeP==1) {
x=0;
mbms_mch_i=0;
LOG_D(MAC,"MSP, frameP %d subframeP %d msi_pos(%d) mbms_mch_i %d\n",frameP, subframeP, msi_pos,mbms_mch_i);
......@@ -708,7 +708,7 @@ schedule_MBMS_NFAPI(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
uint16_t msi_control_element[29], *msi_ptr;
// MSI buffer pointer
char *buffer_pointer=NULL;
if (msi_flag == 1 && cc->mbms_SessionList[mbms_mch_i]) {
if (msi_flag == 1 && cc->mbms_SessionList) {
// Create MSI here
msi_ptr = &msi_control_element[0];
......@@ -868,7 +868,7 @@ schedule_MBMS_NFAPI(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
// there is MTCHs, loop if there are more than 1
// BAd race condition: all this struct is filled by another thread, no mutex or any code to make it coherent
if (mtch_flag == 1 && cc->mbms_SessionList[0] && cc->mbms_SessionList[0]->list.array[0]) {
if (mtch_flag == 1 && cc->mbms_SessionList && cc->mbms_SessionList[0] && cc->mbms_SessionList[0]->list.array[0]) {
// Calculate TBS
// get MTCH data from RLC (like for DTCH)
LOG_D(MAC, "[eNB %d] CC_id %d Frame %d subframeP %d: Schedule MTCH (area %d, sfAlloc %d)\n", module_idP, CC_id, frameP, subframeP, i, j);
......
......@@ -680,27 +680,8 @@ uint16_t get_NCS(uint8_t index, uint16_t format0, uint8_t restricted_set_config)
}
}
//38.211 Table 6.3.3.2-1
// delta_f_RA_PRACH = 1 in the first 3 lines needs to be converted to 1.25
int16_t table_6_3_3_2_1[16][5] = {
//Length_RA, delta_f_RA_PRACH, delta_f_PUSCH, N_RA_RB, kbar
{ 839, 1, 15, 6, 7},
{ 839, 1, 30, 3, 1},
{ 839, 1, 60, 2, 133},
{ 839, 5, 15, 24, 12},
{ 839, 5, 30, 12, 10},
{ 839, 5, 60, 6, 7},
{ 139, 15, 15, 12, 2},
{ 139, 15, 30, 6, 2},
{ 139, 15, 60, 3, 2},
{ 139, 30, 15, 24, 2},
{ 139, 30, 30, 12, 2},
{ 139, 30, 60, 6, 2},
{ 139, 60, 60, 12, 2},
{ 139, 60, 120, 6, 2},
{ 139, 120, 60, 24, 2},
{ 139, 120, 120, 12, 2}
};
//from 38.211 Table 6.3.3.2-1
int16_t N_RA_RB[16] = {6, 3, 2, 24, 12, 6, 12, 6, 3, 24, 12, 6, 12, 6, 24, 12};
/* Function to get number of RBs required for prach occasion based on
* 38.211 Table 6.3.3.2-1 */
......@@ -742,7 +723,7 @@ int16_t get_N_RA_RB (int delta_f_RA_PRACH,int delta_f_PUSCH) {
break;
default : index = 10;/*30khz prach scs and 30khz pusch scs*/
}
return table_6_3_3_2_1[index][3];
return N_RA_RB[index];
}
// Table 6.3.3.2-2: Random access configurations for FR1 and paired spectrum/supplementary uplink
// the column 5, (SFN_nbr is a bitmap where we set bit to '1' in the position of the subframe where the RACH can be sent.
......
......@@ -1464,7 +1464,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
//memset((*sib2)->radioResourceConfigCommon.ext4->bcch_Config_v1310, 0, sizeof(BCCH_Config_v1310_t));
//(*sib2)->radioResourceConfigCommon.ext4->bcch_Config_v1310->modificationPeriodCoeff_v1310 = BCCH_Config_v1310__modificationPeriodCoeff_v1310_n64;
if (configuration->pcch_config_v1310[CC_id]) {
if (configuration->pcch_config_v1310) {
(*sib2)->radioResourceConfigCommon.ext4->pcch_Config_v1310 = CALLOC(1, sizeof(LTE_PCCH_Config_v1310_t));
(*sib2)->radioResourceConfigCommon.ext4->pcch_Config_v1310->paging_narrowBands_r13 = configuration->paging_narrowbands_r13[CC_id];
(*sib2)->radioResourceConfigCommon.ext4->pcch_Config_v1310->mpdcch_NumRepetition_Paging_r13 = configuration->mpdcch_numrepetition_paging_r13[CC_id];
......
......@@ -1963,6 +1963,7 @@ rrc_ue_process_rrcConnectionReconfiguration(
sizeof(msg));
nsa_sendmsg_to_nrue(&msg, sizeof(msg), RRC_CONFIG_COMPLETE_REQ);
free(msg.buffer);
LOG_A(RRC, "Sent RRC_CONFIG_COMPLETE_REQ to the NR UE\n");
}
......
......@@ -3244,69 +3244,6 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
quantityConfig = NULL;
}
//-----------------------------------------------------------------------------
int
rrc_eNB_generate_RRCConnectionReconfiguration_SCell(
const protocol_ctxt_t *const ctxt_pP,
rrc_eNB_ue_context_t *const ue_context_pP,
uint32_t dl_CarrierFreq_r10
)
//-----------------------------------------------------------------------------
{
uint8_t size;
uint8_t buffer[100];
uint8_t sCellIndexToAdd = 0; //one SCell so far
// uint8_t sCellIndexToAdd;
// sCellIndexToAdd = rrc_find_free_SCell_index(enb_mod_idP, ue_mod_idP, 1);
// if (RC.rrc[enb_mod_idP]->sCell_config[ue_mod_idP][sCellIndexToAdd] ) {
if (&ue_context_pP->ue_context.sCell_config[sCellIndexToAdd] != NULL) {
ue_context_pP->ue_context.sCell_config[sCellIndexToAdd].cellIdentification_r10->dl_CarrierFreq_r10 = dl_CarrierFreq_r10;
} else {
LOG_E(RRC,"Scell not configured!\n");
return(-1);
}
size = do_RRCConnectionReconfiguration(ctxt_pP,
buffer,
sizeof(buffer),
rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id),//Transaction_id,
(LTE_SRB_ToAddModList_t *)NULL,
(LTE_DRB_ToAddModList_t *)NULL,
(LTE_DRB_ToReleaseList_t *)NULL,
(struct LTE_SPS_Config *)NULL,
(struct LTE_PhysicalConfigDedicated *)NULL,
(LTE_MeasObjectToAddModList_t *)NULL,
(LTE_ReportConfigToAddModList_t *)NULL,
(LTE_QuantityConfig_t *)NULL,
(LTE_MeasIdToAddModList_t *)NULL,
(LTE_MAC_MainConfig_t *)NULL,
(LTE_MeasGapConfig_t *)NULL,
(LTE_MobilityControlInfo_t *)NULL,
(LTE_SecurityConfigHO_t *)NULL,
(struct LTE_MeasConfig__speedStatePars *)NULL,
(LTE_RSRP_Range_t *)NULL,
(LTE_C_RNTI_t *)NULL,
(struct LTE_RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList *)NULL,
(LTE_SL_CommConfig_r12_t *)NULL,
(LTE_SL_DiscConfig_r12_t *)NULL,
ue_context_pP->ue_context.sCell_config
);
LOG_I(RRC,"[eNB %d] Frame %d, Logical Channel DL-DCCH, Generate LTE_RRCConnectionReconfiguration (bytes %d, UE id %x)\n",
ctxt_pP->module_id,ctxt_pP->frame, size, ue_context_pP->ue_context.rnti);
rrc_data_req(
ctxt_pP,
DCCH,
rrc_eNB_mui++,
SDU_CONFIRM_NO,
size,
buffer,
PDCP_TRANSMISSION_MODE_CONTROL);
return(0);
}
//-----------------------------------------------------------------------------
/**
* @fn :encode_CG_ConfigInfo
......
......@@ -743,51 +743,53 @@ int ngap_gNB_initial_ctxt_resp(
ie->value.present = NGAP_InitialContextSetupResponseIEs__value_PR_PDUSessionResourceFailedToSetupListCxtRes;
for (i = 0; i < initial_ctxt_resp_p->nb_of_pdusessions_failed; i++) {
NGAP_PDUSessionResourceFailedToSetupItemCxtRes_t *item= calloc(1, sizeof *item);
NGAP_PDUSessionResourceSetupUnsuccessfulTransfer_t *pdusessionUnTransfer_p = calloc(1, sizeof *pdusessionUnTransfer_p);
NGAP_PDUSessionResourceFailedToSetupItemCxtRes_t *item = calloc(1, sizeof *item);
NGAP_PDUSessionResourceSetupUnsuccessfulTransfer_t *pdusessionUnTransfer_p = calloc(1, sizeof *pdusessionUnTransfer_p);
/* pDUSessionID */
item->pDUSessionID = initial_ctxt_resp_p->pdusessions_failed[i].pdusession_id;
/* cause */
/* pDUSessionID */
item->pDUSessionID = initial_ctxt_resp_p->pdusessions_failed[i].pdusession_id;
pdusessionUnTransfer_p->cause.present = (NGAP_Cause_PR) initial_ctxt_resp_p->pdusessions_failed[i].cause;
switch(pdusessionUnTransfer_p->cause.present) {
case NGAP_Cause_PR_radioNetwork:
pdusessionUnTransfer_p->cause.choice.radioNetwork = initial_ctxt_resp_p->pdusessions_failed[i].cause_value;
break;
/* cause */
switch(initial_ctxt_resp_p->pdusessions_failed[i].cause) {
case NGAP_CAUSE_RADIO_NETWORK:
pdusessionUnTransfer_p->cause.present = NGAP_Cause_PR_radioNetwork;
pdusessionUnTransfer_p->cause.choice.radioNetwork = initial_ctxt_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_transport:
pdusessionUnTransfer_p->cause.choice.transport = initial_ctxt_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_CAUSE_TRANSPORT:
pdusessionUnTransfer_p->cause.present = NGAP_Cause_PR_transport;
pdusessionUnTransfer_p->cause.choice.transport = initial_ctxt_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_nas:
pdusessionUnTransfer_p->cause.choice.nas = initial_ctxt_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_CAUSE_NAS:
pdusessionUnTransfer_p->cause.present = NGAP_Cause_PR_nas;
pdusessionUnTransfer_p->cause.choice.nas = initial_ctxt_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_protocol:
pdusessionUnTransfer_p->cause.choice.protocol = initial_ctxt_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_CAUSE_PROTOCOL:
pdusessionUnTransfer_p->cause.present = NGAP_Cause_PR_protocol;
pdusessionUnTransfer_p->cause.choice.protocol = initial_ctxt_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_misc:
pdusessionUnTransfer_p->cause.choice.misc = initial_ctxt_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_CAUSE_MISC:
pdusessionUnTransfer_p->cause.present = NGAP_Cause_PR_misc;
pdusessionUnTransfer_p->cause.choice.misc = initial_ctxt_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_NOTHING:
case NGAP_CAUSE_NOTHING:
default:
break;
}
break;
}
NGAP_DEBUG("initial context setup response: failed pdusession ID %ld\n", item->pDUSessionID);
NGAP_DEBUG("initial context setup response: failed pdusession ID %ld\n", item->pDUSessionID);
memset(&res, 0, sizeof(res));
res = asn_encode_to_new_buffer(NULL, ATS_ALIGNED_CANONICAL_PER, &asn_DEF_NGAP_PDUSessionResourceSetupUnsuccessfulTransfer, pdusessionUnTransfer_p);
item->pDUSessionResourceSetupUnsuccessfulTransfer.buf = res.buffer;
item->pDUSessionResourceSetupUnsuccessfulTransfer.size = res.result.encoded;
memset(&res, 0, sizeof(res));
res = asn_encode_to_new_buffer(NULL, ATS_ALIGNED_CANONICAL_PER, &asn_DEF_NGAP_PDUSessionResourceSetupUnsuccessfulTransfer, pdusessionUnTransfer_p);
item->pDUSessionResourceSetupUnsuccessfulTransfer.buf = res.buffer;
item->pDUSessionResourceSetupUnsuccessfulTransfer.size = res.result.encoded;
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_PDUSessionResourceSetupUnsuccessfulTransfer, pdusessionUnTransfer_p);
asn1cSeqAdd(&ie->value.choice.PDUSessionResourceFailedToSetupListCxtRes.list, item);
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_PDUSessionResourceSetupUnsuccessfulTransfer, pdusessionUnTransfer_p);
asn1cSeqAdd(&ie->value.choice.PDUSessionResourceFailedToSetupListCxtRes.list, item);
}
asn1cSeqAdd(&out->protocolIEs.list, ie);
......@@ -1047,31 +1049,35 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance,
item->pDUSessionID = pdusession_setup_resp_p->pdusessions_failed[i].pdusession_id;
/* cause */
pdusessionUnTransfer_p->cause.present = (NGAP_Cause_PR) pdusession_setup_resp_p->pdusessions_failed[i].cause;
switch(pdusessionUnTransfer_p->cause.present) {
case NGAP_Cause_PR_radioNetwork:
pdusessionUnTransfer_p->cause.choice.radioNetwork = pdusession_setup_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_transport:
pdusessionUnTransfer_p->cause.choice.transport = pdusession_setup_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_nas:
pdusessionUnTransfer_p->cause.choice.nas = pdusession_setup_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_protocol:
pdusessionUnTransfer_p->cause.choice.protocol = pdusession_setup_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_misc:
pdusessionUnTransfer_p->cause.choice.misc = pdusession_setup_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_NOTHING:
default:
break;
switch(pdusession_setup_resp_p->pdusessions_failed[i].cause) {
case NGAP_CAUSE_RADIO_NETWORK:
pdusessionUnTransfer_p->cause.present = NGAP_Cause_PR_radioNetwork;
pdusessionUnTransfer_p->cause.choice.radioNetwork = pdusession_setup_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_CAUSE_TRANSPORT:
pdusessionUnTransfer_p->cause.present = NGAP_Cause_PR_transport;
pdusessionUnTransfer_p->cause.choice.transport = pdusession_setup_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_CAUSE_NAS:
pdusessionUnTransfer_p->cause.present = NGAP_Cause_PR_nas;
pdusessionUnTransfer_p->cause.choice.nas = pdusession_setup_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_CAUSE_PROTOCOL:
pdusessionUnTransfer_p->cause.present = NGAP_Cause_PR_protocol;
pdusessionUnTransfer_p->cause.choice.protocol = pdusession_setup_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_CAUSE_MISC:
pdusessionUnTransfer_p->cause.present = NGAP_Cause_PR_misc;
pdusessionUnTransfer_p->cause.choice.misc = pdusession_setup_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_CAUSE_NOTHING:
default:
break;
}
NGAP_DEBUG("pdusession setup response: failed pdusession ID %ld\n", item->pDUSessionID);
......@@ -1230,30 +1236,34 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance,
item->pDUSessionID = pdusession_modify_resp_p->pdusessions_failed[i].pdusession_id;
pdusessionTransfer_p = (NGAP_PDUSessionResourceModifyUnsuccessfulTransfer_t *)calloc(1, sizeof(NGAP_PDUSessionResourceModifyUnsuccessfulTransfer_t));
pdusessionTransfer_p->cause.present = (NGAP_Cause_PR) pdusession_modify_resp_p->pdusessions_failed[i].cause;
switch(pdusessionTransfer_p->cause.present) {
case NGAP_Cause_PR_radioNetwork:
pdusessionTransfer_p->cause.choice.radioNetwork = pdusession_modify_resp_p->pdusessions_failed[i].cause_value;
break;
switch(pdusession_modify_resp_p->pdusessions_failed[i].cause) {
case NGAP_CAUSE_RADIO_NETWORK:
pdusessionTransfer_p->cause.present = NGAP_Cause_PR_radioNetwork;
pdusessionTransfer_p->cause.choice.radioNetwork = pdusession_modify_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_transport:
pdusessionTransfer_p->cause.choice.transport = pdusession_modify_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_CAUSE_TRANSPORT:
pdusessionTransfer_p->cause.present = NGAP_Cause_PR_transport;
pdusessionTransfer_p->cause.choice.transport = pdusession_modify_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_nas:
pdusessionTransfer_p->cause.choice.nas = pdusession_modify_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_CAUSE_NAS:
pdusessionTransfer_p->cause.present = NGAP_Cause_PR_nas;
pdusessionTransfer_p->cause.choice.nas = pdusession_modify_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_protocol:
pdusessionTransfer_p->cause.choice.protocol = pdusession_modify_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_CAUSE_PROTOCOL:
pdusessionTransfer_p->cause.present = NGAP_Cause_PR_protocol;
pdusessionTransfer_p->cause.choice.protocol = pdusession_modify_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_misc:
pdusessionTransfer_p->cause.choice.misc = pdusession_modify_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_CAUSE_MISC:
pdusessionTransfer_p->cause.present = NGAP_Cause_PR_misc;
pdusessionTransfer_p->cause.choice.misc = pdusession_modify_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_NOTHING:
case NGAP_CAUSE_NOTHING:
default:
break;
}
......
......@@ -687,52 +687,56 @@ int s1ap_eNB_initial_ctxt_resp(
/* optional */
if (initial_ctxt_resp_p->nb_of_e_rabs_failed) {
ie = (S1AP_InitialContextSetupResponseIEs_t *)calloc(1, sizeof(S1AP_InitialContextSetupResponseIEs_t));
ie->id = S1AP_ProtocolIE_ID_id_E_RABFailedToSetupListCtxtSURes;
ie->criticality = S1AP_Criticality_ignore;
ie->value.present = S1AP_InitialContextSetupResponseIEs__value_PR_E_RABList;
ie = (S1AP_InitialContextSetupResponseIEs_t *)calloc(1, sizeof(S1AP_InitialContextSetupResponseIEs_t));
ie->id = S1AP_ProtocolIE_ID_id_E_RABFailedToSetupListCtxtSURes;
ie->criticality = S1AP_Criticality_ignore;
ie->value.present = S1AP_InitialContextSetupResponseIEs__value_PR_E_RABList;
for (i = 0; i < initial_ctxt_resp_p->nb_of_e_rabs_failed; i++) {
S1AP_E_RABItemIEs_t *item;
/* mandatory */
item = (S1AP_E_RABItemIEs_t *)calloc(1, sizeof(S1AP_E_RABItemIEs_t));
item->id = S1AP_ProtocolIE_ID_id_E_RABItem;
item->criticality = S1AP_Criticality_ignore;
item->value.present = S1AP_E_RABItemIEs__value_PR_E_RABItem;
item->value.choice.E_RABItem.e_RAB_ID = initial_ctxt_resp_p->e_rabs_failed[i].e_rab_id;
item->value.choice.E_RABItem.cause.present = (S1AP_Cause_PR) initial_ctxt_resp_p->e_rabs_failed[i].cause;
for (i = 0; i < initial_ctxt_resp_p->nb_of_e_rabs_failed; i++) {
S1AP_E_RABItemIEs_t *item;
/* mandatory */
item = (S1AP_E_RABItemIEs_t *)calloc(1, sizeof(S1AP_E_RABItemIEs_t));
item->id = S1AP_ProtocolIE_ID_id_E_RABItem;
item->criticality = S1AP_Criticality_ignore;
item->value.present = S1AP_E_RABItemIEs__value_PR_E_RABItem;
item->value.choice.E_RABItem.e_RAB_ID = initial_ctxt_resp_p->e_rabs_failed[i].e_rab_id;
switch(item->value.choice.E_RABItem.cause.present) {
case S1AP_Cause_PR_radioNetwork:
item->value.choice.E_RABItem.cause.choice.radioNetwork = initial_ctxt_resp_p->e_rabs_failed[i].cause_value;
break;
switch(initial_ctxt_resp_p->e_rabs_failed[i].cause) {
case S1AP_CAUSE_RADIO_NETWORK:
item->value.choice.E_RABItem.cause.present = S1AP_Cause_PR_radioNetwork;
item->value.choice.E_RABItem.cause.choice.radioNetwork = initial_ctxt_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_Cause_PR_transport:
item->value.choice.E_RABItem.cause.choice.transport = initial_ctxt_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_CAUSE_TRANSPORT:
item->value.choice.E_RABItem.cause.present = S1AP_Cause_PR_transport;
item->value.choice.E_RABItem.cause.choice.transport = initial_ctxt_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_Cause_PR_nas:
item->value.choice.E_RABItem.cause.choice.nas = initial_ctxt_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_CAUSE_NAS:
item->value.choice.E_RABItem.cause.present = S1AP_Cause_PR_nas;
item->value.choice.E_RABItem.cause.choice.nas = initial_ctxt_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_Cause_PR_protocol:
item->value.choice.E_RABItem.cause.choice.protocol = initial_ctxt_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_CAUSE_PROTOCOL:
item->value.choice.E_RABItem.cause.present = S1AP_Cause_PR_protocol;
item->value.choice.E_RABItem.cause.choice.protocol = initial_ctxt_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_Cause_PR_misc:
item->value.choice.E_RABItem.cause.choice.misc = initial_ctxt_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_CAUSE_MISC:
item->value.choice.E_RABItem.cause.present = S1AP_Cause_PR_misc;
item->value.choice.E_RABItem.cause.choice.misc = initial_ctxt_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_Cause_PR_NOTHING:
case S1AP_Cause_PR_NOTHING:
default:
break;
}
S1AP_DEBUG("initial context setup response: failed e_rab ID %ld\n", item->value.choice.E_RABItem.e_RAB_ID);
asn1cSeqAdd(&ie->value.choice.E_RABList.list, item);
break;
}
asn1cSeqAdd(&out->protocolIEs.list, ie);
S1AP_DEBUG("initial context setup response: failed e_rab ID %ld\n", item->value.choice.E_RABItem.e_RAB_ID);
asn1cSeqAdd(&ie->value.choice.E_RABList.list, item);
}
asn1cSeqAdd(&out->protocolIEs.list, ie);
}
/* optional */
......@@ -935,51 +939,55 @@ int s1ap_eNB_e_rab_setup_resp(instance_t instance,
/* optional */
if (e_rab_setup_resp_p->nb_of_e_rabs_failed > 0) {
ie = (S1AP_E_RABSetupResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABSetupResponseIEs_t));
ie->id = S1AP_ProtocolIE_ID_id_E_RABFailedToSetupListBearerSURes;
ie->criticality = S1AP_Criticality_ignore;
ie->value.present = S1AP_E_RABSetupResponseIEs__value_PR_E_RABList;
for (i = 0; i < e_rab_setup_resp_p->nb_of_e_rabs_failed; i++) {
S1AP_E_RABItemIEs_t *item;
item = (S1AP_E_RABItemIEs_t *)calloc(1, sizeof(S1AP_E_RABItemIEs_t));
item->id = S1AP_ProtocolIE_ID_id_E_RABItem;
item->criticality = S1AP_Criticality_ignore;
item->value.present = S1AP_E_RABItemIEs__value_PR_E_RABItem;
item->value.choice.E_RABItem.e_RAB_ID = e_rab_setup_resp_p->e_rabs_failed[i].e_rab_id;
item->value.choice.E_RABItem.cause.present = (S1AP_Cause_PR) e_rab_setup_resp_p->e_rabs_failed[i].cause;
ie = (S1AP_E_RABSetupResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABSetupResponseIEs_t));
ie->id = S1AP_ProtocolIE_ID_id_E_RABFailedToSetupListBearerSURes;
ie->criticality = S1AP_Criticality_ignore;
ie->value.present = S1AP_E_RABSetupResponseIEs__value_PR_E_RABList;
for (i = 0; i < e_rab_setup_resp_p->nb_of_e_rabs_failed; i++) {
S1AP_E_RABItemIEs_t *item;
item = (S1AP_E_RABItemIEs_t *)calloc(1, sizeof(S1AP_E_RABItemIEs_t));
item->id = S1AP_ProtocolIE_ID_id_E_RABItem;
item->criticality = S1AP_Criticality_ignore;
item->value.present = S1AP_E_RABItemIEs__value_PR_E_RABItem;
item->value.choice.E_RABItem.e_RAB_ID = e_rab_setup_resp_p->e_rabs_failed[i].e_rab_id;
switch(item->value.choice.E_RABItem.cause.present) {
case S1AP_Cause_PR_radioNetwork:
item->value.choice.E_RABItem.cause.choice.radioNetwork = e_rab_setup_resp_p->e_rabs_failed[i].cause_value;
break;
switch(e_rab_setup_resp_p->e_rabs_failed[i].cause) {
case S1AP_CAUSE_RADIO_NETWORK:
item->value.choice.E_RABItem.cause.present = S1AP_Cause_PR_radioNetwork;
item->value.choice.E_RABItem.cause.choice.radioNetwork = e_rab_setup_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_Cause_PR_transport:
item->value.choice.E_RABItem.cause.choice.transport = e_rab_setup_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_CAUSE_TRANSPORT:
item->value.choice.E_RABItem.cause.present = S1AP_Cause_PR_transport;
item->value.choice.E_RABItem.cause.choice.transport = e_rab_setup_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_Cause_PR_nas:
item->value.choice.E_RABItem.cause.choice.nas = e_rab_setup_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_CAUSE_NAS:
item->value.choice.E_RABItem.cause.present = S1AP_Cause_PR_nas;
item->value.choice.E_RABItem.cause.choice.nas = e_rab_setup_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_Cause_PR_protocol:
item->value.choice.E_RABItem.cause.choice.protocol = e_rab_setup_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_CAUSE_PROTOCOL:
item->value.choice.E_RABItem.cause.present = S1AP_Cause_PR_protocol;
item->value.choice.E_RABItem.cause.choice.protocol = e_rab_setup_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_Cause_PR_misc:
item->value.choice.E_RABItem.cause.choice.misc = e_rab_setup_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_CAUSE_MISC:
item->value.choice.E_RABItem.cause.present = S1AP_Cause_PR_misc;
item->value.choice.E_RABItem.cause.choice.misc = e_rab_setup_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_Cause_PR_NOTHING:
case S1AP_Cause_PR_NOTHING:
default:
break;
}
S1AP_DEBUG("e_rab_setup_resp: failed e_rab ID %ld\n", item->value.choice.E_RABItem.e_RAB_ID);
asn1cSeqAdd(&ie->value.choice.E_RABList.list, item);
break;
}
asn1cSeqAdd(&out->protocolIEs.list, ie);
S1AP_DEBUG("e_rab_setup_resp: failed e_rab ID %ld\n", item->value.choice.E_RABItem.e_RAB_ID);
asn1cSeqAdd(&ie->value.choice.E_RABList.list, item);
}
asn1cSeqAdd(&out->protocolIEs.list, ie);
}
/* optional */
......@@ -1095,51 +1103,54 @@ int s1ap_eNB_e_rab_modify_resp(instance_t instance,
/* optional */
if (e_rab_modify_resp_p->nb_of_e_rabs_failed > 0) {
ie = (S1AP_E_RABModifyResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABModifyResponseIEs_t));
ie->id = S1AP_ProtocolIE_ID_id_E_RABFailedToModifyList;
ie->criticality = S1AP_Criticality_ignore;
ie->value.present = S1AP_E_RABModifyResponseIEs__value_PR_E_RABList;
for (i = 0; i < e_rab_modify_resp_p->nb_of_e_rabs_failed; i++) {
S1AP_E_RABItemIEs_t *item;
item = (S1AP_E_RABItemIEs_t *)calloc(1, sizeof(S1AP_E_RABItemIEs_t));
item->id = S1AP_ProtocolIE_ID_id_E_RABItem;
item->criticality = S1AP_Criticality_ignore;
item->value.present = S1AP_E_RABItemIEs__value_PR_E_RABItem;
item->value.choice.E_RABItem.e_RAB_ID = e_rab_modify_resp_p->e_rabs_failed[i].e_rab_id;
item->value.choice.E_RABItem.cause.present = (S1AP_Cause_PR) e_rab_modify_resp_p->e_rabs_failed[i].cause;
ie = (S1AP_E_RABModifyResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABModifyResponseIEs_t));
ie->id = S1AP_ProtocolIE_ID_id_E_RABFailedToModifyList;
ie->criticality = S1AP_Criticality_ignore;
ie->value.present = S1AP_E_RABModifyResponseIEs__value_PR_E_RABList;
for (i = 0; i < e_rab_modify_resp_p->nb_of_e_rabs_failed; i++) {
S1AP_E_RABItemIEs_t *item;
item = (S1AP_E_RABItemIEs_t *)calloc(1, sizeof(S1AP_E_RABItemIEs_t));
item->id = S1AP_ProtocolIE_ID_id_E_RABItem;
item->criticality = S1AP_Criticality_ignore;
item->value.present = S1AP_E_RABItemIEs__value_PR_E_RABItem;
item->value.choice.E_RABItem.e_RAB_ID = e_rab_modify_resp_p->e_rabs_failed[i].e_rab_id;
switch(item->value.choice.E_RABItem.cause.present) {
case S1AP_Cause_PR_radioNetwork:
item->value.choice.E_RABItem.cause.choice.radioNetwork = e_rab_modify_resp_p->e_rabs_failed[i].cause_value;
break;
switch(e_rab_modify_resp_p->e_rabs_failed[i].cause) {
case S1AP_CAUSE_RADIO_NETWORK:
item->value.choice.E_RABItem.cause.present = S1AP_Cause_PR_radioNetwork;
item->value.choice.E_RABItem.cause.choice.radioNetwork = e_rab_modify_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_Cause_PR_transport:
item->value.choice.E_RABItem.cause.choice.transport = e_rab_modify_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_CAUSE_TRANSPORT:
item->value.choice.E_RABItem.cause.present = S1AP_Cause_PR_transport;
item->value.choice.E_RABItem.cause.choice.transport = e_rab_modify_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_Cause_PR_nas:
item->value.choice.E_RABItem.cause.choice.nas = e_rab_modify_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_CAUSE_NAS:
item->value.choice.E_RABItem.cause.present = S1AP_Cause_PR_nas;
item->value.choice.E_RABItem.cause.choice.nas = e_rab_modify_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_Cause_PR_protocol:
item->value.choice.E_RABItem.cause.choice.protocol = e_rab_modify_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_CAUSE_PROTOCOL:
item->value.choice.E_RABItem.cause.present = S1AP_Cause_PR_protocol;
item->value.choice.E_RABItem.cause.choice.protocol = e_rab_modify_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_Cause_PR_misc:
item->value.choice.E_RABItem.cause.choice.misc = e_rab_modify_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_CAUSE_MISC:
item->value.choice.E_RABItem.cause.present = S1AP_Cause_PR_misc;
item->value.choice.E_RABItem.cause.choice.misc = e_rab_modify_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_Cause_PR_NOTHING:
case S1AP_Cause_PR_NOTHING:
default:
break;
}
S1AP_DEBUG("e_rab_modify_resp: failed e_rab ID %ld\n", item->value.choice.E_RABItem.e_RAB_ID);
asn1cSeqAdd(&ie->value.choice.E_RABList.list, item);
break;
}
asn1cSeqAdd(&out->protocolIEs.list, ie);
S1AP_DEBUG("e_rab_modify_resp: failed e_rab ID %ld\n", item->value.choice.E_RABItem.e_RAB_ID);
asn1cSeqAdd(&ie->value.choice.E_RABList.list, item);
}
asn1cSeqAdd(&out->protocolIEs.list, ie);
}
/* optional */
......@@ -1243,48 +1254,47 @@ int s1ap_eNB_e_rab_release_resp(instance_t instance,
ie->value.present = S1AP_E_RABReleaseResponseIEs__value_PR_E_RABList;
for (i = 0; i < e_rab_release_resp_p->nb_of_e_rabs_failed; i++) {
S1AP_E_RABItemIEs_t *item;
item = (S1AP_E_RABItemIEs_t *)calloc(1, sizeof(S1AP_E_RABItemIEs_t));
item->id = S1AP_ProtocolIE_ID_id_E_RABItem;
item->criticality = S1AP_Criticality_ignore;
item->value.present = S1AP_E_RABItemIEs__value_PR_E_RABItem;
item->value.choice.E_RABItem.e_RAB_ID = e_rab_release_resp_p->e_rabs_failed[i].e_rab_id;
item->value.choice.E_RABItem.cause.present = (S1AP_Cause_PR) e_rab_release_resp_p->e_rabs_failed[i].cause;
switch(item->value.choice.E_RABItem.cause.present) {
case S1AP_Cause_PR_radioNetwork:
item->value.choice.E_RABItem.cause.choice.radioNetwork = e_rab_release_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_Cause_PR_transport:
item->value.choice.E_RABItem.cause.choice.transport = e_rab_release_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_Cause_PR_nas:
item->value.choice.E_RABItem.cause.choice.nas = e_rab_release_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_Cause_PR_protocol:
item->value.choice.E_RABItem.cause.choice.protocol = e_rab_release_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_Cause_PR_misc:
item->value.choice.E_RABItem.cause.choice.misc = e_rab_release_resp_p->e_rabs_failed[i].cause_value;
break;
S1AP_E_RABItemIEs_t *item;
item = (S1AP_E_RABItemIEs_t *)calloc(1, sizeof(S1AP_E_RABItemIEs_t));
item->id = S1AP_ProtocolIE_ID_id_E_RABItem;
item->criticality = S1AP_Criticality_ignore;
item->value.present = S1AP_E_RABItemIEs__value_PR_E_RABItem;
item->value.choice.E_RABItem.e_RAB_ID = e_rab_release_resp_p->e_rabs_failed[i].e_rab_id;
switch(e_rab_release_resp_p->e_rabs_failed[i].cause) {
case S1AP_CAUSE_RADIO_NETWORK:
item->value.choice.E_RABItem.cause.present = S1AP_Cause_PR_radioNetwork;
item->value.choice.E_RABItem.cause.choice.radioNetwork = e_rab_release_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_CAUSE_TRANSPORT:
item->value.choice.E_RABItem.cause.present = S1AP_Cause_PR_transport;
item->value.choice.E_RABItem.cause.choice.transport = e_rab_release_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_CAUSE_NAS:
item->value.choice.E_RABItem.cause.present = S1AP_Cause_PR_nas;
item->value.choice.E_RABItem.cause.choice.nas = e_rab_release_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_CAUSE_PROTOCOL:
item->value.choice.E_RABItem.cause.present = S1AP_Cause_PR_protocol;
item->value.choice.E_RABItem.cause.choice.protocol = e_rab_release_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_CAUSE_MISC:
item->value.choice.E_RABItem.cause.present = S1AP_Cause_PR_misc;
item->value.choice.E_RABItem.cause.choice.misc = e_rab_release_resp_p->e_rabs_failed[i].cause_value;
break;
case S1AP_Cause_PR_NOTHING:
default:
break;
}
asn1cSeqAdd(&ie->value.choice.E_RABList.list, item);
break;
}
asn1cSeqAdd(&ie->value.choice.E_RABList.list, item);
}
asn1cSeqAdd(&out->protocolIEs.list, ie);
}
if (s1ap_eNB_encode_pdu(&pdu, &buffer, &length) < 0) {
S1AP_ERROR("Failed to encode release response\n");
/* Encode procedure has failed... */
......
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