@@ -35,7 +35,6 @@ f1ap_cu_impl::f1ap_cu_impl(f1ap_message_notifier& f1ap_pdu_notifier_,
3535 pdu_notifier(f1ap_pdu_notifier_),
3636 du_processor_notifier(f1ap_du_processor_notifier_),
3737 du_management_notifier(f1ap_du_management_notifier_),
38- cu_cp_notifier(f1ap_cu_cp_notifier_),
3938 ctrl_exec(ctrl_exec_)
4039{
4140}
@@ -224,75 +223,68 @@ void f1ap_cu_impl::handle_f1_setup_request(const f1_setup_request_s& request)
224223
225224void f1ap_cu_impl::handle_initial_ul_rrc_message (const init_ul_rrc_msg_transfer_s& msg)
226225{
226+ const gnb_du_ue_f1ap_id_t du_ue_id = int_to_gnb_du_ue_f1ap_id (msg->gnb_du_ue_f1ap_id );
227+
227228 nr_cell_global_id_t cgi = cgi_from_asn1 (msg->nr_cgi );
228- if (not srsran:: config_helpers::is_valid (cgi)) {
229- logger.warning (" du_ue_f1ap_id={}: Dropping InitialUlRrcMessageTransfer . Invalid CGI" , msg-> gnb_du_ue_f1ap_id );
229+ if (not config_helpers::is_valid (cgi)) {
230+ logger.warning (" du_ue_f1ap_id={}: Dropping InitialULRRCMessageTransfer . Invalid CGI" , du_ue_id );
230231 return ;
231232 }
232233
233234 rnti_t crnti = to_rnti (msg->c_rnti );
234235 if (crnti == rnti_t ::INVALID_RNTI) {
235- logger.warning (" du_ue_f1ap_id={}: Dropping InitialUlRrcMessageTransfer. Invalid RNTI" , msg-> gnb_du_ue_f1ap_id );
236+ logger.warning (" du_ue_f1ap_id={}: Dropping InitialULRRCMessageTransfer. Cause: Invalid C- RNTI" , du_ue_id );
236237 return ;
237238 }
238239
239- logger.debug (" du_ue_f1ap_id={} nci={} crnti={} plmn={}: Received InitialUlRrcMessageTransfer " ,
240- msg-> gnb_du_ue_f1ap_id ,
240+ logger.debug (" du_ue_f1ap_id={} nci={} crnti={} plmn={}: Received InitialULRRCMessageTransfer " ,
241+ du_ue_id ,
241242 cgi.nci ,
242243 crnti,
243244 cgi.plmn );
244245
245246 if (msg->sul_access_ind_present ) {
246- logger.debug (" du_ue_f1ap_id={}: Ignoring SUL access indicator" , msg-> gnb_du_ue_f1ap_id );
247+ logger.debug (" du_ue_f1ap_id={}: Ignoring SUL access indicator" , du_ue_id );
247248 }
248249
249- gnb_cu_ue_f1ap_id_t cu_ue_f1ap_id = ue_ctxt_list.next_gnb_cu_ue_f1ap_id ();
250+ const gnb_cu_ue_f1ap_id_t cu_ue_f1ap_id = ue_ctxt_list.next_gnb_cu_ue_f1ap_id ();
250251 if (cu_ue_f1ap_id == gnb_cu_ue_f1ap_id_t ::invalid) {
251- logger.warning (" du_ue_f1ap_id={}: Dropping InitialUlRrcMessageTransfer. No CU UE F1AP ID available" ,
252- msg->gnb_du_ue_f1ap_id );
253- return ;
254- }
255-
256- // Request UE index allocation
257- ue_index_t ue_index = du_processor_notifier.on_new_ue_index_required ();
258- if (ue_index == ue_index_t ::invalid) {
259- logger.warning (" du_ue_f1ap_id={}: Dropping InitialUlRrcMessageTransfer. No UE Index available" ,
260- msg->gnb_du_ue_f1ap_id );
252+ logger.warning (" du_ue_f1ap_id={}: Dropping InitialULRRCMessageTransfer. Cause: Failed to allocate CU-UE-F1AP-ID" ,
253+ du_ue_id);
261254 return ;
262255 }
263256
264- // Request UE creation
265- cu_cp_ue_creation_message ue_creation_msg = {};
266- ue_creation_msg.ue_index = ue_index ;
257+ // Request UE context creation to CU-CP.
258+ cu_cp_ue_creation_request ue_creation_msg = {};
259+ ue_creation_msg.cgi = cgi ;
267260 ue_creation_msg.c_rnti = crnti;
268- ue_creation_msg.cgi = cgi_from_asn1 (msg->nr_cgi );
269261 if (msg->du_to_cu_rrc_container_present ) {
270262 ue_creation_msg.du_to_cu_rrc_container = byte_buffer (msg->du_to_cu_rrc_container );
271263 } else {
272264 // Assume the DU can't serve the UE, so the CU-CP should reject the UE, see TS 38.473 section 8.4.1.2.
273265 // We will forward an empty container to the RRC UE, that will trigger an RRC Reject
274266 logger.debug (" du_ue_f1ap_id={}: Forwarding InitialUlRrcMessageTransfer to RRC to reject the UE. Cause: Missing DU "
275267 " to CU container" ,
276- msg-> gnb_du_ue_f1ap_id );
268+ du_ue_id );
277269 ue_creation_msg.du_to_cu_rrc_container = byte_buffer{};
278270 }
279271
280- ue_creation_complete_message ue_creation_complete_msg = du_processor_notifier.on_create_ue (ue_creation_msg);
272+ // Request the creation of a UE context in the CU-CP.
273+ const cu_cp_ue_creation_response cu_cp_resp = du_processor_notifier.on_ue_creation_request (ue_creation_msg);
281274
282275 // Remove the UE if the creation was not successful
283- if (ue_creation_complete_msg .ue_index == ue_index_t ::invalid) {
276+ if (cu_cp_resp .ue_index == ue_index_t ::invalid) {
284277 logger.warning (" du_ue_f1ap_id={}: Removing the UE. UE creation failed" , msg->gnb_du_ue_f1ap_id );
285- cu_cp_notifier.on_ue_removal_required (ue_index);
286278 return ;
287279 }
288280
289281 // Create UE context and store it
290- ue_ctxt_list.add_ue (ue_index, cu_ue_f1ap_id);
291- ue_ctxt_list.add_du_ue_f1ap_id (cu_ue_f1ap_id, int_to_gnb_du_ue_f1ap_id (msg-> gnb_du_ue_f1ap_id ) );
292- ue_ctxt_list.add_rrc_notifier (ue_creation_complete_msg .ue_index , ue_creation_complete_msg .f1ap_rrc_notifier );
282+ ue_ctxt_list.add_ue (cu_cp_resp. ue_index , cu_ue_f1ap_id);
283+ ue_ctxt_list.add_du_ue_f1ap_id (cu_ue_f1ap_id, du_ue_id );
284+ ue_ctxt_list.add_rrc_notifier (cu_cp_resp .ue_index , cu_cp_resp .f1ap_rrc_notifier );
293285 f1ap_ue_context& ue_ctxt = ue_ctxt_list[cu_ue_f1ap_id];
294286
295- ue_ctxt.logger .log_debug (" Added UE context" );
287+ ue_ctxt.logger .log_info (" Added UE context" );
296288
297289 // Forward RRC container
298290 if (msg->rrc_container_rrc_setup_complete_present ) {
@@ -302,7 +294,7 @@ void f1ap_cu_impl::handle_initial_ul_rrc_message(const init_ul_rrc_msg_transfer_
302294 return ;
303295 }
304296
305- // Pass container to RRC
297+ // Pass RRC container to RRC
306298 ue_ctxt_list[cu_ue_f1ap_id].rrc_notifier ->on_ul_ccch_pdu (msg->rrc_container .copy ());
307299}
308300
0 commit comments