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
4b019293
Commit
4b019293
authored
Jun 12, 2023
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reset MAC
parent
b2c5f4bc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
4 deletions
+56
-4
openair2/LAYER2/NR_MAC_UE/mac_proto.h
openair2/LAYER2/NR_MAC_UE/mac_proto.h
+2
-0
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
+53
-1
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+1
-0
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
+0
-3
No files found.
openair2/LAYER2/NR_MAC_UE/mac_proto.h
View file @
4b019293
...
...
@@ -175,6 +175,8 @@ NR_UE_MAC_INST_t * nr_l2_init_ue();
\param module_id index of MAC instance(s)*/
NR_UE_MAC_INST_t
*
get_mac_inst
(
module_id_t
module_id
);
void
reset_mac_inst
(
NR_UE_MAC_INST_t
*
nr_mac
);
/**\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.
\param dl_info DL indication
...
...
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
View file @
4b019293
...
...
@@ -78,6 +78,58 @@ NR_UE_MAC_INST_t * nr_l2_init_ue()
return
(
nr_ue_mac_inst
);
}
NR_UE_MAC_INST_t
*
get_mac_inst
(
module_id_t
module_id
){
NR_UE_MAC_INST_t
*
get_mac_inst
(
module_id_t
module_id
)
{
return
&
nr_ue_mac_inst
[(
int
)
module_id
];
}
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
// Done in default config but to -1 (is that correct?)
// stop all running timers
// TODO
// consider all timeAlignmentTimers as expired and perform the corresponding actions in clause 5.2
// TODO
// set the NDIs for all uplink HARQ processes to the value 0
for
(
int
k
=
0
;
k
<
NR_MAX_HARQ_PROCESSES
;
k
++
)
nr_mac
->
UL_ndi
[
k
]
=
-
1
;
// initialize to invalid value
// stop any ongoing RACH procedure
if
(
nr_mac
->
ra
.
ra_state
<
RA_SUCCEEDED
)
nr_mac
->
ra
.
ra_state
=
RA_UE_IDLE
;
// discard explicitly signalled contention-free Random Access Resources
// TODO not sure what needs to be done here
// flush Msg3 buffer
// TODO we don't have a Msg3 buffer
// cancel any triggered Scheduling Request procedure
// Done in default config
// cancel any triggered Buffer Status Reporting procedure
// Done in default config
// cancel any triggered Power Headroom Reporting procedure
// TODO PHR not implemented yet
// flush the soft buffers for all DL HARQ processes
for
(
int
k
=
0
;
k
<
NR_MAX_HARQ_PROCESSES
;
k
++
)
memset
(
&
nr_mac
->
dl_harq_info
[
k
],
0
,
sizeof
(
NR_UE_HARQ_STATUS_t
));
// for each DL HARQ process, consider the next received transmission for a TB as the very first transmission
// TODO there is nothing in the MAC indicating first transmission
// release, if any, Temporary C-RNTI
nr_mac
->
ra
.
t_crnti
=
0
;
// reset BFI_COUNTER
// TODO beam failure procedure not implemented
}
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
View file @
4b019293
...
...
@@ -179,6 +179,7 @@ void nr_ue_mac_default_configs(NR_UE_MAC_INST_t *mac)
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
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
View file @
4b019293
...
...
@@ -1043,16 +1043,13 @@ void nr_ue_ul_scheduler(nr_uplink_indication_t *ul_info)
}
mac_pdu_exist
=
1
;
}
else
{
if
(
ulcfg_pdu
->
pusch_config_pdu
.
pusch_data
.
new_data_indicator
&&
(
mac
->
state
==
UE_CONNECTED
||
(
ra
->
ra_state
==
WAIT_RAR
&&
ra
->
cfra
))){
// Getting IP traffic to be transmitted
nr_ue_get_sdu
(
mod_id
,
cc_id
,
frame_tx
,
slot_tx
,
gNB_index
,
ulsch_input_buffer
,
TBS_bytes
);
mac_pdu_exist
=
1
;
}
}
// Config UL TX PDU
...
...
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