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
spbro
OpenXG-RAN
Commits
1a2ae185
Commit
1a2ae185
authored
Jul 13, 2024
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/Fix_RX_DATA_PDUSize' into integration_2024_w28
parents
38284919
f58765d0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
41 deletions
+45
-41
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
+19
-22
openair2/LAYER2/NR_MAC_COMMON/nr_mac.h
openair2/LAYER2/NR_MAC_COMMON/nr_mac.h
+7
-6
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+18
-12
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+1
-1
No files found.
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
View file @
1a2ae185
...
...
@@ -3177,18 +3177,16 @@ uint8_t pack_nr_slot_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *
static
uint8_t
pack_nr_rx_data_indication_body
(
nfapi_nr_rx_data_pdu_t
*
value
,
uint8_t
**
ppWritePackedMsg
,
uint8_t
*
end
)
{
AssertFatal
(
value
->
pdu_length
<=
0xFFFF
,
"RX_DATA.indication PDU_Length should be within 16 bit, according to SCF222.10.02"
);
if
(
!
(
push32
(
value
->
handle
,
ppWritePackedMsg
,
end
)
&&
push16
(
value
->
rnti
,
ppWritePackedMsg
,
end
)
&&
push8
(
value
->
harq_id
,
ppWritePackedMsg
,
end
)
&&
push16
(
value
->
pdu_length
,
ppWritePackedMsg
,
end
)
&&
push8
(
value
->
ul_cqi
,
ppWritePackedMsg
,
end
)
&&
push16
(
value
->
timing_advance
,
ppWritePackedMsg
,
end
)
&&
push16
(
value
->
rssi
,
ppWritePackedMsg
,
end
)
))
if
(
!
(
push32
(
value
->
handle
,
ppWritePackedMsg
,
end
)
&&
push16
(
value
->
rnti
,
ppWritePackedMsg
,
end
)
&&
push8
(
value
->
harq_id
,
ppWritePackedMsg
,
end
)
&&
push32
(
value
->
pdu_length
,
ppWritePackedMsg
,
end
)
&&
push8
(
value
->
ul_cqi
,
ppWritePackedMsg
,
end
)
&&
push16
(
value
->
timing_advance
,
ppWritePackedMsg
,
end
)
&&
push16
(
value
->
rssi
,
ppWritePackedMsg
,
end
)))
return
0
;
if
(
pusharray8
(
value
->
pdu
,
value
->
pdu_length
,
value
->
pdu_length
,
ppWritePackedMsg
,
end
)
==
0
)
if
(
pusharray8
(
value
->
pdu
,
value
->
pdu_length
,
value
->
pdu_length
,
ppWritePackedMsg
,
end
)
==
0
)
return
0
;
return
1
;
...
...
@@ -6066,19 +6064,18 @@ static uint8_t unpack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t *value,
uint8_t
*
end
,
nfapi_p7_codec_config_t
*
config
)
{
if
(
!
(
pull32
(
ppReadPackedMsg
,
&
value
->
handle
,
end
)
&&
pull16
(
ppReadPackedMsg
,
&
value
->
rnti
,
end
)
&&
pull8
(
ppReadPackedMsg
,
&
value
->
harq_id
,
end
)
&&
pull16
(
ppReadPackedMsg
,
(
uint16_t
*
)
&
value
->
pdu_length
,
end
)
&&
pull8
(
ppReadPackedMsg
,
&
value
->
ul_cqi
,
end
)
&&
pull16
(
ppReadPackedMsg
,
&
value
->
timing_advance
,
end
)
&&
pull16
(
ppReadPackedMsg
,
&
value
->
rssi
,
end
)))
return
0
;
if
(
!
(
pull32
(
ppReadPackedMsg
,
&
value
->
handle
,
end
)
&&
pull16
(
ppReadPackedMsg
,
&
value
->
rnti
,
end
)
&&
pull8
(
ppReadPackedMsg
,
&
value
->
harq_id
,
end
)
&&
pull32
(
ppReadPackedMsg
,
&
value
->
pdu_length
,
end
)
&&
pull8
(
ppReadPackedMsg
,
&
value
->
ul_cqi
,
end
)
&&
pull16
(
ppReadPackedMsg
,
&
value
->
timing_advance
,
end
)
&&
pull16
(
ppReadPackedMsg
,
&
value
->
rssi
,
end
)))
return
0
;
uint32_t
length
=
value
->
pdu_length
;
value
->
pdu
=
nfapi_p7_allocate
(
sizeof
(
*
value
->
pdu
)
*
length
,
config
);
if
(
pullarray8
(
ppReadPackedMsg
,
value
->
pdu
,
length
,
length
,
end
)
==
0
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"%s pullarray8 failure
\n
"
,
__FUNCTION__
);
return
0
;
}
return
1
;
value
->
pdu
=
nfapi_p7_allocate
(
sizeof
(
*
value
->
pdu
)
*
value
->
pdu_length
,
config
);
if
(
pullarray8
(
ppReadPackedMsg
,
value
->
pdu
,
value
->
pdu_length
,
value
->
pdu_length
,
end
)
==
0
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"%s pullarray8 failure
\n
"
,
__FUNCTION__
);
return
0
;
}
return
1
;
}
static
uint8_t
unpack_nr_rx_data_indication
(
uint8_t
**
ppReadPackedMsg
,
uint8_t
*
end
,
nfapi_nr_rx_data_indication_t
*
msg
,
nfapi_p7_codec_config_t
*
config
)
...
...
openair2/LAYER2/NR_MAC_COMMON/nr_mac.h
View file @
1a2ae185
...
...
@@ -107,12 +107,13 @@ typedef struct {
uint8_t
R
:
2
;
// octet 1 [7:6]
}
__attribute__
((
__packed__
))
NR_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
)
{
if
(
pdu_len
<
(
int
)
sizeof
(
NR_MAC_SUBHEADER_SHORT
))
static
inline
int
get_mac_len
(
uint8_t
*
pdu
,
uint32_t
pdu_len
,
uint16_t
*
mac_ce_len
,
uint16_t
*
mac_subheader_len
)
{
if
(
pdu_len
<
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
<
(
int
)
sizeof
(
NR_MAC_SUBHEADER_LONG
))
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
<
sizeof
(
NR_MAC_SUBHEADER_LONG
))
return
false
;
if
(
s
->
F
)
{
*
mac_subheader_len
=
sizeof
(
*
l
);
...
...
@@ -123,7 +124,7 @@ static inline int get_mac_len(uint8_t* pdu, int pdu_len, uint16_t *mac_ce_len, u
}
return
true
;
}
// BSR MAC CEs
// TS 38.321 ch. 6.1.3.1
// Short BSR for a specific logical channel group ID
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
View file @
1a2ae185
...
...
@@ -40,7 +40,7 @@
//#define SRS_IND_DEBUG
static
rnti_t
lcid_crnti_lookahead
(
uint8_t
*
pdu
,
in
t
pdu_len
)
static
rnti_t
lcid_crnti_lookahead
(
uint8_t
*
pdu
,
uint32_
t
pdu_len
)
{
uint16_t
mac_len
=
0
;
uint16_t
mac_subheader_len
=
0
;
...
...
@@ -55,7 +55,13 @@ static rnti_t lcid_crnti_lookahead(uint8_t *pdu, int pdu_len)
break
;
}
pdu
+=
mac_len
+
mac_subheader_len
;
pdu_len
-=
mac_len
+
mac_subheader_len
;
// if pdu_len can have the value subtracted without underflow, we can subtract
if
(
pdu_len
>=
mac_len
+
mac_subheader_len
)
{
pdu_len
-=
mac_len
+
mac_subheader_len
;
}
else
{
// if not, set to 0 to prevent underflow
pdu_len
=
0
;
}
}
return
0
;
}
...
...
@@ -200,7 +206,7 @@ static int nr_process_mac_pdu(instance_t module_idP,
frame_t
frameP
,
sub_frame_t
slot
,
uint8_t
*
pduP
,
in
t
pdu_len
,
uint32_
t
pdu_len
,
const
int8_t
harq_pid
)
{
...
...
@@ -644,7 +650,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
const
sub_frame_t
slotP
,
const
rnti_t
rntiP
,
uint8_t
*
sduP
,
const
uint
16
_t
sdu_lenP
,
const
uint
32
_t
sdu_lenP
,
const
uint16_t
timing_advance
,
const
uint8_t
ul_cqi
,
const
uint16_t
rssi
)
...
...
@@ -725,10 +731,10 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
LOG_I
(
NR_MAC
,
"Printing received UL MAC payload at gNB side: %d
\n
"
);
for
(
int
i
=
0
;
i
<
sdu_lenP
;
i
++
)
{
//harq_process_ul_ue->a[i] = (unsigned char) rand();
//printf("a[%d]=0x%02x\n",i,harq_process_ul_ue->a[i]);
printf
(
"%02x "
,(
unsigned
char
)
sduP
[
i
]);
for
(
uint32_t
i
=
0
;
i
<
sdu_lenP
;
i
++
)
{
//
harq_process_ul_ue->a[i] = (unsigned char) rand();
//
printf("a[%d]=0x%02x\n",i,harq_process_ul_ue->a[i]);
printf
(
"%02x "
,
(
unsigned
char
)
sduP
[
i
]);
}
printf
(
"
\n
"
);
...
...
@@ -770,8 +776,8 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
}
else
if
(
sduP
)
{
bool
no_sig
=
true
;
for
(
in
t
k
=
0
;
k
<
sdu_lenP
;
k
++
)
{
if
(
sduP
[
k
]
!=
0
)
{
for
(
uint32_
t
k
=
0
;
k
<
sdu_lenP
;
k
++
)
{
if
(
sduP
[
k
]
!=
0
)
{
no_sig
=
false
;
break
;
}
...
...
@@ -856,7 +862,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
}
else
{
LOG_A
(
NR_MAC
,
"[RAPROC] RA-Msg3 received (sdu_lenP %d)
\n
"
,
sdu_lenP
);
LOG_D
(
NR_MAC
,
"[RAPROC] Received Msg3:
\n
"
);
for
(
in
t
k
=
0
;
k
<
sdu_lenP
;
k
++
)
{
for
(
uint32_
t
k
=
0
;
k
<
sdu_lenP
;
k
++
)
{
LOG_D
(
NR_MAC
,
"(%i): 0x%x
\n
"
,
k
,
sduP
[
k
]);
}
...
...
@@ -939,7 +945,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
const
sub_frame_t
slotP
,
const
rnti_t
rntiP
,
uint8_t
*
sduP
,
const
uint
16
_t
sdu_lenP
,
const
uint
32
_t
sdu_lenP
,
const
uint16_t
timing_advance
,
const
uint8_t
ul_cqi
,
const
uint16_t
rssi
)
...
...
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
View file @
1a2ae185
...
...
@@ -343,7 +343,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
const
sub_frame_t
subframeP
,
const
rnti_t
rntiP
,
uint8_t
*
sduP
,
const
uint
16
_t
sdu_lenP
,
const
uint
32
_t
sdu_lenP
,
const
uint16_t
timing_advance
,
const
uint8_t
ul_cqi
,
const
uint16_t
rssi
);
...
...
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