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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
4e10e4fa
Commit
4e10e4fa
authored
Apr 17, 2024
by
Ejaz Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed MAC subPDU header length issue
parent
63454ceb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
16 deletions
+11
-16
openair2/LAYER2/NR_MAC_COMMON/nr_mac.h
openair2/LAYER2/NR_MAC_COMMON/nr_mac.h
+4
-12
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures_sl.c
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures_sl.c
+6
-3
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
+1
-1
No files found.
openair2/LAYER2/NR_MAC_COMMON/nr_mac.h
View file @
4e10e4fa
...
...
@@ -123,27 +123,19 @@ typedef struct {
}
__attribute__
((
__packed__
))
NR_SLSCH_MAC_SUBHEADER_FIXED
;
static
inline
int
get_mac_len
(
uint8_t
*
pdu
,
int
pdu_len
,
uint16_t
*
mac_ce_len
,
uint16_t
*
mac_subheader_len
)
{
uint8_t
sl_sch_header_len
=
(
int
)
sizeof
(
NR_SLSCH_MAC_SUBHEADER_FIXED
);
if
(
pdu_len
<
sl_sch_header_len
)
return
false
;
NR_SLSCH_MAC_SUBHEADER_FIXED
*
sl_sch_subheader
=
(
NR_SLSCH_MAC_SUBHEADER_FIXED
*
)
pdu
;
pdu
+=
sl_sch_header_len
;
if
(
pdu_len
<
sl_sch_header_len
+
(
int
)
sizeof
(
NR_MAC_SUBHEADER_SHORT
))
if
(
pdu_len
<
(
int
)
sizeof
(
NR_MAC_SUBHEADER_SHORT
))
return
false
;
NR_MAC_SUBHEADER_SHORT
*
s
=
(
NR_MAC_SUBHEADER_SHORT
*
)
pdu
;
NR_MAC_SUBHEADER_LONG
*
l
=
(
NR_MAC_SUBHEADER_LONG
*
)
pdu
;
if
(
s
->
F
&&
pdu_len
<
sl_sch_header_len
+
(
int
)
sizeof
(
NR_MAC_SUBHEADER_LONG
))
if
(
s
->
F
&&
pdu_len
<
(
int
)
sizeof
(
NR_MAC_SUBHEADER_LONG
))
return
false
;
if
(
s
->
F
)
{
*
mac_subheader_len
=
sizeof
(
*
l
)
+
sizeof
(
*
sl_sch_subheader
)
;
*
mac_subheader_len
=
sizeof
(
*
l
);
*
mac_ce_len
=
ntohs
(
l
->
L
);
}
else
{
*
mac_subheader_len
=
sizeof
(
*
s
)
+
sizeof
(
*
sl_sch_subheader
)
;
*
mac_subheader_len
=
sizeof
(
*
s
);
*
mac_ce_len
=
s
->
L
;
}
LOG_D
(
NR_MAC
,
"V %hhu, SRC %hu, DST %hhu
\n
"
,
sl_sch_subheader
->
V
,
sl_sch_subheader
->
SRC
,
sl_sch_subheader
->
DST
);
LOG_D
(
NR_MAC
,
"R %hhu, F %hhu, LCID %hhu, L %hu
\n
"
,
l
->
R
,
l
->
F
,
l
->
LCID
,
ntohs
(
l
->
L
));
LOG_D
(
NR_MAC
,
"mac_subheader_len %hu, mac_ce_len %hu
\n
"
,
*
mac_subheader_len
,
*
mac_ce_len
);
return
true
;
}
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures_sl.c
View file @
4e10e4fa
...
...
@@ -746,11 +746,14 @@ void nr_ue_process_mac_sl_pdu(int module_idP,
return
;
LOG_D
(
NR_MAC
,
"In %s : processing PDU %d (with length %d) of %d total number of PDUs...
\n
"
,
__FUNCTION__
,
pdu_id
,
pdu_len
,
rx_ind
->
number_pdus
);
while
(
!
done
&&
pdu_len
>
0
){
NR_SLSCH_MAC_SUBHEADER_FIXED
*
sl_sch_subheader
=
(
NR_SLSCH_MAC_SUBHEADER_FIXED
*
)
pduP
;
LOG_D
(
NR_PHY
,
"Rx V %d R %d SRC %d DST %d
\n
"
,
sl_sch_subheader
->
V
,
sl_sch_subheader
->
R
,
sl_sch_subheader
->
SRC
,
sl_sch_subheader
->
DST
);
pduP
+=
sizeof
(
*
sl_sch_subheader
);
pdu_len
-=
sizeof
(
*
sl_sch_subheader
);
while
(
!
done
&&
pdu_len
>
0
)
{
uint16_t
mac_len
=
0x0000
;
uint16_t
mac_subheader_len
=
0x0001
;
// default to fixed-length subheader = 1-oct
uint8_t
rx_lcid
=
((
NR_MAC_SUBHEADER_LONG
*
)(
pduP
+
sizeof
(
NR_SLSCH_MAC_SUBHEADER_FIXED
)
))
->
LCID
;
uint8_t
rx_lcid
=
((
NR_MAC_SUBHEADER_LONG
*
)(
pduP
))
->
LCID
;
LOG_D
(
NR_MAC
,
"[UE %x] LCID %d, PDU length %d
\n
"
,
mac
->
src_id
,
rx_lcid
,
pdu_len
);
switch
(
rx_lcid
){
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
View file @
4e10e4fa
...
...
@@ -3384,7 +3384,7 @@ bool nr_ue_sl_pssch_scheduler(NR_UE_MAC_INST_t *mac,
//nr_ue_get_sdu_mac_ce_pre updates all mac_ce related header field related to length
mac_ce_p
->
tot_mac_ce_len
=
nr_ue_get_sdu_mac_ce_pre
(
0
,
0
,
frame
,
slot
,
0
,
pdu
,
buflen
,
mac_ce_p
);
buflen_remain
-=
mac_ce_p
->
tot_mac_ce_len
;
pdu
+=
mac_ce_p
->
tot_mac_ce_len
;
LOG_D
(
NR_PHY
,
"buflen_remain %d, total_mac_pdu_header_len %d, adding tot_mac_ce_len %d,
\n
"
,
buflen_remain
,
mac_ce_p
->
total_mac_pdu_header_len
,
mac_ce_p
->
tot_mac_ce_len
);
}
...
...
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