Cleanup rrc_gNB_generate_RRCRelease(): pass context directly
This commit is contained in:
@@ -68,9 +68,9 @@ static int get_single_ue_id(void)
|
||||
* @param prnt: Print function
|
||||
* @return 0 on success, -1 on failure
|
||||
*/
|
||||
int rrc_gNB_trigger_release(char *buf, int debug, telnet_printfunc_t prnt) {
|
||||
int rrc_gNB_trigger_release(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
ue_id_t ue_id = -1;
|
||||
protocol_ctxt_t ctxt;
|
||||
|
||||
if (!buf) {
|
||||
ue_id = get_single_ue_id();
|
||||
@@ -96,10 +96,8 @@ int rrc_gNB_trigger_release(char *buf, int debug, telnet_printfunc_t prnt) {
|
||||
}
|
||||
|
||||
gNB_RRC_UE_t *UE = &ue_context_p->ue_context;
|
||||
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, 0, GNB_FLAG_YES, UE->rrc_ue_id, 0, 0);
|
||||
ctxt.eNB_index = 0;
|
||||
|
||||
rrc_gNB_generate_RRCRelease(&ctxt, ue_context_p);
|
||||
rrc_gNB_generate_RRCRelease(rrc, UE);
|
||||
prnt("RRC Release triggered for UE %u\n", ue_id);
|
||||
|
||||
return 0;
|
||||
@@ -108,16 +106,14 @@ int rrc_gNB_trigger_release(char *buf, int debug, telnet_printfunc_t prnt) {
|
||||
/**
|
||||
* @brief Trigger RRC Release for all UEs
|
||||
*/
|
||||
int rrc_gNB_trigger_release_all(char *buf, int debug, telnet_printfunc_t prnt) {
|
||||
int rrc_gNB_trigger_release_all(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
rrc_gNB_ue_context_t *ue_context_p = NULL;
|
||||
protocol_ctxt_t ctxt; /* Not sure what exactly is this */
|
||||
|
||||
RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &(RC.nrrrc[0]->rrc_ue_head)) {
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[0];
|
||||
RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &rrc->rrc_ue_head) {
|
||||
gNB_RRC_UE_t *UE = &ue_context_p->ue_context;
|
||||
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, 0, GNB_FLAG_YES, UE->rrc_ue_id, 0, 0);
|
||||
ctxt.eNB_index = 0;
|
||||
|
||||
rrc_gNB_generate_RRCRelease(&ctxt, ue_context_p);
|
||||
rrc_gNB_generate_RRCRelease(rrc, UE);
|
||||
prnt("RRC Release triggered for UE %u\n", UE->rrc_ue_id);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,13 +46,6 @@
|
||||
|
||||
#define NR_MAX_SUPPORTED_DL_LAYERS 4
|
||||
|
||||
void rrc_gNB_generate_SgNBAdditionRequestAcknowledge(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_gNB_ue_context_t *const ue_context_pP
|
||||
);
|
||||
|
||||
rrc_gNB_ue_context_t *rrc_gNB_allocate_new_UE_context(gNB_RRC_INST *rrc_instance_pP);
|
||||
|
||||
void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc,NR_UE_CapabilityRAT_ContainerList_t *UE_CapabilityRAT_ContainerList, x2ap_ENDC_sgnb_addition_req_t *m, NR_CG_ConfigInfo_IEs_t * cg_config_info);
|
||||
|
||||
void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2ap_ENDC_sgnb_addition_req_t *m);
|
||||
@@ -72,11 +65,7 @@ void rrc_forward_ue_nas_message(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE);
|
||||
|
||||
unsigned int rrc_gNB_get_next_transaction_identifier(module_id_t gnb_mod_idP);
|
||||
|
||||
void
|
||||
rrc_gNB_generate_RRCRelease(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_gNB_ue_context_t *const ue_context_pP
|
||||
);
|
||||
void rrc_gNB_generate_RRCRelease(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE);
|
||||
|
||||
/**\brief RRC eNB task.
|
||||
\param args_p Pointer on arguments to start the task. */
|
||||
|
||||
@@ -2529,23 +2529,13 @@ static void rrc_deliver_ue_ctxt_release_cmd(void *deliver_pdu_data, ue_id_t ue_i
|
||||
* Generate the RRC Connection Release to UE.
|
||||
* If received, UE should switch to RRC_IDLE mode.
|
||||
*/
|
||||
void
|
||||
rrc_gNB_generate_RRCRelease(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_gNB_ue_context_t *const ue_context_pP
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
void rrc_gNB_generate_RRCRelease(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE)
|
||||
{
|
||||
uint8_t buffer[NR_RRC_BUF_SIZE] = {0};
|
||||
int size = do_NR_RRCRelease(buffer, NR_RRC_BUF_SIZE, rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id));
|
||||
int size = do_NR_RRCRelease(buffer, NR_RRC_BUF_SIZE, rrc_gNB_get_next_transaction_identifier(rrc->module_id));
|
||||
|
||||
LOG_I(NR_RRC,
|
||||
PROTOCOL_NR_RRC_CTXT_UE_FMT" Logical Channel DL-DCCH, Generate RRCRelease (bytes %d)\n",
|
||||
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
size);
|
||||
LOG_I(NR_RRC, "UE %d: Generate RRCRelease (bytes %d)\n", UE->rrc_ue_id, size);
|
||||
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id];
|
||||
const gNB_RRC_UE_t *UE = &ue_context_pP->ue_context;
|
||||
f1_ue_data_t ue_data = cu_get_f1_ue_data(UE->rrc_ue_id);
|
||||
RETURN_IF_INVALID_ASSOC_ID(ue_data.du_assoc_id);
|
||||
f1ap_ue_context_release_cmd_t ue_context_release_cmd = {
|
||||
@@ -2556,7 +2546,7 @@ rrc_gNB_generate_RRCRelease(
|
||||
.srb_id = DCCH,
|
||||
};
|
||||
deliver_ue_ctxt_release_data_t data = {.rrc = rrc, .release_cmd = &ue_context_release_cmd, .assoc_id = ue_data.du_assoc_id};
|
||||
nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, rrc_gNB_mui++, size, buffer, rrc_deliver_ue_ctxt_release_cmd, &data);
|
||||
nr_pdcp_data_req_srb(UE->rrc_ue_id, DCCH, rrc_gNB_mui++, size, buffer, rrc_deliver_ue_ctxt_release_cmd, &data);
|
||||
}
|
||||
|
||||
int rrc_gNB_generate_pcch_msg(sctp_assoc_t assoc_id, const NR_SIB1_t *sib1, uint32_t tmsi, uint8_t paging_drx)
|
||||
|
||||
@@ -1091,7 +1091,6 @@ int rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND(MessageDef *msg_p, instance_
|
||||
{
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[0];
|
||||
uint32_t gNB_ue_ngap_id = 0;
|
||||
protocol_ctxt_t ctxt;
|
||||
gNB_ue_ngap_id = NGAP_UE_CONTEXT_RELEASE_COMMAND(msg_p).gNB_ue_ngap_id;
|
||||
rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[instance], gNB_ue_ngap_id);
|
||||
|
||||
@@ -1124,9 +1123,7 @@ int rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND(MessageDef *msg_p, instance_
|
||||
/* special case: the DU might be offline, in which case the f1_ue_data exists
|
||||
* but is set to 0 */
|
||||
if (cu_exists_f1_ue_data(UE->rrc_ue_id) && cu_get_f1_ue_data(UE->rrc_ue_id).du_assoc_id != 0) {
|
||||
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, GNB_FLAG_YES, UE->rrc_ue_id, 0, 0);
|
||||
ctxt.eNB_index = 0;
|
||||
rrc_gNB_generate_RRCRelease(&ctxt, ue_context_p);
|
||||
rrc_gNB_generate_RRCRelease(rrc, UE);
|
||||
|
||||
/* UE will be freed after UE context release complete */
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user