Commit f3f2bc58 authored by Robert Schmidt's avatar Robert Schmidt

F1AP_UE_CONTEXT_RELEASE_REQ: implement in DU

* MAC differentiates between DU/eNB
* sends ITTI message to DU task for F1AP_UE_CONTEXT_RELEASE_REQ
* message is dispatched to correctly in DU_TASK
* sender correctly fills IDs and cause and sends
parent d9bf26b9
......@@ -34,6 +34,7 @@ MESSAGE_DEF(F1AP_INITIAL_UL_RRC_MESSAGE , MESSAGE_PRIORITY_MED, f1ap_i
MESSAGE_DEF(F1AP_UL_RRC_MESSAGE , MESSAGE_PRIORITY_MED, f1ap_ul_rrc_message_t , f1ap_ul_rrc_message)
//MESSAGE_DEF(F1AP_INITIAL_CONTEXT_SETUP_RESP, MESSAGE_PRIORITY_MED, f1ap_initial_context_setup_resp_t, f1ap_initial_context_setup_resp)
//MESSAGE_DEF(F1AP_INITIAL_CONTEXT_SETUP_FAILURE, MESSAGE_PRIORITY_MED, f1ap_initial_context_setup_failure_t, f1ap_initial_context_setup_failure)
MESSAGE_DEF(F1AP_UE_CONTEXT_RELEASE_REQ, MESSAGE_PRIORITY_MED, f1ap_ue_context_release_req_t, f1ap_ue_context_release_req)
/* RRC -> F1AP messages */
......
......@@ -289,4 +289,20 @@ typedef struct f1ap_ue_context_setup_req_s {
int rrc_container_length;
} f1ap_ue_context_setup_req_t;
typedef enum F1ap_Cause_e {
F1AP_CAUSE_NOTHING, /* No components present */
F1AP_CAUSE_RADIO_NETWORK,
F1AP_CAUSE_TRANSPORT,
F1AP_CAUSE_PROTOCOL,
F1AP_CAUSE_MISC,
} f1ap_Cause_t;
typedef struct f1ap_ue_context_release_s {
uint16_t rnti;
f1ap_Cause_t cause;
long cause_value;
uint8_t *rrc_container;
int rrc_container_length;
} f1ap_ue_context_release_req_t, f1ap_ue_context_release_cmd_t;
#endif /* F1AP_MESSAGES_TYPES_H_ */
......@@ -57,9 +57,7 @@
extern f1ap_setup_req_t *f1ap_du_data;
extern RAN_CONTEXT_t RC;
f1ap_cudu_ue_inst_t f1ap_du_ue[MAX_eNB];
extern f1ap_cudu_ue_inst_t f1ap_du_ue[MAX_eNB];
......
......@@ -39,6 +39,7 @@
extern RAN_CONTEXT_t RC;
f1ap_setup_req_t *f1ap_du_data;
f1ap_cudu_ue_inst_t f1ap_du_ue[MAX_eNB];
void du_task_send_sctp_association_req(instance_t instance, f1ap_setup_req_t *f1ap_setup_req) {
......@@ -179,6 +180,12 @@ void *F1AP_DU_task(void *arg) {
// &F1AP_UL_RRC_MESSAGE(received_msg));
break;
case F1AP_UE_CONTEXT_RELEASE_REQ: // from MAC
LOG_I(DU_F1AP, "DU Task Received F1AP_UE_CONTEXT_RELEASE_REQ\n");
DU_send_UE_CONTEXT_RELEASE_REQUEST(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&F1AP_UE_CONTEXT_RELEASE_REQ(received_msg));
break;
case TERMINATE_MESSAGE:
LOG_W(DU_F1AP, " *** Exiting DU_F1AP thread\n");
itti_exit_task();
......
......@@ -44,6 +44,7 @@
#undef C_RNTI
extern f1ap_setup_req_t *f1ap_du_data;
extern f1ap_cudu_ue_inst_t f1ap_du_ue[MAX_eNB];
int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
uint32_t assoc_id,
......@@ -554,9 +555,8 @@ int DU_send_UE_CONTEXT_SETUP_FAILURE(instance_t instance) {
}
// note: is temporary with f1ap_ue_context_setup_req_t
int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
f1ap_ue_context_setup_req_t *f1ap_ue_context_setup_req) {
f1ap_ue_context_release_req_t *req) {
F1AP_F1AP_PDU_t pdu;
F1AP_UEContextReleaseRequest_t *out;
F1AP_UEContextReleaseRequestIEs_t *ie;
......@@ -581,7 +581,7 @@ int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextReleaseRequestIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_ue_context_setup_req->gNB_CU_ue_id;
ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(&f1ap_du_ue[instance], req->rnti);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
......@@ -590,7 +590,7 @@ int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextReleaseRequestIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = *f1ap_ue_context_setup_req->gNB_DU_ue_id;
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(&f1ap_du_ue[instance], req->rnti);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
......@@ -600,25 +600,27 @@ int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_UEContextReleaseRequestIEs__value_PR_Cause;
// dummy value
ie->value.choice.Cause.present = F1AP_Cause_PR_radioNetwork;
switch(ie->value.choice.Cause.present)
switch (req->cause)
{
case F1AP_Cause_PR_radioNetwork:
ie->value.choice.Cause.choice.radioNetwork = F1AP_CauseRadioNetwork_unspecified;
case F1AP_CAUSE_RADIO_NETWORK:
ie->value.choice.Cause.present = F1AP_Cause_PR_radioNetwork;
ie->value.choice.Cause.choice.radioNetwork = req->cause_value;
break;
case F1AP_Cause_PR_transport:
ie->value.choice.Cause.choice.transport = F1AP_CauseTransport_unspecified;
case F1AP_CAUSE_TRANSPORT:
ie->value.choice.Cause.present = F1AP_Cause_PR_transport;
ie->value.choice.Cause.choice.transport = req->cause_value;
break;
case F1AP_Cause_PR_protocol:
ie->value.choice.Cause.choice.protocol = F1AP_CauseProtocol_unspecified;
case F1AP_CAUSE_PROTOCOL:
ie->value.choice.Cause.present = F1AP_Cause_PR_protocol;
ie->value.choice.Cause.choice.protocol = req->cause_value;
break;
case F1AP_Cause_PR_misc:
ie->value.choice.Cause.choice.misc = F1AP_CauseMisc_unspecified;
case F1AP_CAUSE_MISC:
ie->value.choice.Cause.present = F1AP_Cause_PR_misc;
ie->value.choice.Cause.choice.misc = req->cause_value;
break;
case F1AP_Cause_PR_NOTHING:
case F1AP_CAUSE_NOTHING:
default:
ie->value.choice.Cause.present = F1AP_Cause_PR_NOTHING;
break;
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
......@@ -629,7 +631,11 @@ int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
return -1;
}
// send
du_f1ap_itti_send_sctp_data_req(instance,
f1ap_du_data->assoc_id,
buffer,
len,
f1ap_du_data->default_sctp_stream_id);
return 0;
}
......
......@@ -47,9 +47,8 @@ int DU_send_UE_CONTEXT_SETUP_FAILURE(instance_t instance);
/*
* UE Context Release Request (gNB-DU initiated)
*/
// note: is temporary with f1ap_ue_context_setup_req_t
int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
f1ap_ue_context_setup_req_t *f1ap_ue_context_setup_req);
f1ap_ue_context_release_req_t *req);
/*
......
......@@ -2059,16 +2059,33 @@ int rrc_mac_remove_ue(module_id_t mod_idP, rnti_t rntiP)
cancel_ra_proc(mod_idP, pCC_id, 0, rntiP);
}
if (RC.rrc[mod_idP]->node_type == ngran_eNB_DU
&& RC.rrc[mod_idP]->node_type == ngran_gNB_DU) {
MessageDef *m = itti_alloc_new_message(TASK_MAC_ENB, F1AP_UE_CONTEXT_RELEASE_REQ);
F1AP_UE_CONTEXT_RELEASE_REQ(m).rnti = rntiP;
F1AP_UE_CONTEXT_RELEASE_REQ(m).cause = F1AP_CAUSE_RADIO_NETWORK;
F1AP_UE_CONTEXT_RELEASE_REQ(m).cause_value = 1; // 1 = F1AP_CauseRadioNetwork_rl_failure
F1AP_UE_CONTEXT_RELEASE_REQ(m).rrc_container = NULL;
F1AP_UE_CONTEXT_RELEASE_REQ(m).rrc_container_length = 0;
itti_send_msg_to_task(TASK_DU_F1, mod_idP, m);
}
rrc_mac_signal_ue_release(mod_idP, rntiP);
return 0;
}
void rrc_mac_signal_ue_release(module_id_t mod_idP, rnti_t rntiP)
{
pthread_mutex_lock(&rrc_release_freelist);
if(rrc_release_info.num_UEs > 0){
if (rrc_release_info.num_UEs > 0) {
uint16_t release_total = 0;
for(uint16_t release_num = 0;release_num < NUMBER_OF_UE_MAX;release_num++){
if(rrc_release_info.RRC_release_ctrl[release_num].flag > 0){
for (uint16_t release_num = 0; release_num < NUMBER_OF_UE_MAX; release_num++) {
if (rrc_release_info.RRC_release_ctrl[release_num].flag > 0)
release_total++;
}else{
else
continue;
}
if(rrc_release_info.RRC_release_ctrl[release_num].rnti == rntiP){
if (rrc_release_info.RRC_release_ctrl[release_num].rnti == rntiP) {
rrc_release_info.RRC_release_ctrl[release_num].flag = 0;
rrc_release_info.num_UEs--;
release_total--;
......@@ -2079,8 +2096,6 @@ int rrc_mac_remove_ue(module_id_t mod_idP, rnti_t rntiP)
}
}
pthread_mutex_unlock(&rrc_release_freelist);
return 0;
}
int prev(UE_list_t * listP, int nodeP, int ul_flag)
......
......@@ -699,6 +699,7 @@ int add_new_ue(module_id_t Mod_id, int CC_id, rnti_t rnti, int harq_pid
#endif
);
int rrc_mac_remove_ue(module_id_t Mod_id, rnti_t rntiP);
void rrc_mac_signal_ue_release(module_id_t Mod_id, rnti_t rntiP);
void store_dlsch_buffer(module_id_t Mod_id, int slice_idx, frame_t frameP, sub_frame_t subframeP);
void assign_rbs_required(module_id_t Mod_id, int slice_idx, frame_t frameP, sub_frame_t subframe, uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], int min_rb_unit[NFAPI_CC_MAX]);
......
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