Commit 101d1ae7 authored by Frédéric Leroy's avatar Frédéric Leroy

UE/EMM/LowerLayer: move ueid to nas_user_t

parent f05bd7de
...@@ -88,7 +88,6 @@ static struct { ...@@ -88,7 +88,6 @@ static struct {
** Description: Notify the EPS Mobility Management entity that data have ** ** Description: Notify the EPS Mobility Management entity that data have **
** been successfully delivered to the network ** ** been successfully delivered to the network **
** ** ** **
** Inputs: ueid: UE lower layer identifier **
** Others: None ** ** Others: None **
** ** ** **
** Outputs: None ** ** Outputs: None **
...@@ -96,7 +95,7 @@ static struct { ...@@ -96,7 +95,7 @@ static struct {
** Others: None ** ** Others: None **
** ** ** **
***************************************************************************/ ***************************************************************************/
int lowerlayer_success(nas_user_t *user, unsigned int ueid) int lowerlayer_success(nas_user_t *user)
{ {
LOG_FUNC_IN; LOG_FUNC_IN;
...@@ -104,7 +103,7 @@ int lowerlayer_success(nas_user_t *user, unsigned int ueid) ...@@ -104,7 +103,7 @@ int lowerlayer_success(nas_user_t *user, unsigned int ueid)
int rc; int rc;
emm_sap.primitive = EMMREG_LOWERLAYER_SUCCESS; emm_sap.primitive = EMMREG_LOWERLAYER_SUCCESS;
emm_sap.u.emm_reg.ueid = ueid; emm_sap.u.emm_reg.ueid = user->ueid;
rc = emm_sap_send(user, &emm_sap); rc = emm_sap_send(user, &emm_sap);
LOG_FUNC_RETURN (rc); LOG_FUNC_RETURN (rc);
...@@ -117,7 +116,6 @@ int lowerlayer_success(nas_user_t *user, unsigned int ueid) ...@@ -117,7 +116,6 @@ int lowerlayer_success(nas_user_t *user, unsigned int ueid)
** Description: Notify the EPS Mobility Management entity that lower la- ** ** Description: Notify the EPS Mobility Management entity that lower la- **
** yers failed to deliver data to the network ** ** yers failed to deliver data to the network **
** ** ** **
** Inputs: ueid: UE lower layer identifier **
** Others: None ** ** Others: None **
** ** ** **
** Outputs: None ** ** Outputs: None **
...@@ -125,7 +123,7 @@ int lowerlayer_success(nas_user_t *user, unsigned int ueid) ...@@ -125,7 +123,7 @@ int lowerlayer_success(nas_user_t *user, unsigned int ueid)
** Others: None ** ** Others: None **
** ** ** **
***************************************************************************/ ***************************************************************************/
int lowerlayer_failure(nas_user_t *user, unsigned int ueid) int lowerlayer_failure(nas_user_t *user)
{ {
LOG_FUNC_IN; LOG_FUNC_IN;
...@@ -133,7 +131,7 @@ int lowerlayer_failure(nas_user_t *user, unsigned int ueid) ...@@ -133,7 +131,7 @@ int lowerlayer_failure(nas_user_t *user, unsigned int ueid)
int rc; int rc;
emm_sap.primitive = EMMREG_LOWERLAYER_FAILURE; emm_sap.primitive = EMMREG_LOWERLAYER_FAILURE;
emm_sap.u.emm_reg.ueid = ueid; emm_sap.u.emm_reg.ueid = user->ueid;
rc = emm_sap_send(user, &emm_sap); rc = emm_sap_send(user, &emm_sap);
LOG_FUNC_RETURN (rc); LOG_FUNC_RETURN (rc);
...@@ -191,7 +189,7 @@ int lowerlayer_release(nas_user_t *user, int cause) ...@@ -191,7 +189,7 @@ int lowerlayer_release(nas_user_t *user, int cause)
user->emm_data->ecm_status = ECM_IDLE; user->emm_data->ecm_status = ECM_IDLE;
emm_sap.primitive = EMMREG_LOWERLAYER_RELEASE; emm_sap.primitive = EMMREG_LOWERLAYER_RELEASE;
emm_sap.u.emm_reg.ueid = 0; emm_sap.u.emm_reg.ueid = user->ueid;
rc = emm_sap_send(user, &emm_sap); rc = emm_sap_send(user, &emm_sap);
LOG_FUNC_RETURN (rc); LOG_FUNC_RETURN (rc);
...@@ -204,7 +202,6 @@ int lowerlayer_release(nas_user_t *user, int cause) ...@@ -204,7 +202,6 @@ int lowerlayer_release(nas_user_t *user, int cause)
** Description: Notify the EPS Session Management entity that data have ** ** Description: Notify the EPS Session Management entity that data have **
** been received from lower layers ** ** been received from lower layers **
** ** ** **
** Inputs: ueid: UE lower layer identifier **
** data: Data transfered from lower layers ** ** data: Data transfered from lower layers **
** Others: None ** ** Others: None **
** ** ** **
...@@ -213,7 +210,7 @@ int lowerlayer_release(nas_user_t *user, int cause) ...@@ -213,7 +210,7 @@ int lowerlayer_release(nas_user_t *user, int cause)
** Others: None ** ** Others: None **
** ** ** **
***************************************************************************/ ***************************************************************************/
int lowerlayer_data_ind(nas_user_t *user, unsigned int ueid, const OctetString *data) int lowerlayer_data_ind(nas_user_t *user, const OctetString *data)
{ {
esm_sap_t esm_sap; esm_sap_t esm_sap;
int rc; int rc;
...@@ -223,7 +220,7 @@ int lowerlayer_data_ind(nas_user_t *user, unsigned int ueid, const OctetString * ...@@ -223,7 +220,7 @@ int lowerlayer_data_ind(nas_user_t *user, unsigned int ueid, const OctetString *
esm_sap.primitive = ESM_UNITDATA_IND; esm_sap.primitive = ESM_UNITDATA_IND;
esm_sap.is_standalone = TRUE; esm_sap.is_standalone = TRUE;
esm_sap.ueid = ueid; esm_sap.ueid = user->ueid;
esm_sap.recv = data; esm_sap.recv = data;
rc = esm_sap_send(user, &esm_sap); rc = esm_sap_send(user, &esm_sap);
...@@ -238,7 +235,6 @@ int lowerlayer_data_ind(nas_user_t *user, unsigned int ueid, const OctetString * ...@@ -238,7 +235,6 @@ int lowerlayer_data_ind(nas_user_t *user, unsigned int ueid, const OctetString *
** Description: Notify the EPS Mobility Management entity that data have ** ** Description: Notify the EPS Mobility Management entity that data have **
** to be transfered to lower layers ** ** to be transfered to lower layers **
** ** ** **
** Inputs: ueid: UE lower layer identifier **
** data: Data to be transfered to lower layers ** ** data: Data to be transfered to lower layers **
** Others: None ** ** Others: None **
** ** ** **
...@@ -247,7 +243,7 @@ int lowerlayer_data_ind(nas_user_t *user, unsigned int ueid, const OctetString * ...@@ -247,7 +243,7 @@ int lowerlayer_data_ind(nas_user_t *user, unsigned int ueid, const OctetString *
** Others: None ** ** Others: None **
** ** ** **
***************************************************************************/ ***************************************************************************/
int lowerlayer_data_req(nas_user_t *user, unsigned int ueid, const OctetString *data) int lowerlayer_data_req(nas_user_t *user, const OctetString *data)
{ {
LOG_FUNC_IN; LOG_FUNC_IN;
...@@ -258,7 +254,7 @@ int lowerlayer_data_req(nas_user_t *user, unsigned int ueid, const OctetString * ...@@ -258,7 +254,7 @@ int lowerlayer_data_req(nas_user_t *user, unsigned int ueid, const OctetString *
emm_sap.primitive = EMMAS_DATA_REQ; emm_sap.primitive = EMMAS_DATA_REQ;
emm_sap.u.emm_as.u.data.guti = user->emm_data->guti; emm_sap.u.emm_as.u.data.guti = user->emm_data->guti;
emm_sap.u.emm_as.u.data.ueid = 0; emm_sap.u.emm_as.u.data.ueid = user->ueid;
sctx = user->emm_data->security; sctx = user->emm_data->security;
emm_sap.u.emm_as.u.data.NASinfo = 0; emm_sap.u.emm_as.u.data.NASinfo = 0;
......
...@@ -79,13 +79,12 @@ typedef int (*lowerlayer_release_callback_t)(void *); ...@@ -79,13 +79,12 @@ typedef int (*lowerlayer_release_callback_t)(void *);
/****************** E X P O R T E D F U N C T I O N S ******************/ /****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/ /****************************************************************************/
// FIXME prototype with ueid int lowerlayer_success(nas_user_t *user);
int lowerlayer_success(nas_user_t *user, unsigned int ueid); int lowerlayer_failure(nas_user_t *user);
int lowerlayer_failure(nas_user_t *user, unsigned int ueid);
int lowerlayer_establish(nas_user_t *user); int lowerlayer_establish(nas_user_t *user);
int lowerlayer_release(nas_user_t *user, int cause); int lowerlayer_release(nas_user_t *user, int cause);
int lowerlayer_data_ind(nas_user_t *user, unsigned int ueid, const OctetString *data); int lowerlayer_data_ind(nas_user_t *user, const OctetString *data);
int lowerlayer_data_req(nas_user_t *user, unsigned int ueid, const OctetString *data); int lowerlayer_data_req(nas_user_t *user, const OctetString *data);
#endif /* __LOWERLAYER_H__*/ #endif /* __LOWERLAYER_H__*/
...@@ -446,18 +446,18 @@ static int _emm_as_data_ind(nas_user_t *user, const emm_as_data_t *msg, int *emm ...@@ -446,18 +446,18 @@ static int _emm_as_data_ind(nas_user_t *user, const emm_as_data_t *msg, int *emm
EPS_SESSION_MANAGEMENT_MESSAGE) { EPS_SESSION_MANAGEMENT_MESSAGE) {
const OctetString data = {bytes, (uint8_t *)plain_msg}; const OctetString data = {bytes, (uint8_t *)plain_msg};
/* Foward ESM data to EPS session management */ /* Foward ESM data to EPS session management */
rc = lowerlayer_data_ind(user, msg->ueid, &data); rc = lowerlayer_data_ind(user, &data);
} }
free(plain_msg); free(plain_msg);
} }
} else { } else {
/* Process successfull lower layer transfer indication */ /* Process successfull lower layer transfer indication */
rc = lowerlayer_success(user, msg->ueid); rc = lowerlayer_success(user);
} }
} else { } else {
/* Process lower layer transmission failure of NAS message */ /* Process lower layer transmission failure of NAS message */
rc = lowerlayer_failure(user, msg->ueid); rc = lowerlayer_failure(user);
} }
LOG_FUNC_RETURN (rc); LOG_FUNC_RETURN (rc);
...@@ -496,7 +496,7 @@ static int _emm_as_establish_cnf(nas_user_t *user, const emm_as_establish_t *msg ...@@ -496,7 +496,7 @@ static int _emm_as_establish_cnf(nas_user_t *user, const emm_as_establish_t *msg
} else { } else {
/* The initial NAS message has been successfully delivered to /* The initial NAS message has been successfully delivered to
* lower layers */ * lower layers */
rc = lowerlayer_success(user, 0); rc = lowerlayer_success(user);
LOG_FUNC_RETURN (rc); LOG_FUNC_RETURN (rc);
} }
...@@ -571,7 +571,7 @@ static int _emm_as_establish_rej(nas_user_t *user) ...@@ -571,7 +571,7 @@ static int _emm_as_establish_rej(nas_user_t *user)
"failure"); "failure");
/* Process lower layer transmission failure of initial NAS message */ /* Process lower layer transmission failure of initial NAS message */
rc = lowerlayer_failure(user, 0); rc = lowerlayer_failure(user);
LOG_FUNC_RETURN (rc); LOG_FUNC_RETURN (rc);
} }
......
...@@ -149,7 +149,7 @@ int emm_esm_send(nas_user_t *user, const emm_esm_t *msg) ...@@ -149,7 +149,7 @@ int emm_esm_send(nas_user_t *user, const emm_esm_t *msg)
case _EMMESM_UNITDATA_REQ: case _EMMESM_UNITDATA_REQ:
/* ESM requests EMM to transfer ESM data unit to lower layer */ /* ESM requests EMM to transfer ESM data unit to lower layer */
rc = lowerlayer_data_req(user, msg->ueid, &msg->u.data.msg); rc = lowerlayer_data_req(user, &msg->u.data.msg);
break; break;
default: default:
......
...@@ -71,6 +71,7 @@ void *nas_ue_task(void *args_p) ...@@ -71,6 +71,7 @@ void *nas_ue_task(void *args_p)
nas_user_t user_value = {}; nas_user_t user_value = {};
nas_user_t *user = &user_value; nas_user_t *user = &user_value;
user->ueid = 0;
itti_mark_task_ready (TASK_NAS_UE); itti_mark_task_ready (TASK_NAS_UE);
MSC_START_USE(); MSC_START_USE();
......
...@@ -59,6 +59,7 @@ Description NAS type definition to manage a user equipment ...@@ -59,6 +59,7 @@ Description NAS type definition to manage a user equipment
#include "at_response.h" #include "at_response.h"
typedef struct { typedef struct {
int ueid; /* UE lower layer identifier */
int fd; int fd;
proc_data_t proc; proc_data_t proc;
// Eps Session Management // Eps Session Management
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment