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
03439f9d
Commit
03439f9d
authored
Feb 02, 2024
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code cleanup
parent
513f060f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
60 deletions
+10
-60
openair2/LAYER2/NR_MAC_UE/mac_defs.h
openair2/LAYER2/NR_MAC_UE/mac_defs.h
+0
-4
openair2/LAYER2/NR_MAC_UE/mac_proto.h
openair2/LAYER2/NR_MAC_UE/mac_proto.h
+1
-5
openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c
+7
-49
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+2
-2
No files found.
openair2/LAYER2/NR_MAC_UE/mac_defs.h
View file @
03439f9d
...
...
@@ -480,10 +480,6 @@ typedef struct NR_UE_MAC_INST_s {
bool
phy_config_request_sent
;
frame_type_t
frame_type
;
/* PDUs */
/// Outgoing CCCH pdu for PHY
CCCH_PDU
CCCH_pdu
;
/* Random Access */
/// CRNTI
uint16_t
crnti
;
...
...
openair2/LAYER2/NR_MAC_UE/mac_proto.h
View file @
03439f9d
...
...
@@ -428,11 +428,7 @@ andom-access to transmit a BSR along with the C-RNTI control element (see 5.1.4
@param gNB_id gNB index
@param nr_slot_tx slot for PRACH transmission
@returns indication to generate PRACH to phy */
uint8_t
nr_ue_get_rach
(
module_id_t
mod_id
,
int
CC_id
,
frame_t
frame
,
uint8_t
gNB_id
,
int
nr_slot_tx
);
void
nr_ue_get_rach
(
module_id_t
mod_id
,
int
CC_id
,
frame_t
frame
,
uint8_t
gNB_id
,
int
nr_slot_tx
);
/* \brief Function implementing the routine for the selection of Random Access resources (5.1.2 TS 38.321).
@param module_idP Index of UE instance
...
...
openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c
View file @
03439f9d
...
...
@@ -659,11 +659,7 @@ void nr_get_msg3_payload(module_id_t mod_id, uint8_t *buf, int TBS_max)
* @gNB_id gNB ID
* @nr_slot_tx current UL TX slot
*/
uint8_t
nr_ue_get_rach
(
module_id_t
mod_id
,
int
CC_id
,
frame_t
frame
,
uint8_t
gNB_id
,
int
nr_slot_tx
)
void
nr_ue_get_rach
(
module_id_t
mod_id
,
int
CC_id
,
frame_t
frame
,
uint8_t
gNB_id
,
int
nr_slot_tx
)
{
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
mod_id
);
RA_config_t
*
ra
=
&
mac
->
ra
;
...
...
@@ -677,17 +673,11 @@ uint8_t nr_ue_get_rach(module_id_t mod_id,
ra
->
ra_state
=
GENERATE_PREAMBLE
;
}
else
{
LOG_D
(
NR_MAC
,
"PRACH Condition not met: ra state %d, frame %d, sync_frame %d
\n
"
,
ra
->
ra_state
,
frame
,
mac
->
first_sync_frame
);
return
0
;
return
;
}
}
LOG_D
(
NR_MAC
,
"In %s: [UE %d][%d.%d]: ra_state %d, RA_active %d
\n
"
,
__FUNCTION__
,
mod_id
,
frame
,
nr_slot_tx
,
ra
->
ra_state
,
ra
->
RA_active
);
LOG_D
(
NR_MAC
,
"[UE %d][%d.%d]: ra_state %d, RA_active %d
\n
"
,
mod_id
,
frame
,
nr_slot_tx
,
ra
->
ra_state
,
ra
->
RA_active
);
if
(
ra
->
ra_state
>
RA_UE_IDLE
&&
ra
->
ra_state
<
RA_SUCCEEDED
)
{
...
...
@@ -696,13 +686,9 @@ uint8_t nr_ue_get_rach(module_id_t mod_id,
NR_RACH_ConfigGeneric_t
*
rach_ConfigGeneric
=
&
setup
->
rach_ConfigGeneric
;
init_RA
(
mod_id
,
&
ra
->
prach_resources
,
setup
,
rach_ConfigGeneric
,
ra
->
rach_ConfigDedicated
);
LOG_D
(
NR_MAC
,
"In %s: RA not active. Checking for data to transmit from upper layers...
\n
"
,
__FUNCTION__
);
const
uint8_t
TBS_max
=
8
+
sizeof
(
NR_MAC_SUBHEADER_SHORT
)
+
sizeof
(
NR_MAC_SUBHEADER_SHORT
);
// Note: unclear the reason behind the selection of such TBS_max
// TODO this piece of code is required to compute MSG3_size that is used by ra_preambles_config function
// Not a good implementation, it needs improvements
int
size_sdu
=
0
;
uint8_t
mac_ce
[
16
]
=
{
0
};
uint8_t
*
pdu
=
get_softmodem_params
()
->
sa
?
mac
->
CCCH_pdu
.
payload
:
mac_ce
;
const
uint8_t
*
payload
=
pdu
;
// Concerning the C-RNTI MAC CE, it has to be included if the UL transmission (Msg3) is not being made for the CCCH logical channel.
// Therefore it has been assumed that this event only occurs only when RA is done and it is not SA mode.
...
...
@@ -729,35 +715,9 @@ uint8_t nr_ue_get_rach(module_id_t mod_id,
}
}
else
if
(
!
get_softmodem_params
()
->
sa
)
{
size_sdu
=
nr_write_ce_ulsch_pdu
(
pdu
,
mac
,
0
,
&
(
mac
->
crnti
),
NULL
,
NULL
,
NULL
);
pdu
+=
size_sdu
;
uint8_t
temp_pdu
[
16
]
=
{
0
};
size_sdu
=
nr_write_ce_ulsch_pdu
(
temp_pdu
,
mac
,
0
,
&
(
mac
->
crnti
),
NULL
,
NULL
,
NULL
);
ra
->
Msg3_size
=
size_sdu
;
}
if
(
size_sdu
>
0
&&
(
ra
->
ra_state
==
GENERATE_PREAMBLE
||
get_softmodem_params
()
->
nsa
))
{
LOG_D
(
NR_MAC
,
"[UE %d][%d.%d]: starting initialisation Random Access Procedure...
\n
"
,
mod_id
,
frame
,
nr_slot_tx
);
// Padding: fill remainder with 0
if
(
TBS_max
-
ra
->
Msg3_size
>
0
)
{
AssertFatal
(
TBS_max
>
ra
->
Msg3_size
,
"In %s: allocated resources are not enough for Msg3!
\n
"
,
__FUNCTION__
);
LOG_D
(
NR_MAC
,
"Remaining %d bytes, filling with padding
\n
"
,
TBS_max
-
ra
->
Msg3_size
);
((
NR_MAC_SUBHEADER_FIXED
*
)
pdu
)
->
R
=
0
;
((
NR_MAC_SUBHEADER_FIXED
*
)
pdu
)
->
LCID
=
UL_SCH_LCID_PADDING
;
pdu
+=
sizeof
(
NR_MAC_SUBHEADER_FIXED
);
memset
(
pdu
,
0
,
TBS_max
-
ra
->
Msg3_size
-
sizeof
(
NR_MAC_SUBHEADER_FIXED
));
}
// Dumping ULSCH payload
LOG_D
(
NR_MAC
,
"Dumping UL Msg3 MAC PDU with length %d:
\n
"
,
TBS_max
);
for
(
int
k
=
0
;
k
<
TBS_max
;
k
++
)
{
LOG_D
(
NR_MAC
,
"(%i): %i
\n
"
,
k
,
payload
[
k
]);
}
}
else
{
return
0
;
}
}
else
if
(
ra
->
RA_window_cnt
!=
-
1
)
{
// RACH is active
...
...
@@ -807,8 +767,6 @@ uint8_t nr_ue_get_rach(module_id_t mod_id,
if
(
ra
->
RA_contention_resolution_timer_active
)
{
nr_ue_contention_resolution
(
mod_id
,
CC_id
,
frame
,
nr_slot_tx
,
prach_resources
);
}
return
ra
->
ra_state
;
}
void
nr_get_RA_window
(
NR_UE_MAC_INST_t
*
mac
)
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
View file @
03439f9d
...
...
@@ -3779,8 +3779,8 @@ int nr_write_ce_ulsch_pdu(uint8_t *mac_ce,
uint16_t
*
crnti
,
NR_BSR_SHORT
*
truncated_bsr
,
NR_BSR_SHORT
*
short_bsr
,
NR_BSR_LONG
*
long_bsr
)
{
NR_BSR_LONG
*
long_bsr
)
{
int
mac_ce_len
=
0
;
uint8_t
mac_ce_size
=
0
;
uint8_t
*
pdu
=
mac_ce
;
...
...
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