Merge remote-tracking branch 'origin/e1-issue-712' into integration_2024_w04
This commit is contained in:
@@ -129,6 +129,9 @@ sctp_assoc_t get_existing_cuup_for_ue(const gNB_RRC_INST *rrc, const gNB_RRC_UE_
|
||||
sctp_assoc_t get_new_cuup_for_ue(const gNB_RRC_INST *rrc, const gNB_RRC_UE_t *ue, int sst, int sd);
|
||||
int rrc_gNB_process_e1_setup_req(sctp_assoc_t assoc_id, e1ap_setup_req_t *req);
|
||||
|
||||
/* Process indication of E1 connection loss on CU-CP */
|
||||
void rrc_gNB_process_e1_lost_connection(gNB_RRC_INST *rrc, e1ap_lost_connection_t *lc, sctp_assoc_t assoc_id);
|
||||
|
||||
void bearer_context_setup_direct(e1ap_bearer_setup_req_t *req,
|
||||
instance_t instance);
|
||||
|
||||
|
||||
@@ -2065,6 +2065,9 @@ static pdusession_level_qos_parameter_t *get_qos_characteristics(const int qfi,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief E1AP Bearer Context Setup Response processing on CU-CP
|
||||
*/
|
||||
void rrc_gNB_process_e1_bearer_context_setup_resp(e1ap_bearer_setup_resp_t *resp, instance_t instance)
|
||||
{
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[0];
|
||||
@@ -2172,6 +2175,9 @@ void rrc_gNB_process_e1_bearer_context_setup_resp(e1ap_bearer_setup_resp_t *resp
|
||||
rrc->mac_rrc.ue_context_modification_request(ue_data.du_assoc_id, &ue_context_modif_req);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief E1AP Bearer Context Modification Response processing on CU-CP
|
||||
*/
|
||||
void rrc_gNB_process_e1_bearer_context_modif_resp(const e1ap_bearer_modif_resp_t *resp)
|
||||
{
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[0];
|
||||
@@ -2188,6 +2194,9 @@ void rrc_gNB_process_e1_bearer_context_modif_resp(const e1ap_bearer_modif_resp_t
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief E1AP Bearer Context Release processing
|
||||
*/
|
||||
void rrc_gNB_process_e1_bearer_context_release_cplt(const e1ap_bearer_release_cplt_t *cplt)
|
||||
{
|
||||
// there is not really anything to do here as of now
|
||||
@@ -2467,6 +2476,10 @@ void *rrc_gnb_task(void *args_p) {
|
||||
rrc_gNB_process_e1_bearer_context_release_cplt(&E1AP_BEARER_CONTEXT_RELEASE_CPLT(msg_p));
|
||||
break;
|
||||
|
||||
case E1AP_LOST_CONNECTION: /* CUCP */
|
||||
rrc_gNB_process_e1_lost_connection(RC.nrrrc[0], &E1AP_LOST_CONNECTION(msg_p), msg_p->ittiMsgHeader.originInstance);
|
||||
break;
|
||||
|
||||
case NGAP_PAGING_IND:
|
||||
rrc_gNB_process_PAGING_IND(msg_p, instance);
|
||||
break;
|
||||
|
||||
@@ -122,6 +122,26 @@ sctp_assoc_t get_new_cuup_for_ue(const gNB_RRC_INST *rrc, const gNB_RRC_UE_t *ue
|
||||
return ue_data.e1_assoc_id;
|
||||
}
|
||||
|
||||
/* CU-CP Functions */
|
||||
|
||||
/**
|
||||
* @brief Trigger E1AP Setup Failure on CU-CP
|
||||
*/
|
||||
static void e1ap_setup_failure(sctp_assoc_t assoc_id, uint64_t transac_id)
|
||||
{
|
||||
MessageDef *msg_p = itti_alloc_new_message(TASK_RRC_GNB, 0, E1AP_SETUP_FAIL);
|
||||
msg_p->ittiMsgHeader.originInstance = assoc_id;
|
||||
e1ap_setup_fail_t *setup_fail = &E1AP_SETUP_FAIL(msg_p);
|
||||
setup_fail->transac_id = transac_id;
|
||||
LOG_I(NR_RRC, "Triggering E1AP Setup Failure for transac_id %ld, assoc_id %ld\n",
|
||||
transac_id,
|
||||
msg_p->ittiMsgHeader.originInstance);
|
||||
itti_send_msg_to_task(TASK_CUCP_E1, 0 /*unused by callee*/, msg_p);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief E1AP Setup Request processing on CU-CP
|
||||
*/
|
||||
int rrc_gNB_process_e1_setup_req(sctp_assoc_t assoc_id, e1ap_setup_req_t *req)
|
||||
{
|
||||
AssertFatal(req->supported_plmns <= PLMN_LIST_MAX_SIZE, "Supported PLMNs is more than PLMN_LIST_MAX_SIZE\n");
|
||||
@@ -138,6 +158,7 @@ int rrc_gNB_process_e1_setup_req(sctp_assoc_t assoc_id, e1ap_setup_req_t *req)
|
||||
c->setup_req->gNB_cu_up_id,
|
||||
c->setup_req->gNB_cu_up_name,
|
||||
c->assoc_id);
|
||||
e1ap_setup_failure(assoc_id, req->transac_id);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -151,11 +172,12 @@ int rrc_gNB_process_e1_setup_req(sctp_assoc_t assoc_id, e1ap_setup_req_t *req)
|
||||
id->mnc,
|
||||
rrc->configuration.mcc[i],
|
||||
rrc->configuration.mnc[i]);
|
||||
e1ap_setup_failure(assoc_id, req->transac_id);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_I(RRC, "Accepting new CU-UP ID %ld name %s (assoc_id %d)\n", req->gNB_cu_up_id, req->gNB_cu_up_name, assoc_id);
|
||||
LOG_I(NR_RRC, "Accepting new CU-UP ID %ld name %s (assoc_id %d)\n", req->gNB_cu_up_id, req->gNB_cu_up_name, assoc_id);
|
||||
nr_rrc_cuup_container_t *cuup = malloc(sizeof(*cuup));
|
||||
AssertFatal(cuup, "out of memory\n");
|
||||
cuup->setup_req = malloc(sizeof(*cuup->setup_req));
|
||||
@@ -172,3 +194,28 @@ int rrc_gNB_process_e1_setup_req(sctp_assoc_t assoc_id, e1ap_setup_req_t *req)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief RRC Processing of the indication of E1 connection loss on CU-CP
|
||||
*/
|
||||
void rrc_gNB_process_e1_lost_connection(gNB_RRC_INST *rrc, e1ap_lost_connection_t *lc, sctp_assoc_t assoc_id)
|
||||
{
|
||||
LOG_I(NR_RRC, "Received E1 connection loss indication on RRC\n");
|
||||
AssertFatal(assoc_id != 0, "illegal assoc_id == 0: should be -1 (monolithic) or >0 (split)\n");
|
||||
nr_rrc_cuup_container_t e = {.assoc_id = assoc_id};
|
||||
nr_rrc_cuup_container_t *cuup = RB_FIND(rrc_cuup_tree, &rrc->cuups, &e);
|
||||
if (cuup == NULL) {
|
||||
LOG_W(NR_RRC, "CU-UP for assoc_id %d not found!\n", assoc_id);
|
||||
return;
|
||||
}
|
||||
if (cuup->setup_req != NULL) {
|
||||
e1ap_setup_req_t *req = cuup->setup_req;
|
||||
LOG_I(NR_RRC, "releasing CU-UP %s on assoc_id %d\n", req->gNB_cu_up_name, assoc_id);
|
||||
free(cuup->setup_req);
|
||||
}
|
||||
nr_rrc_cuup_container_t *removed = RB_REMOVE(rrc_cuup_tree, &rrc->cuups, cuup);
|
||||
// Free relevant CU-UP structures
|
||||
free(cuup);
|
||||
DevAssert(removed != NULL);
|
||||
rrc->num_cuups--;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user