Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4d15f57
Lockless changes for dedicated procedure
rsarwad Dec 12, 2019
4e9785f
Fixed clang errors
rsarwad Dec 12, 2019
8263135
Merge remote-tracking branch 'upstream/master' into rsarwad_merge_csfb
rsarwad Dec 17, 2019
3cf23ab
Merge remote-tracking branch 'upstream/master' into rsarwad_merge_csfb
rsarwad Dec 18, 2019
21572e1
Added lockless changes for CSFB related code of combined attach, TAU …
rsarwad Dec 18, 2019
172a90b
Resolved merge conflicts
rsarwad Dec 19, 2019
99f7aeb
Fixed clang errors
rsarwad Dec 19, 2019
fbb181a
Merge remote-tracking branch 'upstream/master' into rsarwad_merge_csfb
rsarwad Dec 19, 2019
2444cb2
Incorporated review comments
rsarwad Dec 19, 2019
d3393bc
Merge remote-tracking branch 'upstream/master' into rsarwad_merge_csfb
rsarwad Dec 20, 2019
74f0f50
Incorporated review comments
rsarwad Dec 20, 2019
14bb465
Merge remote-tracking branch 'upstream/master' into rsarwad_merge_csfb
rsarwad Dec 23, 2019
e7f0a7a
Merge remote-tracking branch 'upstream/master' into rsarwad_merge_csfb
rsarwad Dec 24, 2019
f1d00af
Merge remote-tracking branch 'upstream/master' into rsarwad_merge_csfb
rsarwad Dec 24, 2019
a77716b
Merge remote-tracking branch 'upstream/master' into rsarwad_merge_csfb
rsarwad Dec 26, 2019
55af133
Merge remote-tracking branch 'upstream/master' into rsarwad_merge_csfb
rsarwad Jan 1, 2020
b41cab7
Merge remote-tracking branch 'upstream/master' into rsarwad_merge_csfb
rsarwad Jan 2, 2020
0c37262
Merge remote-tracking branch 'upstream/master' into rsarwad_merge_csfb
rsarwad Jan 8, 2020
8b37b57
Merge remote-tracking branch 'upstream/master' into rsarwad_merge_csfb
rsarwad Jan 10, 2020
f87adfd
Merge remote-tracking branch 'upstream/master' into rsarwad_merge_csfb
rsarwad Jan 13, 2020
ec6d70a
Addressed review comments
rsarwad Jan 13, 2020
e15490c
Merge remote-tracking branch 'upstream/master' into rsarwad_merge_csfb
rsarwad Jan 14, 2020
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: 1 addition & 1 deletion lte/gateway/c/oai/include/mme_app_ue_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ typedef struct ue_mm_context_s {
bool location_info_confirmed_in_hss;
/* S6a- update location request guard timer */
struct mme_app_timer_t ulr_response_timer;
sgs_context_t *sgs_context;
sgs_context_t* sgs_context;
uint8_t attach_type;
lai_t lai;
int cs_fallback_indicator;
Expand Down
15 changes: 0 additions & 15 deletions lte/gateway/c/oai/include/nas_messages_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,6 @@ MESSAGE_DEF(
MESSAGE_PRIORITY_MED,
itti_nas_cs_service_notification_t,
nas_cs_service_notification)
MESSAGE_DEF(
NAS_CS_DOMAIN_LOCATION_UPDATE_REQ,
MESSAGE_PRIORITY_MED,
itti_nas_cs_domain_location_update_req_t,
nas_cs_domain_location_update_req)
MESSAGE_DEF(
NAS_CS_DOMAIN_LOCATION_UPDATE_ACC,
MESSAGE_PRIORITY_MED,
itti_nas_cs_domain_location_update_acc_t,
nas_cs_domain_location_update_acc)
MESSAGE_DEF(
NAS_CS_DOMAIN_LOCATION_UPDATE_FAIL,
MESSAGE_PRIORITY_MED,
itti_nas_cs_domain_location_update_fail_t,
nas_cs_domain_location_update_fail)
MESSAGE_DEF(
NAS_NOTIFY_SERVICE_REJECT,
MESSAGE_PRIORITY_MED,
Expand Down
38 changes: 0 additions & 38 deletions lte/gateway/c/oai/include/nas_messages_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@
#define NAS_AUTHENTICATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_auth_req
#define NAS_AUTHENTICATION_PARAM_REQ(mSGpTR) \
(mSGpTR)->ittiMsg.nas_auth_param_req
#define NAS_CS_DOMAIN_LOCATION_UPDATE_REQ(mSGpTR) \
(mSGpTR)->ittiMsg.nas_cs_domain_location_update_req
#define NAS_CS_DOMAIN_LOCATION_UPDATE_ACC(mSGpTR) \
(mSGpTR)->ittiMsg.nas_cs_domain_location_update_acc
#define NAS_CS_DOMAIN_LOCATION_UPDATE_FAIL(mSGpTR) \
(mSGpTR)->ittiMsg.nas_cs_domain_location_update_fail
#define NAS_CS_SERVICE_NOTIFICATION(mSGpTR) \
(mSGpTR)->ittiMsg.nas_cs_service_notification
#define NAS_DATA_LENGHT_MAX 256
Expand Down Expand Up @@ -125,38 +119,6 @@ typedef struct itti_nas_extended_service_req_s {
uint8_t csfb_response;
} itti_nas_extended_service_req_t;

typedef struct itti_nas_cs_domain_location_update_req_s {
/* UE identifier */
#define ATTACH_REQ (1 << 0)
#define TAU_REQUEST (1 << 1)
uint8_t msg_type;
mme_ue_s1ap_id_t ue_id;
uint8_t attach_type;
additional_updt_t add_updt_type;
uint8_t tau_updt_type; /*TAU Update type - Normal Update, Periodic,*/
} itti_nas_cs_domain_location_update_req_t;

typedef struct itti_nas_cs_domain_location_update_acc_s {
/* UE identifier */
#define MOBILE_IDENTITY (1 << 0)
#define ADD_UPDT_TYPE (1 << 1)
uint8_t presencemask;
mme_ue_s1ap_id_t ue_id;
lai_t laicsfb;
mobile_identity_t mobileid;
additional_updt_result_t add_updt_res;
bool is_sgs_assoc_exists;
} itti_nas_cs_domain_location_update_acc_t;

typedef struct itti_nas_cs_domain_location_update_fail_s {
/* UE identifier */
#define LAI (1 << 0)
uint8_t presencemask;
mme_ue_s1ap_id_t ue_id;
int reject_cause;
lai_t laicsfb;
} itti_nas_cs_domain_location_update_fail_t;

/* ITTI message used to intimate service reject for ongoing service request procedure
* from mme_app to nas
*/
Expand Down
10 changes: 0 additions & 10 deletions lte/gateway/c/oai/include/sgs_messages_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,6 @@
#define SGSAP_SERVICE_ABORT_REQ(mSGpTR) \
(mSGpTR)->ittiMsg.sgsap_service_abort_req

/* SGS Detach type */
typedef enum {
SGS_DETACH_TYPE_UE_INITIATED_EPS = 0,
SGS_DETACH_TYPE_UE_INITIATED_EXPLICIT_NONEPS,
SGS_DETACH_TYPE_UE_INITIATED_COMBINED,
SGS_DETACH_TYPE_NW_INITIATED_EPS,
SGS_DETACH_TYPE_NW_INITIATED_IMPLICIT_NONEPS,
SGS_DETACH_TYPE_MAX
} SgsDetachType_t;

typedef enum SgsCause_e {
SGS_CAUSE_NORMAL,
SGS_CAUSE_IMSI_DETACHED_FOR_EPS_SERVICE,
Expand Down
4 changes: 3 additions & 1 deletion lte/gateway/c/oai/tasks/mme_app/mme_app_bearer.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,9 @@ void mme_app_handle_delete_session_rsp(
SGS_COMBINED_UE_INITIATED_IMSI_DETACH_FROM_EPS_N_NONEPS)) &&
(ue_context_p->sgs_context->ts9_timer.id ==
MME_APP_TIMER_INACTIVE_ID)) {
// Notify S1AP to send UE Context Release Command to eNB or free s1 context locally.
/* Notify S1AP to send UE Context Release Command to eNB or free
* s1 context locally.
*/
mme_app_itti_ue_context_release(
ue_context_p, ue_context_p->ue_context_rel_cause);
ue_context_p->ue_context_rel_cause = S1AP_INVALID_CAUSE;
Expand Down
34 changes: 27 additions & 7 deletions lte/gateway/c/oai/tasks/mme_app/mme_app_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ int mme_app_handle_nw_initiated_detach_request(
uint8_t detach_type);

int mme_app_handle_nas_cs_domain_location_update_req(
mme_app_desc_t *mme_app_desc_p,
itti_nas_cs_domain_location_update_req_t *const itti_nas_location_update_req);
ue_mm_context_t* ue_context_p,
uint8_t msg_type);

int mme_app_handle_sgsap_location_update_acc(mme_app_desc_t *mme_app_desc_p,
itti_sgsap_location_update_acc_t *const itti_sgsap_location_update_acc);
Expand All @@ -222,10 +222,6 @@ int send_itti_sgsap_location_update_req(ue_mm_context_t *ue_context);
int mme_app_handle_sgsap_location_update_rej(mme_app_desc_t *mme_app_desc_p,
itti_sgsap_location_update_rej_t *const itti_sgsap_location_update_rej);

int send_cs_domain_loc_updt_fail_to_nas(
SgsRejectCause_t cause,
lai_t *lai,
mme_ue_s1ap_id_t mme_ue_s1ap_id);
void mme_app_handle_ts6_1_timer_expiry(struct ue_mm_context_s *ue_context_p);

int mme_app_handle_sgsap_reset_indication(mme_app_desc_t *mme_app_desc_p,
Expand Down Expand Up @@ -305,23 +301,47 @@ void mme_app_handle_path_switch_req_ack(
void mme_app_handle_path_switch_req_failure(
struct ue_mm_context_s *ue_context_p);

void mme_app_send_itti_sgsap_ue_activity_ind(
const char* imsi,
const unsigned int imsi_len);

int emm_send_cs_domain_attach_or_tau_accept(
struct ue_mm_context_s* ue_context_p);

void mme_app_update_paging_tai_list(
paging_tai_list_t* p_tai_list,
partial_tai_list_t* tai_list,
uint8_t num_of_tac);

void send_delete_dedicated_bearer_rsp(
struct ue_mm_context_s *ue_context_p,
struct ue_mm_context_s* ue_context_p,
bool delete_default_bearer,
ebi_t ebi[],
uint32_t num_bearer_context,
teid_t s_gw_teid_s11_s4,
gtpv2c_cause_value_t cause);

int mme_app_create_sgs_context(ue_mm_context_t* ue_context_p);

int map_sgs_emm_cause(SgsRejectCause_t sgs_cause);

#define ATTACH_REQ (1 << 0)
#define TAU_REQUEST (1 << 1)
#define INTIAL_CONTEXT_SETUP_PROCEDURE_FAILED 0x00
#define UE_CONTEXT_MODIFICATION_PROCEDURE_FAILED 0x01
#define MME_APP_PAGING_ID_IMSI 0X00
#define MME_APP_PAGING_ID_TMSI 0X01

#define mme_stats_read_lock(mMEsTATS) \
pthread_rwlock_rdlock(&(mMEsTATS)->rw_lock)
#define mme_stats_write_lock(mMEsTATS) \
pthread_rwlock_wrlock(&(mMEsTATS)->rw_lock)
#define mme_stats_unlock(mMEsTATS) pthread_rwlock_unlock(&(mMEsTATS)->rw_lock)

#define MME_APP_COMPARE_TMSI(_tmsi1, _tmsi2) \
( \
(_tmsi1.tmsi[0] != _tmsi2.tmsi[0]) || (_tmsi1.tmsi[1] != _tmsi2.tmsi[1]) ||\
(_tmsi1.tmsi[2] != _tmsi2.tmsi[2]) || (_tmsi1.tmsi[3] != _tmsi2.tmsi[3])) \
? (RETURNerror) : (RETURNok)

#endif /* MME_APP_DEFS_H_ */
8 changes: 0 additions & 8 deletions lte/gateway/c/oai/tasks/mme_app/mme_app_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,14 +376,6 @@ void *mme_app_thread(void *args)
&received_message_p->ittiMsg.s6a_purge_ue_ans);
} break;

case NAS_CS_DOMAIN_LOCATION_UPDATE_REQ: {
/*Received SGS Location Update Request message from NAS task*/
OAILOG_INFO(
TASK_MME_APP, "Received CS DOMAIN LOCATION UPDATE REQ from NAS\n");
mme_app_handle_nas_cs_domain_location_update_req(mme_app_desc_p,
&received_message_p->ittiMsg.nas_cs_domain_location_update_req);
} break;

case SGSAP_LOCATION_UPDATE_ACC: {
/*Received SGSAP Location Update Accept message from SGS task*/
OAILOG_INFO(
Expand Down
65 changes: 21 additions & 44 deletions lte/gateway/c/oai/tasks/mme_app/mme_app_sgs_alert.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@
#include "sgs_messages_types.h"

static int _mme_app_send_sgsap_alert_reject(
itti_sgsap_alert_request_t *const sgsap_alert_req_pP,
itti_sgsap_alert_request_t* const sgsap_alert_req_pP,
SgsCause_t sgs_cause,
uint64_t imsi64);

static int _mme_app_send_sgsap_alert_ack(
itti_sgsap_alert_request_t *const sgsap_alert_req_pP,
itti_sgsap_alert_request_t* const sgsap_alert_req_pP,
uint64_t imsi64);

/****************************************************************************
Expand All @@ -83,11 +83,12 @@ static int _mme_app_send_sgsap_alert_ack(
** **
***************************************************************************/

int mme_app_handle_sgsap_alert_request(mme_app_desc_t *mme_app_desc_p,
itti_sgsap_alert_request_t *const sgsap_alert_req_pP)
int mme_app_handle_sgsap_alert_request(
mme_app_desc_t* mme_app_desc_p,
itti_sgsap_alert_request_t* const sgsap_alert_req_pP)
{
uint64_t imsi64 = 0;
struct ue_mm_context_s *ue_context_p = NULL;
struct ue_mm_context_s* ue_context_p = NULL;

OAILOG_FUNC_IN(LOG_MME_APP);
DevAssert(sgsap_alert_req_pP);
Expand Down Expand Up @@ -124,39 +125,15 @@ int mme_app_handle_sgsap_alert_request(mme_app_desc_t *mme_app_desc_p,
OAILOG_FUNC_RETURN(LOG_MME_APP, RETURNerror);
}
if (ue_context_p->sgs_context == NULL) {
OAILOG_INFO(
LOG_MME_APP,
"SGS context not created for IMSI and creating sgs context"
"on reception of Alert Request over SGS" IMSI_64_FMT "\n",
imsi64);
//Create SGS context
ue_context_p->sgs_context = calloc(1, sizeof(sgs_context_t));
if (ue_context_p->sgs_context == NULL) {
OAILOG_ERROR(
if ((mme_app_create_sgs_context(ue_context_p)) != RETURNok) {
OAILOG_CRITICAL(
LOG_MME_APP,
"Cannot create SGS Context for UE ID %d ",
"Failed to create SGS context for ue_id " MME_UE_S1AP_ID_FMT "\n",
ue_context_p->mme_ue_s1ap_id);
unlock_ue_contexts(ue_context_p);
OAILOG_FUNC_RETURN(LOG_MME_APP, RETURNerror);
}
/*Initialize SGS context to default values*/
ue_context_p->sgs_context->sgs_state = SGS_NULL;
ue_context_p->sgs_context->vlr_reliable = false;
ue_context_p->sgs_context->ts6_1_timer.id = MME_APP_TIMER_INACTIVE_ID;
ue_context_p->sgs_context->ts6_1_timer.sec =
mme_config.sgs_config.ts6_1_sec;
ue_context_p->sgs_context->ts8_timer.id = MME_APP_TIMER_INACTIVE_ID;
ue_context_p->sgs_context->ts8_timer.sec = mme_config.sgs_config.ts8_sec;
ue_context_p->sgs_context->ts9_timer.id = MME_APP_TIMER_INACTIVE_ID;
ue_context_p->sgs_context->ts9_timer.sec = mme_config.sgs_config.ts9_sec;
ue_context_p->sgs_context->ts10_timer.id = MME_APP_TIMER_INACTIVE_ID;
ue_context_p->sgs_context->ts10_timer.sec = mme_config.sgs_config.ts10_sec;
ue_context_p->sgs_context->ts13_timer.id = MME_APP_TIMER_INACTIVE_ID;
ue_context_p->sgs_context->ts13_timer.sec = mme_config.sgs_config.ts13_sec;
}

ue_context_p->sgs_context->neaf = SET_NEAF;

/* send Alert Ack */
_mme_app_send_sgsap_alert_ack(sgsap_alert_req_pP, imsi64);
unlock_ue_contexts(ue_context_p);
Expand All @@ -176,23 +153,23 @@ int mme_app_handle_sgsap_alert_request(mme_app_desc_t *mme_app_desc_p,
**
***********************************************************************************/
static int _mme_app_send_sgsap_alert_reject(
itti_sgsap_alert_request_t *const sgsap_alert_req_pP,
itti_sgsap_alert_request_t* const sgsap_alert_req_pP,
SgsCause_t sgs_cause,
uint64_t imsi64)
{
int rc = RETURNerror;
MessageDef *message_p = NULL;
itti_sgsap_alert_reject_t *sgsap_alert_reject_pP = NULL;
MessageDef* message_p = NULL;
itti_sgsap_alert_reject_t* sgsap_alert_reject_pP = NULL;
OAILOG_FUNC_IN(LOG_MME_APP);

message_p = itti_alloc_new_message(TASK_MME_APP, SGSAP_ALERT_REJECT);
AssertFatal(message_p, "itti_alloc_new_message Failed");
sgsap_alert_reject_pP = &message_p->ittiMsg.sgsap_alert_reject;
memset((void *) sgsap_alert_reject_pP, 0, sizeof(itti_sgsap_alert_reject_t));
memset((void*) sgsap_alert_reject_pP, 0, sizeof(itti_sgsap_alert_reject_t));

memcpy(
(void *) sgsap_alert_reject_pP->imsi,
(const void *) sgsap_alert_req_pP->imsi,
(void*) sgsap_alert_reject_pP->imsi,
(const void*) sgsap_alert_req_pP->imsi,
sgsap_alert_req_pP->imsi_length);
sgsap_alert_reject_pP->imsi_length = sgsap_alert_req_pP->imsi_length;
sgsap_alert_reject_pP->sgs_cause = sgs_cause;
Expand All @@ -218,22 +195,22 @@ static int _mme_app_send_sgsap_alert_reject(
**
***********************************************************************************/
static int _mme_app_send_sgsap_alert_ack(
itti_sgsap_alert_request_t *const sgsap_alert_req_pP,
itti_sgsap_alert_request_t* const sgsap_alert_req_pP,
uint64_t imsi64)
{
int rc = RETURNerror;
MessageDef *message_p = NULL;
itti_sgsap_alert_ack_t *sgsap_alert_ack_pP = NULL;
MessageDef* message_p = NULL;
itti_sgsap_alert_ack_t* sgsap_alert_ack_pP = NULL;
OAILOG_FUNC_IN(LOG_MME_APP);

message_p = itti_alloc_new_message(TASK_MME_APP, SGSAP_ALERT_ACK);
AssertFatal(message_p, "itti_alloc_new_message Failed");
sgsap_alert_ack_pP = &message_p->ittiMsg.sgsap_alert_ack;
memset((void *) sgsap_alert_ack_pP, 0, sizeof(itti_sgsap_alert_ack_t));
memset((void*) sgsap_alert_ack_pP, 0, sizeof(itti_sgsap_alert_ack_t));

memcpy(
(void *) sgsap_alert_ack_pP->imsi,
(const void *) sgsap_alert_req_pP->imsi,
(void*) sgsap_alert_ack_pP->imsi,
(const void*) sgsap_alert_req_pP->imsi,
sgsap_alert_req_pP->imsi_length);
sgsap_alert_ack_pP->imsi_length = sgsap_alert_req_pP->imsi_length;

Expand Down
Loading