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
lizhongxiao
OpenXG-RAN
Commits
1a80393b
Commit
1a80393b
authored
Oct 04, 2023
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reestablishment initiation
parent
3f3a9869
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
144 additions
and
52 deletions
+144
-52
openair2/LAYER2/NR_MAC_UE/config_ue.c
openair2/LAYER2/NR_MAC_UE/config_ue.c
+16
-5
openair2/LAYER2/NR_MAC_UE/mac_proto.h
openair2/LAYER2/NR_MAC_UE/mac_proto.h
+2
-1
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
+80
-38
openair2/RRC/NR_UE/rrc_UE.c
openair2/RRC/NR_UE/rrc_UE.c
+44
-6
openair2/RRC/NR_UE/rrc_defs.h
openair2/RRC/NR_UE/rrc_defs.h
+1
-2
openair2/RRC/NR_UE/rrc_proto.h
openair2/RRC/NR_UE/rrc_proto.h
+1
-0
No files found.
openair2/LAYER2/NR_MAC_UE/config_ue.c
View file @
1a80393b
...
...
@@ -1353,17 +1353,28 @@ static void configure_common_BWP_ul(NR_UE_MAC_INST_t *mac, int bwp_id, NR_BWP_Up
}
void
nr_rrc_mac_config_req_reset
(
module_id_t
module_id
,
NR_UE_MAC_reset_cause_t
reset_
cause
)
NR_UE_MAC_reset_cause_t
cause
)
{
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
module_id
);
if
(
cause
==
GO_TO_IDLE
)
{
reset_ra
(
&
mac
->
ra
);
nr_ue_init_mac
(
mac
);
}
if
(
cause
==
RE_ESTABLISHMENT
)
{
// reset synchornization status
mac
->
first_sync_frame
=
-
1
;
mac
->
state
=
UE_NOT_SYNC
;
mac
->
ra
.
ra_state
=
RA_UE_IDLE
;
}
reset_mac_inst
(
mac
);
reset_ra
(
&
mac
->
ra
);
release_mac_configuration
(
mac
);
nr_ue_init_mac
(
mac
);
nr_ue_mac_default_configs
(
mac
);
release_mac_configuration
(
mac
,
cause
);
// Sending to PHY a request to resync
// with no target cell ID
if
(
reset_
cause
!=
DETACH
)
{
if
(
cause
!=
DETACH
)
{
mac
->
synch_request
.
Mod_id
=
module_id
;
mac
->
synch_request
.
CC_id
=
0
;
mac
->
synch_request
.
synch_req
.
target_Nid_cell
=
-
1
;
...
...
openair2/LAYER2/NR_MAC_UE/mac_proto.h
View file @
1a80393b
...
...
@@ -202,7 +202,8 @@ NR_UE_MAC_INST_t *get_mac_inst(module_id_t module_id);
void
reset_mac_inst
(
NR_UE_MAC_INST_t
*
nr_mac
);
void
reset_ra
(
RA_config_t
*
ra
);
void
release_mac_configuration
(
NR_UE_MAC_INST_t
*
mac
);
void
release_mac_configuration
(
NR_UE_MAC_INST_t
*
mac
,
NR_UE_MAC_reset_cause_t
cause
);
/**\brief called at each slot, slot length based on numerology. now use u=0, scs=15kHz, slot=1ms
performs BSR/SR/PHR procedures, random access procedure handler and DLSCH/ULSCH procedures.
...
...
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
View file @
1a80393b
...
...
@@ -57,41 +57,23 @@ void nr_ue_init_mac(NR_UE_MAC_INST_t *mac)
{
LOG_I
(
NR_MAC
,
"[UE%d] Initializing MAC
\n
"
,
mac
->
ue_id
);
mac
->
first_sync_frame
=
-
1
;
mac
->
state
=
UE_NOT_SYNC
;
mac
->
get_sib1
=
false
;
mac
->
get_otherSI
=
false
;
mac
->
phy_config_request_sent
=
false
;
memset
(
&
mac
->
phy_config
,
0
,
sizeof
(
mac
->
phy_config
));
mac
->
state
=
UE_NOT_SYNC
;
mac
->
si_window_start
=
-
1
;
mac
->
servCellIndex
=
0
;
mac
->
harq_ACK_SpatialBundlingPUCCH
=
false
;
mac
->
harq_ACK_SpatialBundlingPUSCH
=
false
;
mac
->
p_Max
=
INT_MIN
;
mac
->
p_Max_alt
=
INT_MIN
;
memset
(
&
mac
->
ssb_measurements
,
0
,
sizeof
(
mac
->
ssb_measurements
));
memset
(
&
mac
->
ul_time_alignment
,
0
,
sizeof
(
mac
->
ul_time_alignment
));
for
(
int
i
=
0
;
i
<
MAX_NUM_BWP_UE
;
i
++
)
{
memset
(
&
mac
->
ssb_list
[
i
],
0
,
sizeof
(
mac
->
ssb_list
[
i
]));
memset
(
&
mac
->
prach_assoc_pattern
[
i
],
0
,
sizeof
(
mac
->
prach_assoc_pattern
[
i
]));
}
for
(
int
k
=
0
;
k
<
NR_MAX_HARQ_PROCESSES
;
k
++
)
{
mac
->
ul_harq_info
[
k
].
last_ndi
=
-
1
;
// initialize to invalid value
mac
->
dl_harq_info
[
k
].
last_ndi
=
-
1
;
// initialize to invalid value
}
}
void
nr_ue_mac_default_configs
(
NR_UE_MAC_INST_t
*
mac
)
{
// default values as defined in 38.331 sec 9.2.2
mac
->
scheduling_info
.
retxBSR_Timer
=
NR_BSR_Config__retxBSR_Timer_sf10240
;
mac
->
scheduling_info
.
periodicBSR_Timer
=
NR_BSR_Config__periodicBSR_Timer_infinity
;
mac
->
scheduling_info
.
SR_COUNTER
=
0
;
mac
->
scheduling_info
.
SR_pending
=
0
;
mac
->
scheduling_info
.
sr_ProhibitTimer
=
0
;
mac
->
scheduling_info
.
sr_ProhibitTimer_Running
=
0
;
mac
->
scheduling_info
.
sr_id
=
-
1
;
// invalid init value
// set init value 0xFFFF, make sure periodic timer and retx time counters are NOT active, after bsr transmission set the value
// configured by the NW.
mac
->
scheduling_info
.
periodicBSR_SF
=
MAC_UE_BSR_TIMER_NOT_RUNNING
;
mac
->
scheduling_info
.
retxBSR_SF
=
MAC_UE_BSR_TIMER_NOT_RUNNING
;
mac
->
BSR_reporting_active
=
BSR_TRIGGER_NONE
;
...
...
@@ -102,6 +84,27 @@ void nr_ue_mac_default_configs(NR_UE_MAC_INST_t *mac)
mac
->
scheduling_info
.
lc_sched_info
[
i
].
LCID_buffer_remain
=
0
;
mac
->
scheduling_info
.
lc_sched_info
[
i
].
Bj
=
0
;
}
for
(
int
k
=
0
;
k
<
NR_MAX_HARQ_PROCESSES
;
k
++
)
{
mac
->
ul_harq_info
[
k
].
last_ndi
=
-
1
;
// initialize to invalid value
mac
->
dl_harq_info
[
k
].
last_ndi
=
-
1
;
// initialize to invalid value
}
memset
(
&
mac
->
ssb_measurements
,
0
,
sizeof
(
mac
->
ssb_measurements
));
memset
(
&
mac
->
ul_time_alignment
,
0
,
sizeof
(
mac
->
ul_time_alignment
));
for
(
int
i
=
0
;
i
<
MAX_NUM_BWP_UE
;
i
++
)
{
memset
(
&
mac
->
ssb_list
[
i
],
0
,
sizeof
(
mac
->
ssb_list
[
i
]));
memset
(
&
mac
->
prach_assoc_pattern
[
i
],
0
,
sizeof
(
mac
->
prach_assoc_pattern
[
i
]));
}
}
void
nr_ue_mac_default_configs
(
NR_UE_MAC_INST_t
*
mac
)
{
// default values as defined in 38.331 sec 9.2.2
mac
->
scheduling_info
.
retxBSR_Timer
=
NR_BSR_Config__retxBSR_Timer_sf80
;
mac
->
scheduling_info
.
periodicBSR_Timer
=
NR_BSR_Config__periodicBSR_Timer_sf10
;
mac
->
scheduling_info
.
periodicPHR_Timer
=
NR_PHR_Config__phr_PeriodicTimer_sf10
;
mac
->
scheduling_info
.
prohibitPHR_Timer
=
NR_PHR_Config__phr_ProhibitTimer_sf10
;
}
NR_UE_MAC_INST_t
*
nr_l2_init_ue
(
int
nb_inst
)
...
...
@@ -141,11 +144,13 @@ void reset_mac_inst(NR_UE_MAC_INST_t *nr_mac)
{
// MAC reset according to 38.321 Section 5.12
nr_ue_mac_default_configs
(
nr_mac
);
// initialize Bj for each logical channel to zero
for
(
int
i
=
0
;
i
<
NR_MAX_NUM_LCID
;
i
++
)
// TODO reset also other status variables of LC, is this ok?
for
(
int
i
=
0
;
i
<
NR_MAX_NUM_LCID
;
i
++
)
{
nr_mac
->
scheduling_info
.
lc_sched_info
[
i
].
Bj
=
0
;
nr_mac
->
scheduling_info
.
lc_sched_info
[
i
].
LCID_status
=
LCID_EMPTY
;
nr_mac
->
scheduling_info
.
lc_sched_info
[
i
].
LCID_buffer_remain
=
0
;
}
// stop all running timers
// TODO
...
...
@@ -168,10 +173,16 @@ void reset_mac_inst(NR_UE_MAC_INST_t *nr_mac)
free_and_zero
(
nr_mac
->
ra
.
Msg3_buffer
);
// cancel any triggered Scheduling Request procedure
// Done in default config
nr_mac
->
scheduling_info
.
SR_COUNTER
=
0
;
nr_mac
->
scheduling_info
.
SR_pending
=
0
;
nr_mac
->
scheduling_info
.
sr_ProhibitTimer
=
0
;
nr_mac
->
scheduling_info
.
sr_ProhibitTimer_Running
=
0
;
nr_mac
->
scheduling_info
.
sr_id
=
-
1
;
// invalid init value
// cancel any triggered Buffer Status Reporting procedure
// Done in default config
nr_mac
->
scheduling_info
.
periodicBSR_SF
=
MAC_UE_BSR_TIMER_NOT_RUNNING
;
nr_mac
->
scheduling_info
.
retxBSR_SF
=
MAC_UE_BSR_TIMER_NOT_RUNNING
;
nr_mac
->
BSR_reporting_active
=
BSR_TRIGGER_NONE
;
// cancel any triggered Power Headroom Reporting procedure
// TODO PHR not implemented yet
...
...
@@ -191,12 +202,22 @@ void reset_mac_inst(NR_UE_MAC_INST_t *nr_mac)
// TODO beam failure procedure not implemented
}
void
release_mac_configuration
(
NR_UE_MAC_INST_t
*
mac
)
void
release_mac_configuration
(
NR_UE_MAC_INST_t
*
mac
,
NR_UE_MAC_reset_cause_t
cause
)
{
asn1cFreeStruc
(
asn_DEF_NR_MIB
,
mac
->
mib
);
asn1cFreeStruc
(
asn_DEF_NR_SI_SchedulingInfo
,
mac
->
si_SchedulingInfo
);
asn1cFreeStruc
(
asn_DEF_NR_TDD_UL_DL_ConfigCommon
,
mac
->
tdd_UL_DL_ConfigurationCommon
);
NR_UE_ServingCell_Info_t
*
sc
=
&
mac
->
sc_info
;
// if cause is Re-establishment, release spCellConfig only
if
(
cause
==
GO_TO_IDLE
)
{
asn1cFreeStruc
(
asn_DEF_NR_MIB
,
mac
->
mib
);
asn1cFreeStruc
(
asn_DEF_NR_SI_SchedulingInfo
,
mac
->
si_SchedulingInfo
);
asn1cFreeStruc
(
asn_DEF_NR_TDD_UL_DL_ConfigCommon
,
mac
->
tdd_UL_DL_ConfigurationCommon
);
for
(
int
i
=
0
;
i
<
mac
->
lc_ordered_list
.
count
;
i
++
)
{
nr_lcordered_info_t
*
lc_info
=
mac
->
lc_ordered_list
.
array
[
i
];
asn_sequence_del
(
&
mac
->
lc_ordered_list
,
i
,
0
);
free
(
lc_info
);
}
}
asn1cFreeStruc
(
asn_DEF_NR_CrossCarrierSchedulingConfig
,
sc
->
crossCarrierSchedulingConfig
);
asn1cFreeStruc
(
asn_DEF_NR_SRS_CarrierSwitching
,
sc
->
carrierSwitching
);
asn1cFreeStruc
(
asn_DEF_NR_UplinkConfig
,
sc
->
supplementaryUplink
);
...
...
@@ -215,17 +236,38 @@ void release_mac_configuration(NR_UE_MAC_INST_t *mac)
mac
->
current_DL_BWP
=
NULL
;
mac
->
current_UL_BWP
=
NULL
;
for
(
int
i
=
0
;
i
<
mac
->
dl_BWPs
.
count
;
i
++
)
// in case of re-establishment we don't need to release initial BWP config common
int
first_bwp_rel
=
0
;
// first BWP to release
if
(
cause
==
RE_ESTABLISHMENT
)
{
first_bwp_rel
=
1
;
// release dedicated BWP0 config
NR_UE_DL_BWP_t
*
bwp
=
mac
->
dl_BWPs
.
array
[
0
];
NR_BWP_PDCCH_t
*
pdcch
=
&
mac
->
config_BWP_PDCCH
[
0
];
for
(
int
i
=
0
;
pdcch
->
list_Coreset
.
count
;
i
++
)
asn_sequence_del
(
&
pdcch
->
list_Coreset
,
i
,
1
);
for
(
int
i
=
0
;
pdcch
->
list_SS
.
count
;
i
++
)
asn_sequence_del
(
&
pdcch
->
list_SS
,
i
,
1
);
asn1cFreeStruc
(
asn_DEF_NR_PDSCH_Config
,
bwp
->
pdsch_Config
);
NR_UE_UL_BWP_t
*
ubwp
=
mac
->
ul_BWPs
.
array
[
0
];
asn1cFreeStruc
(
asn_DEF_NR_PUCCH_Config
,
ubwp
->
pucch_Config
);
asn1cFreeStruc
(
asn_DEF_NR_SRS_Config
,
ubwp
->
srs_Config
);
asn1cFreeStruc
(
asn_DEF_NR_PUSCH_Config
,
ubwp
->
pusch_Config
);
mac
->
current_DL_BWP
=
bwp
;
mac
->
current_UL_BWP
=
ubwp
;
mac
->
sc_info
.
initial_dl_BWPSize
=
bwp
->
BWPSize
;
mac
->
sc_info
.
initial_dl_BWPStart
=
bwp
->
BWPStart
;
mac
->
sc_info
.
initial_ul_BWPSize
=
ubwp
->
BWPSize
;
mac
->
sc_info
.
initial_ul_BWPStart
=
ubwp
->
BWPStart
;
}
for
(
int
i
=
first_bwp_rel
;
i
<
mac
->
dl_BWPs
.
count
;
i
++
)
release_dl_BWP
(
mac
,
i
);
for
(
int
i
=
0
;
i
<
mac
->
ul_BWPs
.
count
;
i
++
)
for
(
int
i
=
first_bwp_rel
;
i
<
mac
->
ul_BWPs
.
count
;
i
++
)
release_ul_BWP
(
mac
,
i
);
for
(
int
i
=
0
;
i
<
mac
->
lc_ordered_list
.
count
;
i
++
)
{
nr_lcordered_info_t
*
lc_info
=
mac
->
lc_ordered_list
.
array
[
i
];
asn_sequence_del
(
&
mac
->
lc_ordered_list
,
i
,
0
);
free
(
lc_info
);
}
memset
(
&
mac
->
ssb_measurements
,
0
,
sizeof
(
mac
->
ssb_measurements
));
memset
(
&
mac
->
csirs_measurements
,
0
,
sizeof
(
mac
->
csirs_measurements
));
memset
(
&
mac
->
ul_time_alignment
,
0
,
sizeof
(
mac
->
ul_time_alignment
));
...
...
openair2/RRC/NR_UE/rrc_UE.c
View file @
1a80393b
...
...
@@ -1221,7 +1221,7 @@ static void nr_rrc_ue_process_RadioBearerConfig(NR_UE_RRC_INST_t *ue_rrc,
for
(
int
cnt
=
0
;
cnt
<
radioBearerConfig
->
drb_ToAddModList
->
list
.
count
;
cnt
++
)
{
struct
NR_DRB_ToAddMod
*
drb
=
radioBearerConfig
->
drb_ToAddModList
->
list
.
array
[
cnt
];
int
DRB_id
=
drb
->
drb_Identity
;
if
(
rrcNB
->
status_DRBs
[
DRB_id
]
==
RB_ESTABLISHED
)
{
if
(
rrcNB
->
status_DRBs
[
DRB_id
-
1
]
==
RB_ESTABLISHED
)
{
AssertFatal
(
drb
->
reestablishPDCP
==
NULL
,
"reestablishPDCP not yet implemented
\n
"
);
AssertFatal
(
drb
->
recoverPDCP
==
NULL
,
"recoverPDCP not yet implemented
\n
"
);
NR_SDAP_Config_t
*
sdap_Config
=
drb
->
cnAssociation
?
drb
->
cnAssociation
->
choice
.
sdap_Config
:
NULL
;
...
...
@@ -1230,7 +1230,7 @@ static void nr_rrc_ue_process_RadioBearerConfig(NR_UE_RRC_INST_t *ue_rrc,
if
(
drb
->
cnAssociation
)
AssertFatal
(
drb
->
cnAssociation
->
choice
.
sdap_Config
==
NULL
,
"SDAP reconfiguration not yet implemented
\n
"
);
}
else
{
rrcNB
->
status_DRBs
[
DRB_id
]
=
RB_ESTABLISHED
;
rrcNB
->
status_DRBs
[
DRB_id
-
1
]
=
RB_ESTABLISHED
;
add_drb
(
false
,
ue_rrc
->
ue_id
,
radioBearerConfig
->
drb_ToAddModList
->
list
.
array
[
cnt
],
...
...
@@ -1593,11 +1593,49 @@ static void nr_rrc_ue_process_ueCapabilityEnquiry(NR_UE_RRC_INST_t *rrc, NR_UECa
}
}
void
nr_rrc_initiate_rrcReestablishment
(
NR_UE_RRC_INST_t
*
rrc
,
const
int
gnb_id
)
{
NR_UE_Timers_Constants_t
*
timers
=
&
rrc
->
timers_and_constants
;
rrcPerNB_t
*
rrcNB
=
rrc
->
perNB
+
gnb_id
;
// reset timers to SIB1 as part of release of spCellConfig
// it needs to be done before handling timers
set_rlf_sib1_timers_and_constants
(
timers
,
rrcNB
->
SInfo
.
sib1
);
// stop timer T310, if running
nr_timer_stop
(
&
timers
->
T310
);
// stop timer T304, if running
nr_timer_stop
(
&
timers
->
T304
);
// start timer T311
nr_timer_start
(
&
timers
->
T311
);
// suspend all RBs, except SRB0
for
(
int
i
=
1
;
i
<
4
;
i
++
)
{
if
(
rrcNB
->
Srb
[
i
]
==
RB_ESTABLISHED
)
{
rrcNB
->
Srb
[
i
]
=
RB_SUSPENDED
;
nr_pdcp_suspend_srb
(
rrc
->
ue_id
,
i
);
}
}
for
(
int
i
=
0
;
i
<
MAX_DRBS_PER_UE
;
i
++
)
{
if
(
rrcNB
->
status_DRBs
[
i
]
==
RB_ESTABLISHED
)
{
rrcNB
->
status_DRBs
[
i
]
=
RB_SUSPENDED
;
nr_pdcp_suspend_drb
(
rrc
->
ue_id
,
i
+
1
);
}
}
// release the MCG SCell(s), if configured
// no SCell configured in our implementation
rrc
->
nrRrcState
=
RRC_STATE_REESTABLISHMENT
;
// reset MAC
// release spCellConfig, if configured
// perform cell selection in accordance with the cell selection process
nr_rrc_mac_config_req_reset
(
rrc
->
ue_id
,
RE_ESTABLISHMENT
);
}
static
void
nr_rrc_ue_generate_rrcReestablishmentComplete
(
NR_RRCReestablishment_t
*
rrcReestablishment
)
//-----------------------------------------------------------------------------
{
uint8_t
buffer
[
RRC_BUFFER_SIZE
]
=
{
0
};
int
size
=
do_RRCReestablishmentComplete
(
buffer
,
RRC_BUFFER_SIZE
,
uint8_t
buffer
[
RRC_BUFFER_SIZE
]
=
{
0
};
int
size
=
do_RRCReestablishmentComplete
(
buffer
,
RRC_BUFFER_SIZE
,
rrcReestablishment
->
rrc_TransactionIdentifier
);
LOG_I
(
NR_RRC
,
"[RAPROC] Logical Channel UL-DCCH (SRB1), Generating RRCReestablishmentComplete (bytes %d)
\n
"
,
size
);
}
...
...
@@ -1865,7 +1903,7 @@ void nr_rrc_going_to_IDLE(NR_UE_RRC_INST_t *rrc,
for
(
int
i
=
0
;
i
<
MAX_DRBS_PER_UE
;
i
++
)
{
if
(
nb
->
status_DRBs
[
i
]
!=
RB_NOT_PRESENT
)
{
nb
->
status_DRBs
[
i
]
=
RB_NOT_PRESENT
;
nr_pdcp_release_drb
(
rrc
->
ue_id
,
i
);
nr_pdcp_release_drb
(
rrc
->
ue_id
,
i
+
1
);
}
}
for
(
int
i
=
1
;
i
<
NR_NUM_SRB
;
i
++
)
{
...
...
openair2/RRC/NR_UE/rrc_defs.h
View file @
1a80393b
...
...
@@ -85,8 +85,7 @@ typedef enum Rrc_State_NR_e {
RRC_STATE_INACTIVE_NR
,
RRC_STATE_CONNECTED_NR
,
RRC_STATE_DETACH_NR
,
RRC_STATE_FIRST_NR
=
RRC_STATE_IDLE_NR
,
RRC_STATE_LAST_NR
=
RRC_STATE_CONNECTED_NR
,
RRC_STATE_REESTABLISHMENT
}
Rrc_State_NR_t
;
typedef
enum
requested_SI_List_e
{
...
...
openair2/RRC/NR_UE/rrc_proto.h
View file @
1a80393b
...
...
@@ -87,6 +87,7 @@ void nr_rrc_going_to_IDLE(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
);
void
set_rlf_sib1_timers_and_constants
(
NR_UE_Timers_Constants_t
*
tac
,
NR_SIB1_t
*
sib1
);
/**\brief RRC UE task.
\param void *args_p Pointer on arguments to start the 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