Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
promise
OpenXG-RAN
Commits
57a383e7
Commit
57a383e7
authored
Oct 23, 2018
by
Louis Adrien Dufrene
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Format rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND() and rrc_eNB_free_UE()
parent
2e5ae1ea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
119 additions
and
99 deletions
+119
-99
openair2/RRC/LTE/rrc_eNB.c
openair2/RRC/LTE/rrc_eNB.c
+87
-65
openair2/RRC/LTE/rrc_eNB_S1AP.c
openair2/RRC/LTE/rrc_eNB_S1AP.c
+32
-34
No files found.
openair2/RRC/LTE/rrc_eNB.c
View file @
57a383e7
...
@@ -832,45 +832,58 @@ rrc_eNB_free_mem_UE_context(
...
@@ -832,45 +832,58 @@ rrc_eNB_free_mem_UE_context(
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// should be called when UE is lost by eNB
/*
* Should be called when UE context in eNB should be released
* or when S1 command UE_CONTEXT_RELEASE_REQ should be sent
*/
void
void
rrc_eNB_free_UE
(
const
module_id_t
enb_mod_idP
,
const
struct
rrc_eNB_ue_context_s
*
const
ue_context_pP
)
rrc_eNB_free_UE
(
const
module_id_t
enb_mod_idP
,
const
struct
rrc_eNB_ue_context_s
*
const
ue_context_pP
)
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
{
{
protocol_ctxt_t
ctxt
;
protocol_ctxt_t
ctxt
;
rnti_t
rnti
=
ue_context_pP
->
ue_context
.
rnti
;
rnti_t
rnti
=
ue_context_pP
->
ue_context
.
rnti
;
if
(
enb_mod_idP
>=
NB_eNB_INST
)
{
if
(
enb_mod_idP
>=
NB_eNB_INST
)
{
LOG_I
(
RRC
,
"eNB inst invalid (%d/%d) for UE %x!
\n
"
,
enb_mod_idP
,
NB_eNB_INST
,
rnti
);
LOG_I
(
RRC
,
"eNB instance invalid (%d/%d) for UE %x!
\n
"
,
return
;
enb_mod_idP
,
NB_eNB_INST
,
rnti
);
return
;
}
}
/* ue_context_p = rrc_eNB_get_ue_context(
&RC.rrc[enb_mod_idP],
rntiP
);
*/
if
(
NULL
!=
ue_context_pP
)
{
if
(
NULL
!=
ue_context_pP
)
{
PROTOCOL_CTXT_SET_BY_MODULE_ID
(
&
ctxt
,
enb_mod_idP
,
ENB_FLAG_YES
,
rnti
,
0
,
0
,
enb_mod_idP
);
PROTOCOL_CTXT_SET_BY_MODULE_ID
(
&
ctxt
,
enb_mod_idP
,
ENB_FLAG_YES
,
rnti
,
0
,
0
,
enb_mod_idP
);
LOG_W
(
RRC
,
"[eNB %d] Removing UE RNTI %x
\n
"
,
enb_mod_idP
,
rnti
);
LOG_W
(
RRC
,
"[eNB %d] Removing UE RNTI %x
\n
"
,
if
(
EPC_MODE_ENABLED
)
{
enb_mod_idP
,
rnti
);
if
((
ue_context_pP
->
ue_context
.
ul_failure_timer
>=
20000
)
&&
(
mac_eNB_get_rrc_status
(
enb_mod_idP
,
rnti
)
>=
RRC_CONNECTED
))
{
if
(
EPC_MODE_ENABLED
)
{
LOG_I
(
RRC
,
"[eNB %d] S1AP_UE_CONTEXT_RELEASE_REQ RNTI %x
\n
"
,
enb_mod_idP
,
rnti
);
if
((
ue_context_pP
->
ue_context
.
ul_failure_timer
>=
20000
)
&&
(
mac_eNB_get_rrc_status
(
enb_mod_idP
,
rnti
)
>=
RRC_CONNECTED
))
{
rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ
(
enb_mod_idP
,
ue_context_pP
,
S1AP_CAUSE_RADIO_NETWORK
,
21
);
// send cause 21: connection with ue lost
LOG_I
(
RRC
,
"[eNB %d] S1AP_UE_CONTEXT_RELEASE_REQ sent for RNTI %x
\n
"
,
/* From 3GPP 36300v10 p129 : 19.2.2.2.2 S1 UE Context Release Request (eNB triggered)
enb_mod_idP
,
* If the E-UTRAN internal reason is a radio link failure detected in the eNB, the eNB shall wait a sufficient time before
rnti
);
* triggering the S1 UE Context Release Request procedure
* in order to allow the UE to perform the NAS recovery
rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ
(
enb_mod_idP
,
ue_context_pP
,
S1AP_CAUSE_RADIO_NETWORK
,
21
);
* procedure, see TS 23.401 [17].
// send cause 21: connection with ue lost
*/
/* From 3GPP 36300v10 p129 : 19.2.2.2.2 S1 UE Context Release Request (eNB triggered)
return
;
* If the E-UTRAN internal reason is a radio link failure detected in the eNB, the eNB shall wait a sufficient time before
* triggering the S1 UE Context Release Request procedure in order to allow the UE to perform the NAS recovery
* procedure, see TS 23.401 [17].
*/
return
;
}
// TODO : add here cause ul inactivity
}
}
}
// add UE info to freeList
// add UE info to freeList
LOG_I
(
RRC
,
"put UE %x into freeList
\n
"
,
rnti
);
LOG_I
(
RRC
,
"Put UE %x into freeList
\n
"
,
rnti
);
put_UE_in_freelist
(
enb_mod_idP
,
rnti
,
1
);
put_UE_in_freelist
(
enb_mod_idP
,
rnti
,
1
);
}
}
}
}
...
@@ -1980,44 +1993,40 @@ rrc_eNB_generate_RRCConnectionReestablishmentReject(
...
@@ -1980,44 +1993,40 @@ rrc_eNB_generate_RRCConnectionReestablishmentReject(
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
/*
* Generate the RRC Connection Release to UE.
* If received, UE should switch to RRC_IDLE mode.
*/
void
void
rrc_eNB_generate_RRCConnectionRelease
(
rrc_eNB_generate_RRCConnectionRelease
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
protocol_ctxt_t
*
const
ctxt_pP
,
rrc_eNB_ue_context_t
*
const
ue_context_pP
rrc_eNB_ue_context_t
*
const
ue_context_pP
)
)
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
{
{
uint8_t
buffer
[
RRC_BUF_SIZE
]
=
0
;
uint8_t
buffer
[
RRC_BUF_SIZE
];
uint16_t
size
=
0
;
uint16_t
size
;
T
(
T_ENB_RRC_CONNECTION_RELEASE
,
T_INT
(
ctxt_pP
->
module_id
),
T_INT
(
ctxt_pP
->
frame
),
T
(
T_ENB_RRC_CONNECTION_RELEASE
,
T_INT
(
ctxt_pP
->
module_id
),
T_INT
(
ctxt_pP
->
frame
),
T_INT
(
ctxt_pP
->
subframe
),
T_INT
(
ctxt_pP
->
rnti
));
T_INT
(
ctxt_pP
->
subframe
),
T_INT
(
ctxt_pP
->
rnti
));
memset
(
buffer
,
0
,
RRC_BUF_SIZE
);
memset
(
buffer
,
0
,
RRC_BUF_SIZE
);
size
=
do_RRCConnectionRelease
(
ctxt_pP
->
module_id
,
buffer
,
rrc_eNB_get_next_transaction_identifier
(
ctxt_pP
->
module_id
));
size
=
do_RRCConnectionRelease
(
ctxt_pP
->
module_id
,
buffer
,
rrc_eNB_get_next_transaction_identifier
(
ctxt_pP
->
module_id
));
// set release timer
//ue_context_pP->ue_context.ue_release_timer=1;
// remove UE after 10 frames after RRCConnectionRelease is triggered
//ue_context_pP->ue_context.ue_release_timer_thres=100;
// set release timer
// ue_context_pP->ue_context.ue_release_timer_rrc = 1;
// remove UE after 10 frames after RRCConnectionRelease is triggered
// ue_context_pP->ue_context.ue_release_timer_thres_rrc = 100;
ue_context_pP
->
ue_context
.
ue_reestablishment_timer
=
0
;
ue_context_pP
->
ue_context
.
ue_reestablishment_timer
=
0
;
ue_context_pP
->
ue_context
.
ue_release_timer
=
0
;
ue_context_pP
->
ue_context
.
ue_release_timer
=
0
;
//ue_context_pP->ue_context.ue_release_timer_s1 = 0;
LOG_I
(
RRC
,
LOG_I
(
RRC
,
PROTOCOL_RRC_CTXT_UE_FMT
" Logical Channel DL-DCCH, Generate RRCConnectionRelease (bytes %d)
\n
"
,
PROTOCOL_RRC_CTXT_UE_FMT
" Logical Channel DL-DCCH, Generate RRCConnectionRelease (bytes %d)
\n
"
,
PROTOCOL_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
PROTOCOL_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
size
);
size
);
LOG_D
(
RRC
,
LOG_D
(
RRC
,
PROTOCOL_RRC_CTXT_UE_FMT
" --- PDCP_DATA_REQ/%d Bytes (rrcConnectionRelease MUI %d) --->[PDCP][RB %u]
\n
"
,
PROTOCOL_RRC_CTXT_UE_FMT
" --- PDCP_DATA_REQ/%d Bytes (rrcConnectionRelease MUI %d) --->[PDCP][RB %u]
\n
"
,
PROTOCOL_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
PROTOCOL_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
size
,
size
,
rrc_eNB_mui
,
rrc_eNB_mui
,
DCCH
);
DCCH
);
MSC_LOG_TX_MESSAGE
(
MSC_LOG_TX_MESSAGE
(
MSC_RRC_ENB
,
MSC_RRC_ENB
,
...
@@ -2029,31 +2038,39 @@ rrc_eNB_generate_RRCConnectionRelease(
...
@@ -2029,31 +2038,39 @@ rrc_eNB_generate_RRCConnectionRelease(
ue_context_pP
->
ue_context
.
rnti
,
ue_context_pP
->
ue_context
.
rnti
,
rrc_eNB_mui
,
rrc_eNB_mui
,
size
);
size
);
pthread_mutex_lock
(
&
rrc_release_freelist
);
pthread_mutex_lock
(
&
rrc_release_freelist
);
for
(
uint16_t
release_num
=
0
;
release_num
<
NUMBER_OF_UE_MAX
;
release_num
++
){
for
(
uint16_t
release_num
=
0
;
release_num
<
NUMBER_OF_UE_MAX
;
release_num
++
)
{
if
(
rrc_release_info
.
RRC_release_ctrl
[
release_num
].
flag
==
0
){
if
(
rrc_release_info
.
RRC_release_ctrl
[
release_num
].
flag
==
0
)
{
if
(
ue_context_pP
->
ue_context
.
ue_release_timer_s1
>
0
){
if
(
ue_context_pP
->
ue_context
.
ue_release_timer_s1
>
0
)
{
rrc_release_info
.
RRC_release_ctrl
[
release_num
].
flag
=
1
;
rrc_release_info
.
RRC_release_ctrl
[
release_num
].
flag
=
1
;
}
else
{
}
else
{
rrc_release_info
.
RRC_release_ctrl
[
release_num
].
flag
=
2
;
rrc_release_info
.
RRC_release_ctrl
[
release_num
].
flag
=
2
;
}
}
rrc_release_info
.
RRC_release_ctrl
[
release_num
].
rnti
=
ctxt_pP
->
rnti
;
rrc_release_info
.
RRC_release_ctrl
[
release_num
].
rnti
=
ctxt_pP
->
rnti
;
rrc_release_info
.
RRC_release_ctrl
[
release_num
].
rrc_eNB_mui
=
rrc_eNB_mui
;
rrc_release_info
.
RRC_release_ctrl
[
release_num
].
rrc_eNB_mui
=
rrc_eNB_mui
;
rrc_release_info
.
num_UEs
++
;
rrc_release_info
.
num_UEs
++
;
LOG_D
(
RRC
,
"Generate DLSCH Release send: index %d rnti %x mui %d flag %d
\n
"
,
release_num
,
ctxt_pP
->
rnti
,
rrc_eNB_mui
,
rrc_release_info
.
RRC_release_ctrl
[
release_num
].
flag
);
LOG_D
(
RRC
,
"Generate DLSCH Release send: index %d rnti %x mui %d flag %d
\n
"
,
release_num
,
ctxt_pP
->
rnti
,
rrc_eNB_mui
,
rrc_release_info
.
RRC_release_ctrl
[
release_num
].
flag
);
break
;
break
;
}
}
}
}
pthread_mutex_unlock
(
&
rrc_release_freelist
);
pthread_mutex_unlock
(
&
rrc_release_freelist
);
rrc_data_req
(
ctxt_pP
,
rrc_data_req
(
ctxt_pP
,
DCCH
,
DCCH
,
rrc_eNB_mui
++
,
rrc_eNB_mui
++
,
SDU_CONFIRM_NO
,
SDU_CONFIRM_NO
,
size
,
size
,
buffer
,
buffer
,
PDCP_TRANSMISSION_MODE_CONTROL
);
PDCP_TRANSMISSION_MODE_CONTROL
);
}
}
uint8_t
qci_to_priority
[
9
]
=
{
2
,
4
,
3
,
5
,
1
,
6
,
7
,
8
,
9
};
uint8_t
qci_to_priority
[
9
]
=
{
2
,
4
,
3
,
5
,
1
,
6
,
7
,
8
,
9
};
...
@@ -7904,6 +7921,11 @@ rrc_rx_tx(
...
@@ -7904,6 +7921,11 @@ rrc_rx_tx(
if
(
ue_context_p
->
ue_context
.
ue_release_timer
>=
ue_context_p
->
ue_context
.
ue_release_timer_thres
)
{
if
(
ue_context_p
->
ue_context
.
ue_release_timer
>=
ue_context_p
->
ue_context
.
ue_release_timer_thres
)
{
LOG_I
(
RRC
,
"Removing UE %x instance because of RRC Connection Setup timer timeout
\n
"
,
LOG_I
(
RRC
,
"Removing UE %x instance because of RRC Connection Setup timer timeout
\n
"
,
ue_context_p
->
ue_context
.
rnti
);
ue_context_p
->
ue_context
.
rnti
);
/*
* TODO: Naming problem here: ue_release_timer seems to have been used when RRC Connection Release was sent.
* It is no more the case.
* The timer should be renamed.
*/
ue_to_be_removed
=
ue_context_p
;
ue_to_be_removed
=
ue_context_p
;
ue_context_p
->
ue_context
.
ue_release_timer
=
0
;
ue_context_p
->
ue_context
.
ue_release_timer
=
0
;
...
...
openair2/RRC/LTE/rrc_eNB_S1AP.c
View file @
57a383e7
...
@@ -1201,66 +1201,64 @@ void rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ (
...
@@ -1201,66 +1201,64 @@ void rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ (
}
}
/*------------------------------------------------------------------------------*/
//-----------------------------------------------------------------------------
int
rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND
(
MessageDef
*
msg_p
,
const
char
*
msg_name
,
instance_t
instance
)
/*
* Process the S1 command UE_CONTEXT_RELEASE_COMMAND, sent by MME.
* The eNB should remove all e-rab, S1 context, and other context of the UE.
*/
int
rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND
(
MessageDef
*
msg_p
,
const
char
*
msg_name
,
instance_t
instance
)
{
{
//-----------------------------------------------------------------------------
uint32_t
eNB_ue_s1ap_id
;
uint32_t
eNB_ue_s1ap_id
;
protocol_ctxt_t
ctxt
;
protocol_ctxt_t
ctxt
;
struct
rrc_eNB_ue_context_s
*
ue_context_p
=
NULL
;
struct
rrc_eNB_ue_context_s
*
ue_context_p
=
NULL
;
struct
rrc_ue_s1ap_ids_s
*
rrc_ue_s1ap_ids
=
NULL
;
struct
rrc_ue_s1ap_ids_s
*
rrc_ue_s1ap_ids
=
NULL
;
eNB_ue_s1ap_id
=
S1AP_UE_CONTEXT_RELEASE_COMMAND
(
msg_p
).
eNB_ue_s1ap_id
;
eNB_ue_s1ap_id
=
S1AP_UE_CONTEXT_RELEASE_COMMAND
(
msg_p
).
eNB_ue_s1ap_id
;
ue_context_p
=
rrc_eNB_get_ue_context_from_s1ap_ids
(
instance
,
UE_INITIAL_ID_INVALID
,
eNB_ue_s1ap_id
);
ue_context_p
=
rrc_eNB_get_ue_context_from_s1ap_ids
(
instance
,
UE_INITIAL_ID_INVALID
,
eNB_ue_s1ap_id
);
if
(
ue_context_p
==
NULL
)
{
if
(
ue_context_p
==
NULL
)
{
/* Can not associate this message to an UE index */
/* Can not associate this message to an UE index */
MessageDef
*
msg_complete_p
;
MessageDef
*
msg_complete_p
=
NULL
;
LOG_W
(
RRC
,
LOG_W
(
RRC
,
"[eNB %d] In S1AP_UE_CONTEXT_RELEASE_COMMAND: unknown UE from eNB_ue_s1ap_id (%d)
\n
"
,
"[eNB %d] In S1AP_UE_CONTEXT_RELEASE_COMMAND: unknown UE from eNB_ue_s1ap_id (%d)
\n
"
,
instance
,
instance
,
eNB_ue_s1ap_id
);
eNB_ue_s1ap_id
);
MSC_LOG_EVENT
(
MSC_LOG_EVENT
(
MSC_RRC_ENB
,
"0 S1AP_UE_CONTEXT_RELEASE_COMPLETE eNB_ue_s1ap_id 0x%06"
PRIX32
" context not found"
,
MSC_RRC_ENB
,
"0 S1AP_UE_CONTEXT_RELEASE_COMPLETE eNB_ue_s1ap_id 0x%06"
PRIX32
" context not found"
,
eNB_ue_s1ap_id
);
eNB_ue_s1ap_id
);
MSC_LOG_TX_MESSAGE
(
MSC_LOG_TX_MESSAGE
(
MSC_RRC_ENB
,
MSC_RRC
_ENB
,
MSC_S1AP
_ENB
,
MSC_S1AP_ENB
,
NULL
,
NULL
,
0
,
0
,
"0 S1AP_UE_CONTEXT_RELEASE_COMPLETE eNB_ue_s1ap_id 0x%06"
PRIX32
" "
,
"0 S1AP_UE_CONTEXT_RELEASE_COMPLETE eNB_ue_s1ap_id 0x%06"
PRIX32
" "
,
eNB_ue_s1ap_id
);
eNB_ue_s1ap_id
);
msg_complete_p
=
itti_alloc_new_message
(
TASK_RRC_ENB
,
S1AP_UE_CONTEXT_RELEASE_COMPLETE
);
msg_complete_p
=
itti_alloc_new_message
(
TASK_RRC_ENB
,
S1AP_UE_CONTEXT_RELEASE_COMPLETE
);
S1AP_UE_CONTEXT_RELEASE_COMPLETE
(
msg_complete_p
).
eNB_ue_s1ap_id
=
eNB_ue_s1ap_id
;
S1AP_UE_CONTEXT_RELEASE_COMPLETE
(
msg_complete_p
).
eNB_ue_s1ap_id
=
eNB_ue_s1ap_id
;
itti_send_msg_to_task
(
TASK_S1AP
,
instance
,
msg_complete_p
);
itti_send_msg_to_task
(
TASK_S1AP
,
instance
,
msg_complete_p
);
rrc_ue_s1ap_ids
=
rrc_eNB_S1AP_get_ue_ids
(
rrc_ue_s1ap_ids
=
rrc_eNB_S1AP_get_ue_ids
(
RC
.
rrc
[
instance
],
UE_INITIAL_ID_INVALID
,
eNB_ue_s1ap_id
);
RC
.
rrc
[
instance
],
UE_INITIAL_ID_INVALID
,
eNB_ue_s1ap_id
);
if
(
NULL
!=
rrc_ue_s1ap_ids
)
{
if
(
NULL
!=
rrc_ue_s1ap_ids
)
{
rrc_eNB_S1AP_remove_ue_ids
(
rrc_eNB_S1AP_remove_ue_ids
(
RC
.
rrc
[
instance
],
rrc_ue_s1ap_ids
);
RC
.
rrc
[
instance
],
rrc_ue_s1ap_ids
);
}
}
return
(
-
1
);
return
-
1
;
}
else
{
}
else
{
ue_context_p
->
ue_context
.
ue_release_timer_s1
=
0
;
ue_context_p
->
ue_context
.
ue_release_timer_s1
=
0
;
PROTOCOL_CTXT_SET_BY_INSTANCE
(
&
ctxt
,
instance
,
ENB_FLAG_YES
,
ue_context_p
->
ue_context
.
rnti
,
0
,
0
);
PROTOCOL_CTXT_SET_BY_INSTANCE
(
&
ctxt
,
instance
,
ENB_FLAG_YES
,
ue_context_p
->
ue_context
.
rnti
,
0
,
0
);
rrc_eNB_generate_RRCConnectionRelease
(
&
ctxt
,
ue_context_p
);
rrc_eNB_generate_RRCConnectionRelease
(
&
ctxt
,
ue_context_p
);
/*
LOG_W(RRC,
return
0
;
"[eNB %d] In S1AP_UE_CONTEXT_RELEASE_COMMAND: TODO call rrc_eNB_connection_release for eNB %d\n",
instance,
eNB_ue_s1ap_id);
*/
return
(
0
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment