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
Michael Black
OpenXG-RAN
Commits
e81b9013
Commit
e81b9013
authored
Feb 09, 2022
by
Melissa Elkadi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nFAPI bug fix. Not properly packing/unpacking PUCCH PDU
Attempting to manually cherry-pick this commit:
30c14c2f
parent
65dadfb3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
158 additions
and
81 deletions
+158
-81
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
+158
-81
No files found.
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
View file @
e81b9013
...
...
@@ -3216,57 +3216,79 @@ static uint8_t pack_nr_uci_pucch_0_1(void* tlv, uint8_t **ppWritePackedMsg, uint
static
uint8_t
pack_nr_uci_pucch_2_3_4
(
void
*
tlv
,
uint8_t
**
ppWritePackedMsg
,
uint8_t
*
end
)
{
nfapi_nr_uci_pucch_pdu_format_2_3_4_t
*
value
=
(
nfapi_nr_uci_pucch_pdu_format_2_3_4_t
*
)
tlv
;
if
(
!
(
push8
(
value
->
pduBitmap
,
ppWritePackedMsg
,
end
)
&&
push32
(
value
->
handle
,
ppWritePackedMsg
,
end
)
&&
push16
(
value
->
rnti
,
ppWritePackedMsg
,
end
)
&&
push8
(
value
->
pucch_format
,
ppWritePackedMsg
,
end
)
&&
push8
(
value
->
ul_cqi
,
ppWritePackedMsg
,
end
)
&&
push16
(
value
->
timing_advance
,
ppWritePackedMsg
,
end
)
&&
push16
(
value
->
rssi
,
ppWritePackedMsg
,
end
)
))
return
0
;
if
(
!
push8
(
value
->
pduBitmap
,
ppWritePackedMsg
,
end
))
return
0
;
if
(
!
push32
(
value
->
handle
,
ppWritePackedMsg
,
end
))
return
0
;
if
(
!
push16
(
value
->
rnti
,
ppWritePackedMsg
,
end
))
return
0
;
if
(
!
push8
(
value
->
pucch_format
,
ppWritePackedMsg
,
end
))
return
0
;
if
(
!
push8
(
value
->
ul_cqi
,
ppWritePackedMsg
,
end
))
return
0
;
if
(
!
push16
(
value
->
timing_advance
,
ppWritePackedMsg
,
end
))
return
0
;
if
(
!
push16
(
value
->
rssi
,
ppWritePackedMsg
,
end
))
return
0
;
if
(
value
->
pduBitmap
&
0x01
)
{
//SR
if
(
!
(
push8
(
value
->
sr
.
sr_bit_len
,
ppWritePackedMsg
,
end
)
&&
pusharray8
(
value
->
sr
.
sr_payload
,
(
int
)(
value
->
sr
.
sr_bit_len
/
8
)
+
1
,
(
int
)(
value
->
sr
.
sr_bit_len
/
8
)
+
1
,
ppWritePackedMsg
,
end
)
))
return
0
;
if
(
!
push16
(
value
->
sr
.
sr_bit_len
,
ppWritePackedMsg
,
end
))
return
0
;
if
(
!
pusharray8
(
value
->
sr
.
sr_payload
,
(
int
)((
value
->
sr
.
sr_bit_len
/
8
)
+
1
),
(
int
)((
value
->
sr
.
sr_bit_len
/
8
)
+
1
),
ppWritePackedMsg
,
end
))
return
0
;
}
if
(((
value
->
pduBitmap
>>
1
)
&
0x01
))
{
//HARQ
if
(
!
(
push8
(
value
->
harq
.
harq_crc
,
ppWritePackedMsg
,
end
)
&&
push8
(
value
->
harq
.
harq_bit_len
,
ppWritePackedMsg
,
end
)
&&
pusharray8
(
value
->
harq
.
harq_payload
,
(
int
)(
value
->
harq
.
harq_bit_len
/
8
)
+
1
,
(
int
)(
value
->
harq
.
harq_bit_len
/
8
)
+
1
,
ppWritePackedMsg
,
end
)
))
if
((
value
->
pduBitmap
>>
1
)
&
0x01
)
{
//HARQ
if
(
!
push8
(
value
->
harq
.
harq_crc
,
ppWritePackedMsg
,
end
))
return
0
;
if
(
!
push16
(
value
->
harq
.
harq_bit_len
,
ppWritePackedMsg
,
end
))
return
0
;
if
(
!
pusharray8
(
value
->
harq
.
harq_payload
,
(
int
)((
value
->
harq
.
harq_bit_len
/
8
)
+
1
),
(
int
)((
value
->
harq
.
harq_bit_len
/
8
)
+
1
),
ppWritePackedMsg
,
end
))
return
0
;
}
if
(((
value
->
pduBitmap
>>
2
)
&
0x01
))
{
//CSI-1
if
(
!
(
push8
(
value
->
csi_part1
.
csi_part1_crc
,
ppWritePackedMsg
,
end
)
&&
push8
(
value
->
csi_part1
.
csi_part1_bit_len
,
ppWritePackedMsg
,
end
)
&&
pusharray8
(
value
->
csi_part1
.
csi_part1_payload
,
(
int
)(
value
->
csi_part1
.
csi_part1_bit_len
/
8
)
+
1
,
(
int
)(
value
->
csi_part1
.
csi_part1_bit_len
/
8
)
+
1
,
ppWritePackedMsg
,
end
)
))
if
((
value
->
pduBitmap
>>
2
)
&
0x01
)
{
//CSI-1
if
(
!
push8
(
value
->
csi_part1
.
csi_part1_crc
,
ppWritePackedMsg
,
end
))
return
0
;
if
(
!
push16
(
value
->
csi_part1
.
csi_part1_bit_len
,
ppWritePackedMsg
,
end
))
return
0
;
if
(
!
pusharray8
(
value
->
csi_part1
.
csi_part1_payload
,
(
int
)((
value
->
csi_part1
.
csi_part1_bit_len
/
8
)
+
1
),
(
int
)((
value
->
csi_part1
.
csi_part1_bit_len
/
8
)
+
1
),
ppWritePackedMsg
,
end
))
return
0
;
}
if
(((
value
->
pduBitmap
>>
3
)
&
0x01
))
{
//CSI-2
if
(
!
(
push8
(
value
->
csi_part2
.
csi_part2_crc
,
ppWritePackedMsg
,
end
)
&&
push8
(
value
->
csi_part2
.
csi_part2_bit_len
,
ppWritePackedMsg
,
end
)
&&
pusharray8
(
value
->
csi_part2
.
csi_part2_payload
,
(
int
)(
value
->
csi_part2
.
csi_part2_bit_len
/
8
)
+
1
,
(
int
)(
value
->
csi_part2
.
csi_part2_bit_len
/
8
)
+
1
,
ppWritePackedMsg
,
end
)
))
if
((
value
->
pduBitmap
>>
3
)
&
0x01
)
{
//CSI-2
if
(
!
push8
(
value
->
csi_part2
.
csi_part2_crc
,
ppWritePackedMsg
,
end
))
return
0
;
if
(
!
push16
(
value
->
csi_part2
.
csi_part2_bit_len
,
ppWritePackedMsg
,
end
))
return
0
;
if
(
!
pusharray8
(
value
->
csi_part2
.
csi_part2_payload
,
(
int
)((
value
->
csi_part2
.
csi_part2_bit_len
/
8
)
+
1
),
(
int
)((
value
->
csi_part2
.
csi_part2_bit_len
/
8
)
+
1
),
ppWritePackedMsg
,
end
))
return
0
;
}
return
1
;
}
static
uint8_t
pack_nr_uci_indication_body
(
void
*
tlv
,
uint8_t
**
ppWritePackedMsg
,
uint8_t
*
end
)
static
uint8_t
pack_nr_uci_indication_body
(
nfapi_nr_uci_t
*
value
,
uint8_t
**
ppWritePackedMsg
,
uint8_t
*
end
)
{
nfapi_nr_uci_t
*
value
=
(
nfapi_nr_uci_t
*
)
tlv
;
if
(
!
(
push16
(
value
->
pdu_type
,
ppWritePackedMsg
,
end
)
&&
push16
(
value
->
pdu_size
,
ppWritePackedMsg
,
end
)
))
if
(
!
push16
(
value
->
pdu_type
,
ppWritePackedMsg
,
end
))
return
0
;
if
(
!
push16
(
value
->
pdu_size
,
ppWritePackedMsg
,
end
))
return
0
;
switch
(
value
->
pdu_type
)
{
...
...
@@ -3290,13 +3312,14 @@ static uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uin
{
nfapi_nr_uci_indication_t
*
pNfapiMsg
=
(
nfapi_nr_uci_indication_t
*
)
msg
;
if
(
!
(
push16
(
pNfapiMsg
->
sfn
,
ppWritePackedMsg
,
end
)
&&
push16
(
pNfapiMsg
->
slot
,
ppWritePackedMsg
,
end
)
&&
push16
(
pNfapiMsg
->
num_ucis
,
ppWritePackedMsg
,
end
)
))
if
(
!
push16
(
pNfapiMsg
->
sfn
,
ppWritePackedMsg
,
end
))
return
0
;
if
(
!
push16
(
pNfapiMsg
->
slot
,
ppWritePackedMsg
,
end
))
return
0
;
if
(
!
push16
(
pNfapiMsg
->
num_ucis
,
ppWritePackedMsg
,
end
))
return
0
;
for
(
int
i
=
0
;
i
<
pNfapiMsg
->
num_ucis
;
i
++
)
for
(
int
i
=
0
;
i
<
pNfapiMsg
->
num_ucis
;
i
++
)
{
if
(
!
pack_nr_uci_indication_body
(
&
pNfapiMsg
->
uci_list
[
i
],
ppWritePackedMsg
,
end
))
return
0
;
...
...
@@ -5907,58 +5930,111 @@ static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t *valu
}
static
uint8_t
unpack_nr_uci_pucch_2_3_4
(
nfapi_nr_uci_pucch_pdu_format_2_3_4_t
*
tlv
,
uint8_t
**
ppReadPackedMsg
,
uint8_t
*
end
)
{
nfapi_nr_uci_pucch_pdu_format_2_3_4_t
*
value
=
(
nfapi_nr_uci_pucch_pdu_format_2_3_4_t
*
)
tlv
;
static
uint8_t
unpack_nr_uci_pucch_2_3_4
(
nfapi_nr_uci_pucch_pdu_format_2_3_4_t
*
value
,
uint8_t
**
ppReadPackedMsg
,
uint8_t
*
end
,
nfapi_p7_codec_config_t
*
config
)
{
if
(
!
pull8
(
ppReadPackedMsg
,
&
value
->
pduBitmap
,
end
))
return
0
;
if
(
!
pull32
(
ppReadPackedMsg
,
&
value
->
handle
,
end
))
return
0
;
if
(
!
pull16
(
ppReadPackedMsg
,
&
value
->
rnti
,
end
))
return
0
;
if
(
!
pull8
(
ppReadPackedMsg
,
&
value
->
pucch_format
,
end
))
return
0
;
if
(
!
pull8
(
ppReadPackedMsg
,
&
value
->
ul_cqi
,
end
))
return
0
;
if
(
!
pull16
(
ppReadPackedMsg
,
&
value
->
timing_advance
,
end
))
return
0
;
if
(
!
pull16
(
ppReadPackedMsg
,
&
value
->
rssi
,
end
))
return
0
;
if
(
!
(
pull8
(
ppReadPackedMsg
,
&
value
->
pduBitmap
,
end
)
&&
pull32
(
ppReadPackedMsg
,
&
value
->
handle
,
end
)
&&
pull16
(
ppReadPackedMsg
,
&
value
->
rnti
,
end
)
&&
pull8
(
ppReadPackedMsg
,
&
value
->
pucch_format
,
end
)
&&
pull8
(
ppReadPackedMsg
,
&
value
->
ul_cqi
,
end
)
&&
pull16
(
ppReadPackedMsg
,
&
value
->
timing_advance
,
end
)
&&
pull16
(
ppReadPackedMsg
,
&
value
->
rssi
,
end
)
))
return
0
;
if
(
value
->
pduBitmap
&
0x01
)
{
//SR
if
(
!
(
pull16
(
ppReadPackedMsg
,
&
value
->
sr
.
sr_bit_len
,
end
)
))
if
(
!
pull16
(
ppReadPackedMsg
,
&
value
->
sr
.
sr_bit_len
,
end
))
return
0
;
value
->
sr
.
sr_payload
=
(
uint8_t
*
)
malloc
(
sizeof
(
uint8_t
)
*
((
value
->
sr
.
sr_bit_len
/
8
)));
value
->
sr
.
sr_payload
=
nfapi_p7_allocate
(
sizeof
(
*
value
->
sr
.
sr_payload
)
*
(
int
)((
value
->
sr
.
sr_bit_len
/
8
)
+
1
),
config
);
if
(
value
->
sr
.
sr_payload
==
NULL
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"%s failed to allocate value->sr.sr_payload
\n
"
,
__FUNCTION__
);
return
0
;
}
if
(
!
(
pullarray8
(
ppReadPackedMsg
,
&
value
->
sr
.
sr_payload
[
0
],
(
int
)(
value
->
sr
.
sr_bit_len
/
8
),
(
int
)(
value
->
sr
.
sr_bit_len
/
8
),
end
)))
return
0
;
if
(
!
pullarray8
(
ppReadPackedMsg
,
value
->
sr
.
sr_payload
,
(
int
)((
value
->
sr
.
sr_bit_len
/
8
)
+
1
),
(
int
)((
value
->
sr
.
sr_bit_len
/
8
)
+
1
),
end
))
return
0
;
}
if
(((
value
->
pduBitmap
>>
1
)
&
0x01
))
{
//HARQ
if
(
!
(
pull8
(
ppReadPackedMsg
,
&
value
->
harq
.
harq_crc
,
end
))
&&
(
pull16
(
ppReadPackedMsg
,
&
value
->
harq
.
harq_bit_len
,
end
)))
if
((
value
->
pduBitmap
>>
1
)
&
0x01
)
{
//HARQ
if
(
!
pull8
(
ppReadPackedMsg
,
&
value
->
harq
.
harq_crc
,
end
))
return
0
;
if
(
!
pull16
(
ppReadPackedMsg
,
&
value
->
harq
.
harq_bit_len
,
end
))
return
0
;
value
->
harq
.
harq_payload
=
(
uint8_t
*
)
malloc
(
sizeof
(
uint8_t
)
*
((
value
->
harq
.
harq_bit_len
/
8
)));
value
->
harq
.
harq_payload
=
nfapi_p7_allocate
(
sizeof
(
*
value
->
harq
.
harq_payload
)
*
(
int
)((
value
->
harq
.
harq_bit_len
/
8
)
+
1
),
config
);
if
(
value
->
harq
.
harq_payload
==
NULL
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"%s failed to allocate value->harq.harq_payload
\n
"
,
__FUNCTION__
);
return
0
;
}
if
(
!
(
pullarray8
(
ppReadPackedMsg
,
value
->
harq
.
harq_payload
,
(
int
)(
value
->
harq
.
harq_bit_len
/
8
),
(
int
)(
value
->
harq
.
harq_bit_len
/
8
),
end
)))
if
(
!
pullarray8
(
ppReadPackedMsg
,
value
->
harq
.
harq_payload
,
(
int
)((
value
->
harq
.
harq_bit_len
/
8
)
+
1
),
(
int
)((
value
->
harq
.
harq_bit_len
/
8
)
+
1
),
end
))
return
0
;
}
if
(((
value
->
pduBitmap
>>
2
)
&
0x01
))
{
//CSI-1
if
(
!
(
pull8
(
ppReadPackedMsg
,
&
value
->
csi_part1
.
csi_part1_crc
,
end
))
&&
(
pull16
(
ppReadPackedMsg
,
&
value
->
csi_part1
.
csi_part1_bit_len
,
end
)))
if
((
value
->
pduBitmap
>>
2
)
&
0x01
)
{
//CSI-1
if
(
!
pull8
(
ppReadPackedMsg
,
&
value
->
csi_part1
.
csi_part1_crc
,
end
))
return
0
;
if
(
!
pull16
(
ppReadPackedMsg
,
&
value
->
csi_part1
.
csi_part1_bit_len
,
end
))
return
0
;
value
->
csi_part1
.
csi_part1_payload
=
(
uint8_t
*
)
malloc
(
sizeof
(
uint8_t
)
*
((
value
->
csi_part1
.
csi_part1_bit_len
/
8
)));
value
->
csi_part1
.
csi_part1_payload
=
nfapi_p7_allocate
(
sizeof
(
*
value
->
csi_part1
.
csi_part1_payload
)
*
(
int
)((
value
->
csi_part1
.
csi_part1_bit_len
/
8
)
+
1
),
config
);
if
(
value
->
csi_part1
.
csi_part1_payload
==
NULL
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"%s failed to allocate value->csi_part1.csi_part1_payload
\n
"
,
__FUNCTION__
);
return
0
;
}
// if(!(pullarray8(ppReadPackedMsg, value->csi_part1.csi_part1_payload, (int)(value->csi_part1.csi_part1_bit_len / 8), (int)(value->csi_part1.csi_part1_bit_len / 8), end)))
// return 0;
if
(
!
pullarray8
(
ppReadPackedMsg
,
value
->
csi_part1
.
csi_part1_payload
,
(
int
)((
value
->
csi_part1
.
csi_part1_bit_len
/
8
)
+
1
),
(
int
)((
value
->
csi_part1
.
csi_part1_bit_len
/
8
)
+
1
),
end
))
return
0
;
}
if
(((
value
->
pduBitmap
>>
3
)
&
0x01
))
{
//CSI-2
if
(
!
(
pull8
(
ppReadPackedMsg
,
&
value
->
csi_part2
.
csi_part2_crc
,
end
))
&&
(
pull16
(
ppReadPackedMsg
,
&
value
->
csi_part2
.
csi_part2_bit_len
,
end
)))
if
((
value
->
pduBitmap
>>
3
)
&
0x01
)
{
//CSI-2
if
(
!
pull8
(
ppReadPackedMsg
,
&
value
->
csi_part2
.
csi_part2_crc
,
end
))
return
0
;
if
(
!
pull16
(
ppReadPackedMsg
,
&
value
->
csi_part2
.
csi_part2_bit_len
,
end
))
return
0
;
value
->
csi_part2
.
csi_part2_payload
=
(
uint8_t
*
)
malloc
(
sizeof
(
uint8_t
)
*
((
value
->
csi_part2
.
csi_part2_bit_len
/
8
)));
value
->
csi_part2
.
csi_part2_payload
=
nfapi_p7_allocate
(
sizeof
(
*
value
->
csi_part2
.
csi_part2_payload
)
*
(
int
)((
value
->
csi_part2
.
csi_part2_bit_len
/
8
)
+
1
),
config
);
if
(
value
->
csi_part2
.
csi_part2_payload
==
NULL
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"%s failed to allocate value->csi_part2.csi_part2_payload
\n
"
,
__FUNCTION__
);
return
0
;
}
if
(
!
(
pullarray8
(
ppReadPackedMsg
,
value
->
csi_part2
.
csi_part2_payload
,
(
int
)(
value
->
csi_part2
.
csi_part2_bit_len
/
8
)
,
(
int
)(
value
->
csi_part2
.
csi_part2_bit_len
/
8
)
,
end
)))
if
(
!
pullarray8
(
ppReadPackedMsg
,
value
->
csi_part2
.
csi_part2_payload
,
(
int
)((
value
->
csi_part2
.
csi_part2_bit_len
/
8
)
+
1
),
(
int
)((
value
->
csi_part2
.
csi_part2_bit_len
/
8
)
+
1
),
end
))
return
0
;
}
...
...
@@ -5970,9 +6046,9 @@ static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t *value,
uint8_t
*
end
,
nfapi_p7_codec_config_t
*
config
)
{
if
(
!
(
pull16
(
ppReadPackedMsg
,
&
value
->
pdu_type
,
end
)
&&
pull16
(
ppReadPackedMsg
,
&
value
->
pdu_size
,
end
)
))
if
(
!
pull16
(
ppReadPackedMsg
,
&
value
->
pdu_type
,
end
))
return
0
;
if
(
!
pull16
(
ppReadPackedMsg
,
&
value
->
pdu_size
,
end
))
return
0
;
switch
(
value
->
pdu_type
)
{
...
...
@@ -5988,7 +6064,7 @@ static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t *value,
}
case
NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE
:
{
nfapi_nr_uci_pucch_pdu_format_2_3_4_t
*
uci_pdu
=
&
value
->
pucch_pdu_format_2_3_4
;
if
(
!
unpack_nr_uci_pucch_2_3_4
(
uci_pdu
,
ppReadPackedMsg
,
end
))
if
(
!
unpack_nr_uci_pucch_2_3_4
(
uci_pdu
,
ppReadPackedMsg
,
end
,
config
))
return
0
;
break
;
}
...
...
@@ -6004,17 +6080,18 @@ static uint8_t unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end,
{
nfapi_nr_uci_indication_t
*
pNfapiMsg
=
(
nfapi_nr_uci_indication_t
*
)
msg
;
if
(
!
(
pull16
(
ppReadPackedMsg
,
&
pNfapiMsg
->
sfn
,
end
)
&&
pull16
(
ppReadPackedMsg
,
&
pNfapiMsg
->
slot
,
end
)
&&
pull16
(
ppReadPackedMsg
,
&
pNfapiMsg
->
num_ucis
,
end
)
))
return
0
;
if
(
!
pull16
(
ppReadPackedMsg
,
&
pNfapiMsg
->
sfn
,
end
))
return
0
;
if
(
!
pull16
(
ppReadPackedMsg
,
&
pNfapiMsg
->
slot
,
end
))
return
0
;
if
(
!
pull16
(
ppReadPackedMsg
,
&
pNfapiMsg
->
num_ucis
,
end
))
return
0
;
pNfapiMsg
->
uci_list
=
nfapi_p7_allocate
(
sizeof
(
*
pNfapiMsg
->
uci_list
)
*
pNfapiMsg
->
num_ucis
,
config
);
for
(
int
i
=
0
;
i
<
pNfapiMsg
->
num_ucis
;
i
++
)
{
if
(
!
unpack_nr_uci_indication_body
(
&
pNfapiMsg
->
uci_list
[
i
],
ppReadPackedMsg
,
end
,
config
))
return
0
;
if
(
!
unpack_nr_uci_indication_body
(
&
pNfapiMsg
->
uci_list
[
i
],
ppReadPackedMsg
,
end
,
config
))
return
0
;
}
return
1
;
...
...
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