diff --git a/openair3/NAS/UE/EMM/Attach.c b/openair3/NAS/UE/EMM/Attach.c index d765ff0fa73ce799e6420a83e5fb23d1fa0fe908..c0c82b9b4ccf258567f414882fa368e513b1bcb9 100644 --- a/openair3/NAS/UE/EMM/Attach.c +++ b/openair3/NAS/UE/EMM/Attach.c @@ -240,7 +240,7 @@ int emm_proc_attach(nas_user_t *user, emm_proc_attach_type_t type) if (rc != RETURNerror) { /* Setup EMM procedure handler to be executed upon receiving * lower layer notification */ - rc = emm_proc_lowerlayer_initialize(emm_proc_attach_request, + rc = emm_proc_lowerlayer_initialize(user->lowerlayer_data, emm_proc_attach_request, emm_proc_attach_failure, emm_proc_attach_release, user); @@ -423,7 +423,7 @@ int emm_proc_attach_accept(nas_user_t *user, long t3412, long t3402, long t3423, if ( (rc != RETURNerror) && (esm_sap.err == ESM_SAP_SUCCESS) ) { /* Setup EMM procedure handler to be executed upon receiving * lower layer notification */ - rc = emm_proc_lowerlayer_initialize(emm_proc_attach_complete, + rc = emm_proc_lowerlayer_initialize(user->lowerlayer_data, emm_proc_attach_complete, emm_proc_attach_failure, NULL, user); @@ -721,7 +721,7 @@ int emm_proc_attach_complete(void *args) LOG_TRACE(INFO, "EMM-PROC - EPS attach complete"); /* Reset EMM procedure handler */ - (void) emm_proc_lowerlayer_initialize(NULL, NULL, NULL, NULL); + emm_proc_lowerlayer_initialize(user->lowerlayer_data, NULL, NULL, NULL, NULL); /* Reset the attach attempt counter */ emm_attach_data->attempt_count = 0; @@ -787,7 +787,7 @@ int emm_proc_attach_failure(int is_initial, void *args) LOG_TRACE(WARNING, "EMM-PROC - EPS attach failure"); /* Reset EMM procedure handler */ - (void) emm_proc_lowerlayer_initialize(NULL, NULL, NULL, NULL); + emm_proc_lowerlayer_initialize(user->lowerlayer_data, NULL, NULL, NULL, NULL); /* Stop timer T3410 if still running */ if (emm_timers->T3410.id != NAS_TIMER_INACTIVE_ID) { diff --git a/openair3/NAS/UE/EMM/Authentication.c b/openair3/NAS/UE/EMM/Authentication.c index 56ec2bd833805ca6cf26f3d95d4964b00b5102c4..e49bdd2db7e5e36aa52835dd58b8f477bd3317a9 100644 --- a/openair3/NAS/UE/EMM/Authentication.c +++ b/openair3/NAS/UE/EMM/Authentication.c @@ -289,7 +289,7 @@ int emm_proc_authentication_request(nas_user_t *user, int native_ksi, int ksi, /* Setup EMM procedure handler to be executed upon receiving * lower layer notification */ - rc = emm_proc_lowerlayer_initialize(NULL, NULL, NULL, NULL); + rc = emm_proc_lowerlayer_initialize(user->lowerlayer_data, NULL, NULL, NULL, NULL); if (rc != RETURNok) { LOG_TRACE(WARNING, diff --git a/openair3/NAS/UE/EMM/Detach.c b/openair3/NAS/UE/EMM/Detach.c index e59d8b7d949dfbdeacee44da8a6d8d65592f205a..fd2db1b6174ae7a9624f875531eaf8b68a2d07b4 100644 --- a/openair3/NAS/UE/EMM/Detach.c +++ b/openair3/NAS/UE/EMM/Detach.c @@ -132,7 +132,7 @@ int emm_proc_detach(nas_user_t *user, emm_proc_detach_type_t type, int switch_of /* Setup EMM procedure handler to be executed upon receiving * lower layer notification */ - rc = emm_proc_lowerlayer_initialize(emm_proc_detach_request, + rc = emm_proc_lowerlayer_initialize(user->lowerlayer_data, emm_proc_detach_request, emm_proc_detach_failure, emm_proc_detach_release, user); @@ -240,7 +240,7 @@ int emm_proc_detach_accept(void* args) LOG_TRACE(INFO, "EMM-PROC - UE initiated detach procedure completion"); /* Reset EMM procedure handler */ - (void) emm_proc_lowerlayer_initialize(NULL, NULL, NULL, NULL); + (void) emm_proc_lowerlayer_initialize(user->lowerlayer_data, NULL, NULL, NULL, NULL); /* Stop timer T3421 */ emm_timers->T3421.id = nas_timer_stop(emm_timers->T3421.id); @@ -292,7 +292,7 @@ int emm_proc_detach_failure(int is_initial, void *args) LOG_TRACE(WARNING, "EMM-PROC - Network detach failure"); /* Reset EMM procedure handler */ - (void) emm_proc_lowerlayer_initialize(NULL, NULL, NULL, NULL); + (void) emm_proc_lowerlayer_initialize(user->lowerlayer_data, NULL, NULL, NULL, NULL); /* Stop timer T3421 */ emm_timers->T3421.id = nas_timer_stop(emm_timers->T3421.id); @@ -458,7 +458,7 @@ static int _emm_detach_abort(nas_user_t *user, emm_proc_detach_type_t type) LOG_TRACE(WARNING, "EMM-PROC - Abort the detach procedure"); /* Reset EMM procedure handler */ - (void) emm_proc_lowerlayer_initialize(NULL, NULL, NULL, NULL); + emm_proc_lowerlayer_initialize(user->lowerlayer_data, NULL, NULL, NULL, NULL); /* Stop timer T3421 */ emm_timers->T3421.id = nas_timer_stop(emm_timers->T3421.id); diff --git a/openair3/NAS/UE/EMM/Identification.c b/openair3/NAS/UE/EMM/Identification.c index e894e9e045c286d15b4a23af92a1515626bf385a..7cf2e765c61322a185618566632227270f083e6f 100644 --- a/openair3/NAS/UE/EMM/Identification.c +++ b/openair3/NAS/UE/EMM/Identification.c @@ -115,7 +115,7 @@ int emm_proc_identification_request(nas_user_t *user, emm_proc_identity_type_t t /* Setup EMM procedure handler to be executed upon receiving * lower layer notification */ - rc = emm_proc_lowerlayer_initialize(NULL, NULL, NULL, NULL); + rc = emm_proc_lowerlayer_initialize(user->lowerlayer_data, NULL, NULL, NULL, NULL); if (rc != RETURNok) { LOG_TRACE(WARNING, diff --git a/openair3/NAS/UE/EMM/LowerLayer.h b/openair3/NAS/UE/EMM/LowerLayer.h index 1e56316c697832f3a7b31925c71125ca04bf2d31..00e271feaa7e9c0dd3e3426401b6dd75c589f5e7 100644 --- a/openair3/NAS/UE/EMM/LowerLayer.h +++ b/openair3/NAS/UE/EMM/LowerLayer.h @@ -62,6 +62,20 @@ Description Defines EMM procedures executed by the Non-Access Stratum /****************** E X P O R T E D F U N C T I O N S ******************/ /****************************************************************************/ +/* + *--------------------------------------------------------------------------- + * Lower layer procedure + *--------------------------------------------------------------------------- + */ +int emm_proc_lowerlayer_initialize(lowerlayer_data_t *lowerlayer_data, lowerlayer_success_callback_t success, + lowerlayer_failure_callback_t failure, + lowerlayer_release_callback_t release, + void *args); +int emm_proc_lowerlayer_success(lowerlayer_data_t *lowerlayer_data); +int emm_proc_lowerlayer_failure(lowerlayer_data_t *lowerlayer_data, int is_initial); +int emm_proc_lowerlayer_release(lowerlayer_data_t *lowerlayer_data); + + int lowerlayer_success(nas_user_t *user); int lowerlayer_failure(nas_user_t *user); int lowerlayer_establish(nas_user_t *user); diff --git a/openair3/NAS/UE/EMM/SAP/EmmDeregisteredAttemptingToAttach.c b/openair3/NAS/UE/EMM/SAP/EmmDeregisteredAttemptingToAttach.c index 3415eee99fe4f5462d999ae5a17c623afb8a91d7..7ddfac03db225bfc34cb83c093dcff0f121f911d 100644 --- a/openair3/NAS/UE/EMM/SAP/EmmDeregisteredAttemptingToAttach.c +++ b/openair3/NAS/UE/EMM/SAP/EmmDeregisteredAttemptingToAttach.c @@ -113,14 +113,14 @@ int EmmDeregisteredAttemptingToAttach(nas_user_t *user, const emm_reg_t *evt) /* * Data successfully delivered to the network */ - rc = emm_proc_lowerlayer_success(); + rc = emm_proc_lowerlayer_success(user->lowerlayer_data); break; case _EMMREG_LOWERLAYER_FAILURE: /* * Data failed to be delivered to the network */ - rc = emm_proc_lowerlayer_failure(FALSE); + rc = emm_proc_lowerlayer_failure(user->lowerlayer_data, FALSE); break; default: diff --git a/openair3/NAS/UE/EMM/SAP/EmmDeregisteredInitiated.c b/openair3/NAS/UE/EMM/SAP/EmmDeregisteredInitiated.c index 6706d144b6b3f589929bb25d475afe3b68be2e2f..d18b66a3162bc876043d649d78804973400aab6b 100644 --- a/openair3/NAS/UE/EMM/SAP/EmmDeregisteredInitiated.c +++ b/openair3/NAS/UE/EMM/SAP/EmmDeregisteredInitiated.c @@ -124,7 +124,7 @@ int EmmDeregisteredInitiated(nas_user_t *user, const emm_reg_t *evt) * before the Detach Accept is received */ // FIXME review - rc = emm_proc_lowerlayer_release(); + rc = emm_proc_lowerlayer_release(user->lowerlayer_data); break; default: diff --git a/openair3/NAS/UE/EMM/SAP/EmmDeregisteredLimitedService.c b/openair3/NAS/UE/EMM/SAP/EmmDeregisteredLimitedService.c index 04c60aef014a6a4b8d54088e3877dbc69f7b7c2c..394325441597f64991cedf81764e4408caaae0c9 100644 --- a/openair3/NAS/UE/EMM/SAP/EmmDeregisteredLimitedService.c +++ b/openair3/NAS/UE/EMM/SAP/EmmDeregisteredLimitedService.c @@ -126,21 +126,21 @@ int EmmDeregisteredLimitedService(nas_user_t *user, const emm_reg_t *evt) * Initial NAS message has been successfully delivered * to the network */ - rc = emm_proc_lowerlayer_success(); + rc = emm_proc_lowerlayer_success(user->lowerlayer_data); break; case _EMMREG_LOWERLAYER_FAILURE: /* * Initial NAS message failed to be delivered to the network */ - rc = emm_proc_lowerlayer_failure(TRUE); + rc = emm_proc_lowerlayer_failure(user->lowerlayer_data, TRUE); break; case _EMMREG_LOWERLAYER_RELEASE: /* * NAS signalling connection has been released */ - rc = emm_proc_lowerlayer_release(); + rc = emm_proc_lowerlayer_release(user->lowerlayer_data); break; default: diff --git a/openair3/NAS/UE/EMM/SAP/EmmDeregisteredNormalService.c b/openair3/NAS/UE/EMM/SAP/EmmDeregisteredNormalService.c index fd31eaf6dc4e8674839c47ea103dac2a9d036c6b..3ec7a96ba8ab416ff73ba3f2ac2bfa332a369a70 100644 --- a/openair3/NAS/UE/EMM/SAP/EmmDeregisteredNormalService.c +++ b/openair3/NAS/UE/EMM/SAP/EmmDeregisteredNormalService.c @@ -134,21 +134,21 @@ int EmmDeregisteredNormalService(nas_user_t *user, const emm_reg_t *evt) * Initial NAS message has been successfully delivered * to the network */ - rc = emm_proc_lowerlayer_success(); + rc = emm_proc_lowerlayer_success(user->lowerlayer_data); break; case _EMMREG_LOWERLAYER_FAILURE: /* * Initial NAS message failed to be delivered to the network */ - rc = emm_proc_lowerlayer_failure(TRUE); + rc = emm_proc_lowerlayer_failure(user->lowerlayer_data, TRUE); break; case _EMMREG_LOWERLAYER_RELEASE: /* * NAS signalling connection has been released */ - rc = emm_proc_lowerlayer_release(); + rc = emm_proc_lowerlayer_release(user->lowerlayer_data); break; case _EMMREG_ATTACH_CNF: diff --git a/openair3/NAS/UE/EMM/SAP/EmmRegistered.c b/openair3/NAS/UE/EMM/SAP/EmmRegistered.c index cb1db339859d61eca106010a3671c8accaaaab89..dbc51e51554382af949dee6bd1c6116e334d5186 100644 --- a/openair3/NAS/UE/EMM/SAP/EmmRegistered.c +++ b/openair3/NAS/UE/EMM/SAP/EmmRegistered.c @@ -136,21 +136,21 @@ int EmmRegistered(nas_user_t *user, const emm_reg_t *evt) /* * Data transfer message has been successfully delivered */ - rc = emm_proc_lowerlayer_success(); + rc = emm_proc_lowerlayer_success(user->lowerlayer_data); break; case _EMMREG_LOWERLAYER_FAILURE: /* * Data transfer message failed to be delivered */ - rc = emm_proc_lowerlayer_failure(FALSE); + rc = emm_proc_lowerlayer_failure(user->lowerlayer_data, FALSE); break; case _EMMREG_LOWERLAYER_RELEASE: /* * NAS signalling connection has been released */ - rc = emm_proc_lowerlayer_release(); + rc = emm_proc_lowerlayer_release(user->lowerlayer_data); break; default: diff --git a/openair3/NAS/UE/EMM/SAP/EmmRegisteredInitiated.c b/openair3/NAS/UE/EMM/SAP/EmmRegisteredInitiated.c index c0d5f50ebcd509cc7c6ba1b5c8be25d4a56d5981..d10f0d1053c0c939408600b85fc8c5a2424ce0dc 100644 --- a/openair3/NAS/UE/EMM/SAP/EmmRegisteredInitiated.c +++ b/openair3/NAS/UE/EMM/SAP/EmmRegisteredInitiated.c @@ -230,7 +230,7 @@ int EmmRegisteredInitiated(nas_user_t *user, const emm_reg_t *evt) * any message transfered by EMM common procedures requested * by the network. */ - rc = emm_proc_lowerlayer_success(); + rc = emm_proc_lowerlayer_success(user->lowerlayer_data); break; case _EMMREG_LOWERLAYER_FAILURE: @@ -240,7 +240,7 @@ int EmmRegisteredInitiated(nas_user_t *user, const emm_reg_t *evt) * any message transfered by EMM common procedures requested * by the network. */ - rc = emm_proc_lowerlayer_failure(FALSE); + rc = emm_proc_lowerlayer_failure(user->lowerlayer_data, FALSE); break; case _EMMREG_LOWERLAYER_RELEASE: @@ -249,7 +249,7 @@ int EmmRegisteredInitiated(nas_user_t *user, const emm_reg_t *evt) * Accept, Attach Reject, or any message transfered by EMM common * procedures requested by the network, is received. */ - rc = emm_proc_lowerlayer_release(); + rc = emm_proc_lowerlayer_release(user->lowerlayer_data); break; default: diff --git a/openair3/NAS/UE/EMM/SecurityModeControl.c b/openair3/NAS/UE/EMM/SecurityModeControl.c index 43a5db1ff4195d2f41a8ffb93638c5d13905af25..46d2a4fc2e15bd24c6348224ab616291ef9d8907 100644 --- a/openair3/NAS/UE/EMM/SecurityModeControl.c +++ b/openair3/NAS/UE/EMM/SecurityModeControl.c @@ -308,7 +308,7 @@ int emm_proc_security_mode_command(nas_user_t *user, int native_ksi, int ksi, /* Setup EMM procedure handler to be executed upon receiving * lower layer notification */ - rc = emm_proc_lowerlayer_initialize(NULL, NULL, NULL, NULL); + rc = emm_proc_lowerlayer_initialize(user->lowerlayer_data, NULL, NULL, NULL, NULL); if (rc != RETURNok) { LOG_TRACE(WARNING, diff --git a/openair3/NAS/UE/EMM/emm_proc.h b/openair3/NAS/UE/EMM/emm_proc.h index a6a32448a40d4f1bd053f4d1d65b89451e62c4c2..45052573352c3402fb8f2dcb2e0e9a162f75fa6b 100644 --- a/openair3/NAS/UE/EMM/emm_proc.h +++ b/openair3/NAS/UE/EMM/emm_proc.h @@ -68,19 +68,6 @@ Description Defines the EPS Mobility Management procedures executed at int emm_proc_status_ind(unsigned int ueid, int emm_cause); int emm_proc_status(nas_user_t *user, int emm_cause); -/* - *--------------------------------------------------------------------------- - * Lower layer procedure - *--------------------------------------------------------------------------- - */ -int emm_proc_lowerlayer_initialize(lowerlayer_success_callback_t success, - lowerlayer_failure_callback_t failure, - lowerlayer_release_callback_t release, - void *args); -int emm_proc_lowerlayer_success(void); -int emm_proc_lowerlayer_failure(int is_initial); -int emm_proc_lowerlayer_release(void); - /* *--------------------------------------------------------------------------- * UE's Idle mode procedure