Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lte/gateway/c/oai/tasks/nas/emm/Authentication.c
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,8 @@ static void _authentication_t3460_handler(void* args) {
emm_sap_send(&emm_sap);
emm_common_cleanup_by_ueid(ue_id);

emm_ctx_clear_nas_procedures_timer_mask(
emm_ctx, NAS_AUTH_PROCEDUE_3460_TIMER);
// abort ANY ongoing EMM procedure (R10_5_4_2_7_b)
nas_delete_all_emm_procedures(emm_ctx);

Expand Down
2 changes: 2 additions & 0 deletions lte/gateway/c/oai/tasks/nas/emm/SecurityModeControl.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,8 @@ static int _security_request(nas_emm_smc_proc_t* const smc_proc) {
nas_start_T3460(
smc_proc->ue_id, &smc_proc->T3460,
smc_proc->emm_com_proc.emm_proc.base_proc.time_out, emm_ctx);
emm_ctx_set_nas_procedures_timer_mask(
emm_ctx, NAS_SMC_PROCEDUE_3460_TIMER);
}
}
OAILOG_FUNC_RETURN(LOG_NAS_EMM, rc);
Expand Down
14 changes: 13 additions & 1 deletion lte/gateway/c/oai/tasks/nas/emm/emm_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,13 @@ typedef struct emm_context_s {
*if this flag is set after receving service req, send detach
*/
bool nw_init_bearer_deactv;
#define NAS_PROC_AUTHENTICATION 0x01
#define NAS_PROC_SECURITY_MODE 0x02
#define NAS_AUTH_PROCEDUE_3460_TIMER ((uint32_t) 1 << 0)
#define NAS_SMC_PROCEDUE_3460_TIMER ((uint32_t) 1 << 1)
#define IS_NAS_AUTH_PROCEDUE_3460_TIMER_RUNNING \
(nas_procedures_timer_mask & NAS_AUTH_PROCEDUE_3460_TIMER)
uint32_t nas_procedures_timer_mask;
} emm_context_t;

/*
Expand Down Expand Up @@ -552,7 +559,12 @@ void emm_context_free_content_except_key_fields(
void emm_context_dump(
const struct emm_context_s* const elm_pP, const uint8_t indent_spaces,
bstring bstr_dump) __attribute__((nonnull));

void emm_ctx_set_nas_procedures_timer_mask(
emm_context_t* const ctxt, const int nas_proc_bit_pos)
__attribute__((nonnull)) __attribute__((flatten));
void emm_ctx_clear_nas_procedures_timer_mask(
emm_context_t* const ctxt, const int nas_proc_bit_pos)
__attribute__((nonnull)) __attribute__((flatten));
/****************************************************************************/
/******************** G L O B A L V A R I A B L E S ********************/
/****************************************************************************/
Expand Down
34 changes: 28 additions & 6 deletions lte/gateway/c/oai/tasks/nas/emm/emm_data_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,18 +945,25 @@ void nas_start_T3450(
//------------------------------------------------------------------------------
void nas_start_T3460(
const mme_ue_s1ap_id_t ue_id, struct nas_timer_s* const T3460,
time_out_t time_out_cb, void* timer_callback_args) {
time_out_t time_out_cb, void* timer_callback_args, uint8_t nas_proc) {
if ((T3460) && (T3460->id == NAS_TIMER_INACTIVE_ID)) {
T3460->id =
nas_timer_start(T3460->sec, 0, time_out_cb, timer_callback_args);
if (NAS_TIMER_INACTIVE_ID != T3460->id) {
if (nas_proc == NAS_PROC_AUTHENTICATION) {
emm_ctx_set_nas_procedures_timer_mask(
(emm_context_t*) timer_callback_args, NAS_AUTH_PROCEDUE_3460_TIMER);
} else {
emm_ctx_set_nas_procedures_timer_mask(
(emm_context_t*) timer_callback_args, NAS_SMC_PROCEDUE_3460_TIMER);
}
OAILOG_DEBUG(
LOG_NAS_EMM, "T3460 started UE " MME_UE_S1AP_ID_FMT "\n", ue_id);
} else {
OAILOG_ERROR(
LOG_NAS_EMM, "Could not start T3460 UE " MME_UE_S1AP_ID_FMT " ",
ue_id);
}
} else {
OAILOG_ERROR(
LOG_NAS_EMM, "Could not start T3460 UE " MME_UE_S1AP_ID_FMT " ",
ue_id);
}
}
}
//------------------------------------------------------------------------------
Expand Down Expand Up @@ -1011,6 +1018,11 @@ void nas_stop_T3460(
void* timer_callback_args) {
if ((T3460) && (T3460->id != NAS_TIMER_INACTIVE_ID)) {
T3460->id = nas_timer_stop(T3460->id, &timer_callback_args);
emm_context_t* emm_context_p = emm_context_get(&_emm_data, ue_id);
if (emm_context_p) {
emm_ctx_clear_nas_procedures_timer_mask(
emm_context_p, NAS_AUTH_PROCEDUE_3460_TIMER);
}
OAILOG_DEBUG(
LOG_NAS_EMM, "T3460 stopped UE " MME_UE_S1AP_ID_FMT "\n", ue_id);
}
Expand Down Expand Up @@ -1544,3 +1556,13 @@ void emm_context_dump(
// esm_context_dump(&emm_context->esm_ctx, indent_spaces, bstr_dump);
// }
}

inline void emm_ctx_set_nas_procedures_timer_mask(
emm_context_t* const ctxt, const int nas_proc_bit_pos) {
ctxt->nas_procedures_timer_mask |= nas_proc_bit_pos;
}

inline void emm_ctx_clear_nas_procedures_timer_mask(
emm_context_t* const ctxt, const int nas_proc_bit_pos) {
ctxt->nas_procedures_timer_mask &= ~nas_proc_bit_pos;
}
1 change: 1 addition & 0 deletions lte/protos/oai/nas_state.proto
Original file line number Diff line number Diff line change
Expand Up @@ -416,5 +416,6 @@ message EmmContext {
uint32 ksi = 64;

UeNetworkCapability ue_network_capability = 65;
uint32 nas_procedures_timer_mask = 66;
// TODO: add remaining emm_context elements
}