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
6b123ff2
Commit
6b123ff2
authored
Feb 02, 2024
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
store MSG3 buffer at UE MAC
parent
03439f9d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
12 deletions
+21
-12
openair2/LAYER2/NR_MAC_UE/mac_defs.h
openair2/LAYER2/NR_MAC_UE/mac_defs.h
+3
-1
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
+1
-1
openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c
+15
-8
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
+2
-2
No files found.
openair2/LAYER2/NR_MAC_UE/mac_defs.h
View file @
6b123ff2
...
@@ -317,9 +317,11 @@ typedef struct {
...
@@ -317,9 +317,11 @@ typedef struct {
/// Received TPC command (in dB) from RAR
/// Received TPC command (in dB) from RAR
int8_t
Msg3_TPC
;
int8_t
Msg3_TPC
;
/// Flag to indicate whether it is the first Msg3 to be transmitted
/// Flag to indicate whether it is the first Msg3 to be transmitted
uint8_t
first_Msg3
;
bool
first_Msg3
;
/// RA Msg3 size in bytes
/// RA Msg3 size in bytes
uint8_t
Msg3_size
;
uint8_t
Msg3_size
;
/// Msg3 buffer
uint8_t
*
Msg3_buffer
;
/// Random-access Contention Resolution Timer active flag
/// Random-access Contention Resolution Timer active flag
uint8_t
RA_contention_resolution_timer_active
;
uint8_t
RA_contention_resolution_timer_active
;
...
...
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
View file @
6b123ff2
...
@@ -163,7 +163,7 @@ void reset_mac_inst(NR_UE_MAC_INST_t *nr_mac)
...
@@ -163,7 +163,7 @@ void reset_mac_inst(NR_UE_MAC_INST_t *nr_mac)
// TODO not sure what needs to be done here
// TODO not sure what needs to be done here
// flush Msg3 buffer
// flush Msg3 buffer
// TODO we don't have a Msg3 buffer
free_and_zero
(
nr_mac
->
ra
.
Msg3_buffer
);
// cancel any triggered Scheduling Request procedure
// cancel any triggered Scheduling Request procedure
// Done in default config
// Done in default config
...
...
openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c
View file @
6b123ff2
...
@@ -69,7 +69,7 @@ void init_RA(module_id_t mod_id,
...
@@ -69,7 +69,7 @@ void init_RA(module_id_t mod_id,
ra
->
RA_usedGroupA
=
1
;
ra
->
RA_usedGroupA
=
1
;
ra
->
RA_RAPID_found
=
0
;
ra
->
RA_RAPID_found
=
0
;
ra
->
preambleTransMax
=
0
;
ra
->
preambleTransMax
=
0
;
ra
->
first_Msg3
=
1
;
ra
->
first_Msg3
=
true
;
ra
->
starting_preamble_nb
=
0
;
ra
->
starting_preamble_nb
=
0
;
ra
->
RA_backoff_cnt
=
0
;
ra
->
RA_backoff_cnt
=
0
;
ra
->
RA_window_cnt
=
-
1
;
ra
->
RA_window_cnt
=
-
1
;
...
@@ -555,7 +555,7 @@ void nr_get_prach_resources(module_id_t mod_id,
...
@@ -555,7 +555,7 @@ void nr_get_prach_resources(module_id_t mod_id,
NR_RACH_ConfigCommon_t
*
nr_rach_ConfigCommon
=
mac
->
current_UL_BWP
->
rach_ConfigCommon
;
NR_RACH_ConfigCommon_t
*
nr_rach_ConfigCommon
=
mac
->
current_UL_BWP
->
rach_ConfigCommon
;
LOG_D
(
MAC
,
"
In %s: getting PRACH resources frame (first_Msg3 %d)
\n
"
,
__FUNCTION__
,
ra
->
first_Msg3
);
LOG_D
(
MAC
,
"
Getting PRACH resources frame (first_Msg3 %d)
\n
"
,
ra
->
first_Msg3
);
if
(
rach_ConfigDedicated
)
{
if
(
rach_ConfigDedicated
)
{
if
(
rach_ConfigDedicated
->
cfra
){
if
(
rach_ConfigDedicated
->
cfra
){
...
@@ -612,13 +612,17 @@ void nr_get_msg3_payload(module_id_t mod_id, uint8_t *buf, int TBS_max)
...
@@ -612,13 +612,17 @@ void nr_get_msg3_payload(module_id_t mod_id, uint8_t *buf, int TBS_max)
{
{
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
mod_id
);
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
mod_id
);
RA_config_t
*
ra
=
&
mac
->
ra
;
RA_config_t
*
ra
=
&
mac
->
ra
;
// we already stored MSG3 in the buffer, we can use that
if
(
ra
->
Msg3_buffer
)
{
buf
=
ra
->
Msg3_buffer
;
return
;
}
uint8_t
*
pdu
=
buf
;
uint8_t
*
pdu
=
buf
;
*
(
NR_MAC_SUBHEADER_FIXED
*
)
pdu
=
(
NR_MAC_SUBHEADER_FIXED
){.
LCID
=
UL_SCH_LCID_CCCH
};
*
(
NR_MAC_SUBHEADER_FIXED
*
)
pdu
=
(
NR_MAC_SUBHEADER_FIXED
){.
LCID
=
UL_SCH_LCID_CCCH
};
pdu
+=
sizeof
(
NR_MAC_SUBHEADER_FIXED
);
pdu
+=
sizeof
(
NR_MAC_SUBHEADER_FIXED
);
// here a big race condition: nothing ensure RRC thread has already pushed data to rlc
// there is no issue inside RLC,
// if RRC has called nr_rlc_srb_recv_sdu(),
// we are good even if the name is misleading (we send a ssrb msg, not receive if)
tbs_size_t
len
=
mac_rlc_data_req
(
mod_id
,
tbs_size_t
len
=
mac_rlc_data_req
(
mod_id
,
mac
->
ue_id
,
mac
->
ue_id
,
0
,
0
,
...
@@ -644,6 +648,8 @@ void nr_get_msg3_payload(module_id_t mod_id, uint8_t *buf, int TBS_max)
...
@@ -644,6 +648,8 @@ void nr_get_msg3_payload(module_id_t mod_id, uint8_t *buf, int TBS_max)
*
(
NR_MAC_SUBHEADER_FIXED
*
)
pdu
=
(
NR_MAC_SUBHEADER_FIXED
){.
LCID
=
UL_SCH_LCID_PADDING
};
*
(
NR_MAC_SUBHEADER_FIXED
*
)
pdu
=
(
NR_MAC_SUBHEADER_FIXED
){.
LCID
=
UL_SCH_LCID_PADDING
};
pdu
+=
sizeof
(
NR_MAC_SUBHEADER_FIXED
);
pdu
+=
sizeof
(
NR_MAC_SUBHEADER_FIXED
);
}
}
ra
->
Msg3_buffer
=
calloc
(
TBS_max
,
sizeof
(
uint8_t
));
memcpy
(
ra
->
Msg3_buffer
,
buf
,
sizeof
(
uint8_t
)
*
TBS_max
);
}
}
/**
/**
...
@@ -851,13 +857,14 @@ void nr_ra_succeeded(const module_id_t mod_id, const uint8_t gNB_index, const fr
...
@@ -851,13 +857,14 @@ void nr_ra_succeeded(const module_id_t mod_id, const uint8_t gNB_index, const fr
ra
->
RA_contention_resolution_timer_active
=
0
;
ra
->
RA_contention_resolution_timer_active
=
0
;
mac
->
crnti
=
ra
->
t_crnti
;
mac
->
crnti
=
ra
->
t_crnti
;
ra
->
t_crnti
=
0
;
ra
->
t_crnti
=
0
;
LOG_D
(
MAC
,
"
In %s: [UE %d][%d.%d] CB-RA: cleared contention resolution timer...
\n
"
,
__FUNCTION__
,
mod_id
,
frame
,
slot
);
LOG_D
(
MAC
,
"
[UE %d][%d.%d] CB-RA: cleared contention resolution timer...
\n
"
,
mod_id
,
frame
,
slot
);
}
}
LOG_D
(
MAC
,
"In %s: [UE %d] clearing RA_active flag...
\n
"
,
__FUNCTION__
,
mod_id
);
LOG_D
(
MAC
,
"In %s: [UE %d] clearing RA_active flag...
\n
"
,
__FUNCTION__
,
mod_id
);
ra
->
RA_active
=
0
;
ra
->
RA_active
=
0
;
ra
->
ra_state
=
RA_SUCCEEDED
;
ra
->
ra_state
=
RA_SUCCEEDED
;
mac
->
state
=
UE_CONNECTED
;
mac
->
state
=
UE_CONNECTED
;
free_and_zero
(
ra
->
Msg3_buffer
);
nr_mac_rrc_ra_ind
(
mod_id
,
frame
,
true
);
nr_mac_rrc_ra_ind
(
mod_id
,
frame
,
true
);
}
}
...
@@ -880,7 +887,7 @@ void nr_ra_failed(uint8_t mod_id, uint8_t CC_id, NR_PRACH_RESOURCES_t *prach_res
...
@@ -880,7 +887,7 @@ void nr_ra_failed(uint8_t mod_id, uint8_t CC_id, NR_PRACH_RESOURCES_t *prach_res
seed
=
(
unsigned
int
)
(
rdtsc_oai
()
&
~
0
);
seed
=
(
unsigned
int
)
(
rdtsc_oai
()
&
~
0
);
}
}
ra
->
first_Msg3
=
1
;
ra
->
first_Msg3
=
true
;
ra
->
ra_PreambleIndex
=
-
1
;
ra
->
ra_PreambleIndex
=
-
1
;
ra
->
ra_state
=
RA_UE_IDLE
;
ra
->
ra_state
=
RA_UE_IDLE
;
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
View file @
6b123ff2
...
@@ -1283,8 +1283,8 @@ bool nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t
...
@@ -1283,8 +1283,8 @@ bool nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t
return
bsr_regular_triggered
;
return
bsr_regular_triggered
;
}
}
uint8_t
uint8_t
nr_locate_BsrIndexByBufferSize
(
const
uint32_t
*
table
,
int
size
,
int
value
)
nr_locate_BsrIndexByBufferSize
(
const
uint32_t
*
table
,
int
size
,
int
value
)
{
{
uint8_t
ju
,
jm
,
jl
;
uint8_t
ju
,
jm
,
jl
;
int
ascend
;
int
ascend
;
//DevAssert(size > 0);
//DevAssert(size > 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