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
littleBu
OpenXG-RAN
Commits
4b7cb930
Commit
4b7cb930
authored
Apr 18, 2024
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implementation of MAC data inactivity timer
parent
168b172f
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
113 additions
and
9 deletions
+113
-9
openair2/COMMON/mac_messages_def.h
openair2/COMMON/mac_messages_def.h
+1
-0
openair2/COMMON/mac_messages_types.h
openair2/COMMON/mac_messages_types.h
+5
-0
openair2/LAYER2/NR_MAC_UE/config_ue.c
openair2/LAYER2/NR_MAC_UE/config_ue.c
+71
-0
openair2/LAYER2/NR_MAC_UE/mac_defs.h
openair2/LAYER2/NR_MAC_UE/mac_defs.h
+1
-1
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+11
-8
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
+10
-0
openair2/RRC/NR_UE/L2_interface_ue.c
openair2/RRC/NR_UE/L2_interface_ue.c
+7
-0
openair2/RRC/NR_UE/rrc_UE.c
openair2/RRC/NR_UE/rrc_UE.c
+6
-0
openair2/RRC/NR_UE/rrc_proto.h
openair2/RRC/NR_UE/rrc_proto.h
+1
-0
No files found.
openair2/COMMON/mac_messages_def.h
View file @
4b7cb930
...
...
@@ -50,6 +50,7 @@ MESSAGE_DEF(RRC_MAC_PCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcMacPcchDat
MESSAGE_DEF
(
NR_RRC_MAC_RA_IND
,
MESSAGE_PRIORITY_MED_PLUS
,
NRRrcMacRaInd
,
nr_rrc_mac_ra_ind
)
MESSAGE_DEF
(
NR_RRC_MAC_MSG3_IND
,
MESSAGE_PRIORITY_MED_PLUS
,
NRRrcMacMsg3Ind
,
nr_rrc_mac_msg3_ind
)
MESSAGE_DEF
(
NR_RRC_MAC_INAC_IND
,
MESSAGE_PRIORITY_MED_PLUS
,
NRRrcMacInacInd
,
nr_rrc_mac_inac_ind
)
/* RRC configures DRX context (MAC timers) of a UE */
MESSAGE_DEF
(
RRC_MAC_DRX_CONFIG_REQ
,
MESSAGE_PRIORITY_MED
,
rrc_mac_drx_config_req_t
,
rrc_mac_drx_config_req
)
...
...
openair2/COMMON/mac_messages_types.h
View file @
4b7cb930
...
...
@@ -57,6 +57,7 @@
#define NR_RRC_MAC_RA_IND(mSGpTR) (mSGpTR)->ittiMsg.nr_rrc_mac_ra_ind
#define NR_RRC_MAC_MSG3_IND(mSGpTR) (mSGpTR)->ittiMsg.nr_rrc_mac_msg3_ind
#define NR_RRC_MAC_INAC_IND(mSGpTR) (mSGpTR)->ittiMsg.nr_rrc_mac_inac_ind
#define RRC_MAC_DRX_CONFIG_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_drx_config_req
...
...
@@ -80,6 +81,10 @@ typedef struct NRRrcMacMsg3Ind_s {
int
gnb_id
;
}
NRRrcMacMsg3Ind
;
typedef
struct
NRRrcMacInacInd_s
{
bool
inactivity_timer_expired
;
// not to leave the struct empty
}
NRRrcMacInacInd
;
typedef
struct
RrcMacInSyncInd_s
{
uint32_t
frame
;
uint8_t
sub_frame
;
...
...
openair2/LAYER2/NR_MAC_UE/config_ue.c
View file @
4b7cb930
...
...
@@ -1687,6 +1687,64 @@ static uint32_t nr_get_sf_periodicBSRTimer(long periodicBSR)
return
timer
;
}
static
uint32_t
get_data_inactivity_timer
(
long
setup
)
{
uint32_t
timer_s
=
0
;
switch
(
setup
)
{
case
NR_DataInactivityTimer_s1
:
timer_s
=
1
;
break
;
case
NR_DataInactivityTimer_s2
:
timer_s
=
2
;
break
;
case
NR_DataInactivityTimer_s3
:
timer_s
=
3
;
break
;
case
NR_DataInactivityTimer_s5
:
timer_s
=
5
;
break
;
case
NR_DataInactivityTimer_s7
:
timer_s
=
7
;
break
;
case
NR_DataInactivityTimer_s10
:
timer_s
=
10
;
break
;
case
NR_DataInactivityTimer_s15
:
timer_s
=
15
;
break
;
case
NR_DataInactivityTimer_s20
:
timer_s
=
20
;
break
;
case
NR_DataInactivityTimer_s40
:
timer_s
=
40
;
break
;
case
NR_DataInactivityTimer_s50
:
timer_s
=
50
;
break
;
case
NR_DataInactivityTimer_s60
:
timer_s
=
60
;
break
;
case
NR_DataInactivityTimer_s80
:
timer_s
=
80
;
break
;
case
NR_DataInactivityTimer_s100
:
timer_s
=
100
;
break
;
case
NR_DataInactivityTimer_s120
:
timer_s
=
120
;
break
;
case
NR_DataInactivityTimer_s150
:
timer_s
=
150
;
break
;
case
NR_DataInactivityTimer_s180
:
timer_s
=
180
;
break
;
default
:
AssertFatal
(
false
,
"Invalid data inactivity timer
\n
"
);
}
return
timer_s
;
}
static
void
configure_maccellgroup
(
NR_UE_MAC_INST_t
*
mac
,
const
NR_MAC_CellGroupConfig_t
*
mcg
)
{
NR_UE_SCHEDULING_INFO
*
si
=
&
mac
->
scheduling_info
;
...
...
@@ -1743,6 +1801,19 @@ static void configure_maccellgroup(NR_UE_MAC_INST_t *mac, const NR_MAC_CellGroup
if
(
mcg
->
phr_Config
)
{
// TODO configuration when PHR is implemented
}
if
(
mcg
->
ext1
&&
mcg
->
ext1
->
dataInactivityTimer
)
{
struct
NR_SetupRelease_DataInactivityTimer
*
setup_release
=
mcg
->
ext1
->
dataInactivityTimer
;
if
(
setup_release
->
present
==
NR_SetupRelease_DataInactivityTimer_PR_release
)
free
(
mac
->
data_inactivity_timer
);
if
(
setup_release
->
present
==
NR_SetupRelease_DataInactivityTimer_PR_setup
)
{
if
(
!
mac
->
data_inactivity_timer
)
mac
->
data_inactivity_timer
=
calloc
(
1
,
sizeof
(
*
mac
->
data_inactivity_timer
));
uint32_t
timer_s
=
get_data_inactivity_timer
(
setup_release
->
choice
.
setup
);
// timer in seconds
int
scs
=
mac
->
current_DL_BWP
->
scs
;
nr_timer_setup
(
mac
->
data_inactivity_timer
,
(
timer_s
*
1000
)
<<
scs
,
1
);
// 1 slot update rate
}
}
}
static
void
configure_csi_resourcemapping
(
NR_CSI_RS_ResourceMapping_t
*
target
,
NR_CSI_RS_ResourceMapping_t
*
source
)
...
...
openair2/LAYER2/NR_MAC_UE/mac_defs.h
View file @
4b7cb930
...
...
@@ -545,8 +545,8 @@ typedef struct NR_UE_MAC_INST_s {
// order lc info
A_SEQUENCE_OF
(
nr_lcordered_info_t
)
lc_ordered_list
;
NR_UE_SCHEDULING_INFO
scheduling_info
;
NR_timer_t
*
data_inactivity_timer
;
/// PHR
uint8_t
PHR_reporting_active
;
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
View file @
4b7cb930
...
...
@@ -2916,19 +2916,22 @@ void nr_ue_send_sdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_info, in
// Processing MAC PDU
// it parses MAC CEs subheaders, MAC CEs, SDU subheaderds and SDUs
switch
(
dl_info
->
rx_ind
->
rx_indication_body
[
pdu_id
].
pdu_type
){
case
FAPI_NR_RX_PDU_TYPE_DLSCH
:
nr_ue_process_mac_pdu
(
mac
,
dl_info
,
pdu_id
);
break
;
case
FAPI_NR_RX_PDU_TYPE_RAR
:
switch
(
dl_info
->
rx_ind
->
rx_indication_body
[
pdu_id
].
pdu_type
)
{
case
FAPI_NR_RX_PDU_TYPE_DLSCH
:
// start or restart dataInactivityTimer if any MAC entity receives a MAC SDU for DTCH logical channel,
// DCCH logical channel, or CCCH logical channel
if
(
mac
->
data_inactivity_timer
)
nr_timer_start
(
mac
->
data_inactivity_timer
);
nr_ue_process_mac_pdu
(
mac
,
dl_info
,
pdu_id
);
break
;
case
FAPI_NR_RX_PDU_TYPE_RAR
:
nr_ue_process_rar
(
mac
,
dl_info
,
pdu_id
);
break
;
break
;
default:
break
;
AssertFatal
(
false
,
"Invalid PDU type
\n
"
)
;
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU
,
VCD_FUNCTION_OUT
);
}
// #define EXTRACT_DCI_ITEM(val,size) val= readBits(dci_pdu, &pos, size);
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
View file @
4b7cb930
...
...
@@ -54,6 +54,7 @@
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
#include "LAYER2/RLC/rlc.h"
#include "RRC/NR_UE/rrc_proto.h"
//#define SRS_DEBUG
#define verifyMutex(a) \
...
...
@@ -147,6 +148,11 @@ static void trigger_regular_bsr(NR_UE_MAC_INST_t *mac, NR_LogicalChannelIdentity
void
update_mac_timers
(
NR_UE_MAC_INST_t
*
mac
)
{
if
(
mac
->
data_inactivity_timer
)
{
bool
inactivity_timer_expired
=
nr_timer_tick
(
mac
->
data_inactivity_timer
);
if
(
inactivity_timer_expired
)
nr_mac_rrc_inactivity_timer_ind
(
mac
->
ue_id
);
}
nr_timer_tick
(
&
mac
->
ra
.
contention_resolution_timer
);
for
(
int
j
=
0
;
j
<
NR_MAX_SR_ID
;
j
++
)
nr_timer_tick
(
&
mac
->
scheduling_info
.
sr_info
[
j
].
prohibitTimer
);
...
...
@@ -1330,6 +1336,10 @@ void nr_ue_ul_scheduler(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info)
ulcfg_pdu
->
pusch_config_pdu
.
tx_request_body
.
fapiTxPdu
=
ulsch_input_buffer
;
ulcfg_pdu
->
pusch_config_pdu
.
tx_request_body
.
pdu_length
=
TBS_bytes
;
number_of_pdus
++
;
// start or restart dataInactivityTimer if any MAC entity transmits a MAC SDU for DTCH logical channel,
// or DCCH logical channel
if
(
mac
->
data_inactivity_timer
)
nr_timer_start
(
mac
->
data_inactivity_timer
);
}
}
...
...
openair2/RRC/NR_UE/L2_interface_ue.c
View file @
4b7cb930
...
...
@@ -126,6 +126,13 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
return
(
0
);
}
void
nr_mac_rrc_inactivity_timer_ind
(
const
module_id_t
mod_id
)
{
MessageDef
*
message_p
=
itti_alloc_new_message
(
TASK_MAC_UE
,
0
,
NR_RRC_MAC_INAC_IND
);
NR_RRC_MAC_INAC_IND
(
message_p
).
inactivity_timer_expired
=
true
;
itti_send_msg_to_task
(
TASK_RRC_NRUE
,
GNB_MODULE_ID_TO_INSTANCE
(
mod_id
),
message_p
);
}
void
nr_mac_rrc_msg3_ind
(
const
module_id_t
mod_id
,
const
int
rnti
,
int
gnb_id
)
{
MessageDef
*
message_p
=
itti_alloc_new_message
(
TASK_MAC_UE
,
0
,
NR_RRC_MAC_MSG3_IND
);
...
...
openair2/RRC/NR_UE/rrc_UE.c
View file @
4b7cb930
...
...
@@ -1737,6 +1737,12 @@ void *rrc_nrue(void *notUsed)
nr_rrc_SI_timers
(
SInfo
);
break
;
case
NR_RRC_MAC_INAC_IND
:
LOG_D
(
NR_RRC
,
"Received data inactivity indication from lower layers
\n
"
);
NR_Release_Cause_t
release_cause
=
RRC_CONNECTION_FAILURE
;
nr_rrc_going_to_IDLE
(
rrc
,
release_cause
,
NULL
);
break
;
case
NR_RRC_MAC_MSG3_IND
:
nr_rrc_handle_msg3_indication
(
rrc
,
NR_RRC_MAC_MSG3_IND
(
msg_p
).
rnti
);
break
;
...
...
openair2/RRC/NR_UE/rrc_proto.h
View file @
4b7cb930
...
...
@@ -89,6 +89,7 @@ void nr_rrc_going_to_IDLE(NR_UE_RRC_INST_t *rrc,
void
handle_RRCRelease
(
NR_UE_RRC_INST_t
*
rrc
);
void
nr_mac_rrc_ra_ind
(
const
module_id_t
mod_id
,
int
frame
,
bool
success
);
void
nr_mac_rrc_msg3_ind
(
const
module_id_t
mod_id
,
const
int
rnti
,
int
gnb_id
);
void
nr_mac_rrc_inactivity_timer_ind
(
const
module_id_t
mod_id
);
void
set_rlf_sib1_timers_and_constants
(
NR_UE_Timers_Constants_t
*
tac
,
NR_SIB1_t
*
sib1
);
/**\brief RRC UE task.
...
...
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