Compare commits

...

86 Commits

Author SHA1 Message Date
vijay chadachan
af9e55428f Changes to support multiple TDD patterns
- Updated the configuration changes for 2 Patterns
- Update the TDD table configuration for NFAPI
- Added the tdd config map for the period
2024-06-03 14:43:25 +02:00
Robert Schmidt
9249131046 Merge branch 'integration_2024_w21b' into 'develop'
Integration: `2024.w21b`

Closes #734

See merge request oai/openairinterface5g!2755

* !2700 Fix UE PUCCH multiplexing infinite loop
* !2724 Correct PRACH preamble tx power calculation.
* !2726 NR SA Tutorials
* !2728 Use existing function for bits reversal
* !2732 CU handle F1 setup Req- TAC conversion
* !2738 Correct data offset for unscrambling in PUSCH processing
* !2742 UE: fix mutex locking verification
* !2737 rename persisted ul harq status per pid with a uniq name, make better mutual exclision of processSlotTX()
2024-05-24 07:25:15 +00:00
Robert Schmidt
295f221a9b Merge remote-tracking branch 'origin/simpler-parallel-exclusion-ue-tx' into integration_2024_w21b 2024-05-24 08:13:41 +02:00
Robert Schmidt
58335443b1 Revert "remove asserts on min RX/TX, set the RX/TX shift as 2 in the UE"
This reverts commit 0d0e111135.  It was
set to UE RX to TX time to 2 as it was deemed that the UE could sustain
this time. However, we noticed a degradation of performance, so reset
the RX to TX time to something higher to ensure proper performance.
2024-05-24 06:54:30 +02:00
Robert Schmidt
b5159b5e47 Revert "ci: set min_rxtxtime = 2 in OAIUE pipeline"
This reverts commit 31b4f48e29.
2024-05-24 06:54:15 +02:00
Robert Schmidt
7a631ce3a2 Use an enum for stream_status states 2024-05-23 16:41:20 +02:00
Jaroslava Fiedlerova
1001f2eb13 Merge remote-tracking branch 'origin/fix-mutex-management-bug' into integration_2024_w21b 2024-05-23 12:46:13 +02:00
Jaroslava Fiedlerova
018ca77aa0 Merge remote-tracking branch 'origin/issue-734' into integration_2024_w21b 2024-05-23 12:42:46 +02:00
Jaroslava Fiedlerova
e580450ae2 Merge remote-tracking branch 'origin/IISc_F1setup_tac' into integration_2024_w21b 2024-05-23 12:42:15 +02:00
Jaroslava Fiedlerova
64e6c6e5b2 Merge remote-tracking branch 'origin/ue-pbch-use-reversebits' into integration_2024_w21b 2024-05-23 12:41:38 +02:00
Jaroslava Fiedlerova
841869b0ec Merge remote-tracking branch 'origin/NR_SA_Tutorials' into integration_2024_w21b 2024-05-23 12:40:07 +02:00
Jaroslava Fiedlerova
d3acd5d6c0 Merge remote-tracking branch 'origin/nr-prach-tx-power-fix' into integration_2024_w21b 2024-05-23 12:39:40 +02:00
Jaroslava Fiedlerova
3a4dac00ee Merge remote-tracking branch 'origin/NR_UE_fix_PUCCH_multiplexing' into integration_2024_w21b 2024-05-23 12:37:32 +02:00
Robert Schmidt
082007834c Merge branch 'integration_2024_w21' into 'develop'
Integration: `2024.w21`

See merge request oai/openairinterface5g!2746

* !2717 Additional check on pucch_Config and srs_Config
* !2730 Fix for SSB index in function get_nr_prach_info_from_ssb_index
* !2734 add a function to reset the transmission timestamps chain
* !2741 Fix several potential segfaults in UE PUCCH tx power determination.
2024-05-22 12:55:51 +00:00
Laurent THOMAS
6379350f51 Correct data offset for unscrambling in PUSCH processing
Correctly compute the offset of data to unscramble in PUSCH processing
at the gNB. Rename variables to make them easier to spot (instead of
"s"), and remove a global variable.

Closes: #734
2024-05-22 09:04:33 +02:00
luis_pereira87
9278394f3c Tutorials: Update links for the latest Ubuntu 22.04 LTS iso file 2024-05-22 07:14:36 +01:00
luis_pereira87
246a8aff16 Tutorials: Rename OAI CN5G docker network interface name from 'demo-oai' to 'oai-cn5g' and remove commented lines 2024-05-22 07:14:36 +01:00
luis_pereira87
3c6ae9c2cb Tutorials: Fix multiple S-NSSAI redefinitions for the same S-NSSAI in the configuration file 2024-05-22 07:14:36 +01:00
Robert Schmidt
73243f668e Merge remote-tracking branch 'origin/fix-pucch-tx-power-segfaults' into integration_2024_w21 2024-05-22 07:45:51 +02:00
Robert Schmidt
959df471f3 Merge remote-tracking branch 'origin/reset-transmission-sequence' into integration_2024_w21 2024-05-22 07:45:41 +02:00
Robert Schmidt
d326477494 Merge remote-tracking branch 'origin/NR_UE_ssb_index_fix' into integration_2024_w21 2024-05-22 07:45:34 +02:00
Robert Schmidt
10940010f5 Merge remote-tracking branch 'origin/nr-ue-config-pointer-check' into integration_2024_w21 2024-05-22 07:45:27 +02:00
Raphael Defosseux
0ad85cb111 chore(ci): dummy commit to retrigger CI
Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
2024-05-21 14:33:40 +02:00
Jaroslava Fiedlerova
5238ce912b Replace "theseus" OC node by "demophon" 2024-05-21 12:16:05 +02:00
Laurent THOMAS
f2213bf792 fix a error that was created by over complexity in setting a pointer to null for a wrong later assert verification 2024-05-20 20:57:46 +02:00
Bartosz Podrygajlo
b101e682f5 Fix several potential segfaults in UE PUCCH tx power determination. 2024-05-20 15:00:29 +02:00
francescomani
075f564606 fix ssb index in get_nr_prach_info_from_ssb_index 2024-05-16 18:37:38 +02:00
Laurent THOMAS
e217980249 simplify and make better performance the mutual exclusion of processSlotTX() function 2024-05-16 14:06:24 +02:00
Laurent THOMAS
3e4526a6ad rename persisted ul harq status per pid with a uniq name as this variable is persisted in memory and accessed by multiple threads, a uniq name helps to debug 2024-05-16 14:05:39 +02:00
Robert Schmidt
9fd1b9ac69 Correct buffer size for do_NR_DLInformationTransfer()
uper_encode_to_buffer() of asn1c returns the number of BITS that have
been encoded; if we use this, we need to calculate the resulting number
of bytes (rounding up) to get the right buffer size.

Note that do_NR_ULInformationTransfer() uses
uper_encode_to_new_buffer() which returns the number of BYTES, hence, in
this similar function, we should not modify the return value.
2024-05-16 11:59:55 +02:00
Sreeshma Shiv
17f2eaa558 TAC-Octet String to integer conversion function corrections
-Corrected the conversion function used in CU_handle_F1_SETUP_REQUEST

-Corrected the conversion function in CU_handle_gNB_DU_CONFIGURATION_UPDATE
2024-05-16 12:21:59 +05:30
laurent
ca06b77a89 add a function to reset the transmission timestamps chain, and use it in context of UE resynchronization 2024-05-15 17:35:02 +02:00
Sakthivel Velumani
40b52bc8f4 Use existing function for bits reversal 2024-05-10 12:51:50 -04:00
Bartosz Podrygajlo
70f536a0f0 Correct PRACH preamble tx power calculation.
Removed arbitrary offset of 30dB.
Changed sign for pathloss: pathloss calculated in compute_nr_SSB_PL is the difference between transmitted and received power.
Transmission power for preamble should compensate the pathloss, therefore power should increase with pathloss.
2024-05-08 12:19:08 +02:00
Robert Schmidt
82bd07ebd5 Merge branch 'integration_2024_w18' into 'develop'
Integration `2024.w18`

See merge request oai/openairinterface5g!2713

* !2705 Fix CRC check in UE DCI detection
* !2708 Adding few more NR bands to the list of supported ones
* !2701 gNB archi fixes
* !2203 DL-MMSE
* !2684 remove asserts on min RX/TX, set the RX/TX shift as 2 in the UE
* !2594 F1AP refactoring to align with O-RAN.WG5.C.1-v11
2024-05-07 08:06:51 +00:00
Guido Casati
cf22a331e5 Additional check on pucch_Config and srs_Config 2024-05-06 18:10:03 +02:00
Jaroslava Fiedlerova
65d494fb09 Merge remote-tracking branch 'origin/f1ap_uecontext_refactoring' into integration_2024_w18 2024-05-06 15:29:48 +02:00
Jaroslava Fiedlerova
944925ff69 Merge remote-tracking branch 'origin/ue-make-rxtx-of-2-slots' into integration_2024_w18 2024-05-06 14:23:49 +02:00
Robert Schmidt
0fb0b055e5 NGAP: Correct encoding of AMF Set ID and Pointer
Taking the example of the AMF Set ID, the previous version of the macro
used another macro to encode the number, then marked the last 6 bits in
the bit string (of length 16/2 bytes) as unused. This is wrong, because,
assuming AMF Set ID=3, it basically truncates the number by encoding all
16 bits and cutting off the last 6, like this:

  ------------------- encode 16 bits
  0000 0000 0000 0011
  ------------        take these 10 bits

So what remains is these bit positions of the number:
(16,15,14,13,12,11,10,9,8,7) -- the last 6 bits are cut (and the first 6
are either 0 or garbage, because they don't exist).

Instead, manually encode bits (10,9,8,7,6,5,4,3) in the first byte, and
(2,1) in the second byte of the bit string, like so:

  ------------        encode 10 bits
  0000 0000 1100 0000
  ------------        take these 10 bits

Do the same with the pointer.

The AMF Region ID above is correct, as it is exactly 8 bits.
2024-05-06 12:03:20 +02:00
Robert Schmidt
8d225a7e10 NGAP Release Cplt: indicate release PDU sessions
We can optionally indicate the PDU session IDs. At least with OAI 5GC,
that should help it clean up.
2024-05-06 12:00:26 +02:00
Robert Schmidt
3e2d5f8820 Handle PDU sessions in NG UE context setup request
In the case of PDU sessions in the NG UE context setup request, we first
have to set up security. Hence, in this commit, implement the "delayed"
set up of theses PDU sessions, and acknowledge the setup request after
reconfiguration, as requested by O-RAN.WG5.C.1-v11.
2024-05-06 11:59:59 +02:00
Robert Schmidt
1fc16077ff Correctly trigger NGAP UE Context Setup Response
Trigger UE ctxt setup response for the case of "registration request"
(no PDU sessions in UE Context setup response), as mandated by
O-RAN.WG5.C.1-v11.
2024-05-06 11:59:55 +02:00
Robert Schmidt
cbf446e267 Trigger UE context setup req after E1 bearer setup resp
As of this commit, since we now send the UE security command as a DL NAS
message, there is no F1 UE Context setup request. Hence, instead of
sending a UE context modif request, send the UE context setup request
after the E1 bearer setup response (which logically also makes more
sense, as the E1 setup procedure comes before the F1 setup procedure).
2024-05-06 11:59:51 +02:00
Robert Schmidt
179ecb8e84 Revert "Delay PDU session resource setup request if necessary"
This reverts commit 0f100a6e94, which
introduced a hack to possibly wait with a PDU session setup at the RRC
in case a RRC UE capability transaction (requesting UE capabilities from
a UE) was ongoing. This happened, as we delayed the UE capabilities to
after the first RRC reconfiguration; in that case, certain UEs were
requesting the next PDU session, and if RRC did not delay the new PDU
session (as requested from the core), this procedure might occur while
UE capability enquiry was ongoing, leading to failures in these
transactions.
2024-05-06 11:58:31 +02:00
Robert Schmidt
c7a2471542 Remove unused function for "default" RRC reconfiguration
The default RRC reconfiguration was previously sent after the security
mode command as a "first" RRC reconfiguration. However, it is simply not
needed, as it will be triggered through a subsequent reconfiguration
that also sets up DRBs.

Move the Measurement Config to the "other/dedicated" RRC
reconfiguration.

This reconfiguration would have forwarded a NAS PDU (typically a
registration accept). This is now done by a dedicated forwarding of NAS.
2024-05-06 11:58:21 +02:00
Giulio Carota
388942b5d3 Revert "Send RRC UECapabilityEnquiry after reconfig, trigger UE update if necessary"
This reverts commit 4a7d7975ce.

Trigger the UE capability right after security mode complete, as
specified in O-RAN WG5.C.1-v11. Also, there is no "need" for the
"default" RRC Reconfiguration (it will come once PDU sessions are
requested), so remove this as well.
2024-05-06 11:58:15 +02:00
Giulio Carota
7340abc6f4 Refactor Security Mode Command procedure: send in RRC DL transfer
Previously, the CU sent the Security Mode Command as part of a UE
context setup request. This was done "because it was possible", not
because there was an inherent need to do this. However the LiteOn DU
does not like this, as it expects to also have a DRB in the UE context
setup request procedure, which is not always the case.

Hence, send the Security Mode Command in a normal DL RRC msg transfer
over F1. As of this commit, there is not UE context Setup Request (so it
might not work with all DUs), but the OAI DU is cool and does not care,
so RFsim still works.

This also aligns the CU's behavior with O-RAN.WG5.C.1-v11.

Finally, as of this commit, we do not trigger a UE context setup
request, so we cannot handle PDU sessions inside the initial UE context
setup request at the same time as the security mode command (which was
done previously before reaching this point). This will be fixed in a
later commit.
2024-05-06 11:56:57 +02:00
Giulio Carota
46e27ba445 Add UE Context Setup/Modification functions in RRC 2024-05-06 11:55:19 +02:00
Robert Schmidt
956df365de Refactor F1 Setup Req/DU config update: transport slices via F1 and read config
In the DU, read slice information from the DU config file. Handle
multiple slices within the F1 Setup Request structure representation,
and forward it via F1 to CU. The DU slice information is stored in the
setup request structure.
2024-05-06 11:54:41 +02:00
Robert Schmidt
740189c625 Revert "kssb < 16 or we cannot do reestablishment: add assert in DU"
This reverts commit eaf28414ca.

This assertion was introduced as we (wrongfully) thought we needed to
calculate the SSB ARFCN at the CU. Since PBCH might carry one bit, which
is not available at the CU, only certain SSB ARFCNs would have been
possible.

With the availability of the SSB ARFCN through the
MeasurementTimingConfiguration, this is not necessary anymore.
2024-05-06 11:46:15 +02:00
Robert Schmidt
177ddaa079 Fill RRC MeasConfig with correct SSB values from DU 2024-05-06 11:45:18 +02:00
Robert Schmidt
00cb7efa2a Use MeasurementTimingConfiguration to look up SSB ARFCN when needed
MeasTimingConfig may not come with F1 Setup Request: some DUs send it
with the DU configuration update. Handle this gracefully by checking for
MTC before using it.
2024-05-06 11:44:33 +02:00
Giulio Carota
2f81f190d1 Generate TimingMeasurementConfig at DU, store at CU 2024-05-06 11:44:32 +02:00
Robert Schmidt
a771d58472 Implement F1AP code for gNB-DU configuration update 2024-05-06 11:36:40 +02:00
Robert Schmidt
67e5547957 Refactor F1 setup req reading
Refactor parts into a separate function, which will be reused within the
gNB-DU configuration update function in the next commit.
2024-05-06 11:35:58 +02:00
Robert Schmidt
aaaa00378a Do not send UE Context modif only with successful reconfig
The OAI DU does not use this message, and could not roll-back. The
LiteOn DU does not seem to like it. It is useless (as of now), so remove
it
2024-05-06 11:35:16 +02:00
Giulio Carota
ae66ba7a7b fix(du/cu/rrc): use the correct MIB data structure
Use the correct MIB data structure, MIB_t. This is required by 38.473,
and the LiteOn DU sends only that. So our CU needs to handle it, so
align the OAI DU as well.
2024-05-06 11:34:29 +02:00
Robert Schmidt
1cefbdb87f F1AP for gNB-DU config update & ack in CU 2024-05-06 11:34:01 +02:00
Robert Schmidt
cdd629de89 gNB-DU config update in DU 2024-05-06 11:22:57 +02:00
Robert Schmidt
aa18edb8ac gNB-DU config update msg def and handle in CU 2024-05-06 11:18:43 +02:00
Robert Schmidt
f247373474 Refactor TDD/FDD config reading into functions 2024-05-06 11:18:10 +02:00
Robert Schmidt
1c747e8223 RRC stats: show DU info 2024-05-06 11:17:51 +02:00
Robert Schmidt
1bd6018f91 Add extract_sys_info(): refactor DU cell sys_info handling in own function 2024-05-06 11:17:20 +02:00
Giulio Carota
9518e00923 fix(f1ap): Do not send optional hardcoded fields in UE context setup request 2024-05-06 11:17:18 +02:00
Robert Schmidt
00f85d54c5 Remove dead code 2024-05-06 11:14:17 +02:00
Robert Schmidt
c8539aeef5 Remove misleading comment 2024-05-06 11:14:09 +02:00
Robert Schmidt
590afc811f Correct F1 criticality 2024-05-06 11:11:32 +02:00
Jaroslava Fiedlerova
c73642868a Merge remote-tracking branch 'origin/develop-DL-improvements' into integration_2024_w18 2024-05-06 09:39:20 +02:00
Jaroslava Fiedlerova
fece66201c Merge remote-tracking branch 'origin/clean-and-doc-gnb-main-archi' into integration_2024_w18 2024-05-05 23:32:34 +02:00
Jaroslava Fiedlerova
578af2f81f Merge remote-tracking branch 'origin/NR_new_bands' into integration_2024_w18 2024-05-05 20:59:14 +02:00
Laurent THOMAS
00d78f048a remove a unused global storage of slot number
This has no meaning at a global level, we run several slots: one tx,
several rx at same time. Some minor cleaning of C style
2024-05-03 18:32:26 +02:00
Laurent THOMAS
c02908453a fix order error in ru.common.rxdataF filling lock, use consistently #define for buffer size 2024-05-03 18:31:45 +02:00
Laurent THOMAS
bb66056b75 fix nr-ru.c external declarations in .c file
The external declarations were incorrect, leading to mismatching
prototypes of config_ru and config_rru (true bug in OAI lte!).
2024-05-03 18:31:17 +02:00
rmagueta
a5055cacf0 Remove commented code 2024-05-03 15:07:26 +01:00
rmagueta
bcbf9287ba Noise power estimation and MMSE computation for DL at UE side 2024-05-03 15:07:26 +01:00
rmagueta
f5dccc2a59 Improvements in nr_dlsch_channel_compensation() function 2024-05-03 15:07:26 +01:00
Jaroslava Fiedlerova
f49dbf470a Merge remote-tracking branch 'origin/NR_UE_DCI_RX_improvements' into integration_2024_w18 2024-05-03 15:04:18 +02:00
Jaroslava Fiedlerova
31b4f48e29 ci: set min_rxtxtime = 2 in OAIUE pipeline 2024-05-02 20:06:10 +02:00
Jaroslava Fiedlerova
af49883543 Remove version field from oai cn5g docker compose file 2024-05-02 16:49:40 +02:00
Jaroslava Fiedlerova
ac51870b43 Remove version field from docker-compose files
For docker version > 25.0.5, "version" field is not relevant and reported as obsolete.
2024-05-02 15:54:59 +02:00
francescomani
1056e53acb mostly formatting 2024-05-01 16:51:40 +02:00
francescomani
c719b3f057 adding new nr bands to the tables 2024-05-01 16:13:04 +02:00
francescomani
114fb5dbca bugfix in dci reception, CRC is 24 bits but uint16 was used 2024-04-30 12:36:15 +02:00
francescomani
90f82d19da remove false DCI reception indication 2024-04-29 12:39:44 +02:00
francescomani
6fdb69a898 fix for possible infinite loop in UE PUCCH multiplexing 2024-04-25 15:24:36 +02:00
Laurent THOMAS
0d0e111135 remove asserts on min RX/TX, set the RX/TX shift as 2 in the UE 2024-04-17 09:50:23 +02:00
137 changed files with 2347 additions and 1673 deletions

View File

@@ -25,6 +25,7 @@
<a href="https://hub.docker.com/r/oaisoftwarealliance/oai-nr-ue"><img alt="Docker Pulls" src="https://img.shields.io/docker/pulls/oaisoftwarealliance/oai-nr-ue?label=NR-UE%20docker%20pulls"></a>
<a href="https://hub.docker.com/r/oaisoftwarealliance/oai-enb"><img alt="Docker Pulls" src="https://img.shields.io/docker/pulls/oaisoftwarealliance/oai-enb?label=eNB%20docker%20pulls"></a>
<a href="https://hub.docker.com/r/oaisoftwarealliance/oai-lte-ue"><img alt="Docker Pulls" src="https://img.shields.io/docker/pulls/oaisoftwarealliance/oai-lte-ue?label=LTE-UE%20docker%20pulls"></a>
<a href="https://hub.docker.com/r/oaisoftwarealliance/oai-nr-cuup"><img alt="Docker Pulls" src="https://img.shields.io/docker/pulls/oaisoftwarealliance/oai-nr-cuup?label=NR-CUUP%20docker%20pulls"></a>
</p>
# OpenAirInterface License #

View File

@@ -30,11 +30,11 @@ global:
nrpsbchsim: dedale
nrprachsim: dedale
nrpucchsim: dedale
nrulschsim: theseus
nrulsim3gpp: theseus
nrulsimmimo: theseus
nrulsimmisc: theseus
nrulsimscfdma: theseus
polartest: theseus
smallblocktest: theseus
ulsim: theseus
nrulschsim: demophon
nrulsim3gpp: demophon
nrulsimmimo: demophon
nrulsimmisc: demophon
nrulsimscfdma: demophon
polartest: demophon
smallblocktest: demophon
ulsim: demophon

View File

@@ -30,7 +30,7 @@ gNBs =
absoluteFrequencySSB = 620736;
dl_frequencyBand = 78;
# this is 3300.30 MHz
dl_absoluteFrequencyPointA = 620052;
dl_absoluteFrequencyPointA = 620020;
#scs-SpecificCarrierList
dl_offstToCarrier = 0;
# subcarrierSpacing

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
cassandra:
image: cassandra:2.1

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
cassandra:
image: cassandra:2.1

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
oai_enb0:
image: oaisoftwarealliance/oai-enb:develop

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
cassandra:
image: cassandra:2.1

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
cassandra:
image: cassandra:2.1

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
oai_enb0:
image: oaisoftwarealliance/oai-enb:develop

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
oai_enb0:
image: oaisoftwarealliance/oai-enb:develop

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
cassandra:
image: cassandra:2.1

View File

@@ -1,4 +1,3 @@
version: '3.8'
services:
mysql:
container_name: "rfsim5g-mysql"

View File

@@ -1,4 +1,3 @@
version: '3.8'
services:
mysql:
container_name: "rfsim5g-mysql"

View File

@@ -1,4 +1,3 @@
version: '3.8'
services:
mysql:
container_name: "l2sim-mysql"

View File

@@ -1,4 +1,3 @@
version: '3.8'
services:
mysql:
container_name: "rfsim5g-mysql"

View File

@@ -1,4 +1,3 @@
version: '3.8'
services:
mysql:
container_name: "rfsim5g-mysql"

View File

@@ -1,4 +1,3 @@
version: '3.8'
services:
mysql:
container_name: "rfsim5g-mysql"

View File

@@ -1,4 +1,3 @@
version: '3.8'
services:
oai-du:
image: oaisoftwarealliance/oai-gnb:develop

View File

@@ -1,4 +1,3 @@
version: '3.8'
services:
mysql:
container_name: "rfsim5g-mysql"

View File

@@ -1,4 +1,3 @@
version: '3.8'
services:
oai-gnb:
image: oaisoftwarealliance/oai-gnb:develop

View File

@@ -1,4 +1,3 @@
version: '3.8'
services:
mysql:
container_name: "rfsim5g-mysql"

View File

@@ -1,4 +1,3 @@
version: '3.8'
services:
oai-gnb:
image: oaisoftwarealliance/oai-gnb:develop

View File

@@ -1,4 +1,3 @@
version: '3.8'
services:
mysql:
container_name: "rfsim5g-mysql"

View File

@@ -1,4 +1,3 @@
version: '3.8'
services:
oai-nr-ue:
image: oai-nr-ue:latest

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
enb_mono_fdd:
image: oai-enb:latest

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
cassandra:
image: cassandra:2.1

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
rru_fdd:
image: oai-enb:latest

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
enb_mono_fdd:
image: oai-enb:latest

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
enb_mono_fdd:
image: oai-enb:latest

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
lte_ue0:
image: oai-lte-ue:latest

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
enb_mono_fdd:
image: oai-enb:latest

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
enb_mono_fdd:
image: oai-enb:latest

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
enb_mono_fdd:
image: oai-enb:latest

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
enb_mono_fdd:
image: oai-enb:latest

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
rru_tdd:
image: oai-enb:latest

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
enb_mono_tdd:
image: oai-enb:latest

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
enb_mono_tdd:
image: oai-enb:latest

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
enb_mono_tdd:
image: oai-enb:latest

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
enb_mono_tdd:
image: oai-enb:latest

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
enb_mono_tdd:
image: oai-enb:latest

View File

@@ -1,4 +1,3 @@
version: '3.8'
services:
oai-enb:
image: oai-enb:latest

View File

@@ -1,4 +1,3 @@
version: '3.8'
services:
oai-enb:
image: oai-enb:latest

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
cassandra:
image: cassandra:2.1

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
cassandra:
image: cassandra:2.1

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
enb_mono_fdd:
image: oai-enb:latest

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
gnb_mono_tdd:
image: oai-gnb:latest

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
gnb_mono_tdd:
image: oai-gnb:latest

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
gnb_cucp:
image: oai-gnb:latest

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
gnb_cu:
image: oai-gnb:latest

View File

@@ -1,4 +1,3 @@
version: "3.8"
services:
nv-cubb:
container_name: nv-cubb

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
gnb_mono_tdd:
image: oai-gnb:latest

View File

@@ -118,10 +118,12 @@ const nr_bandentry_t nr_bandtable[] = {
{5, 824000, 849000, 869000, 894000, 20, 173800, 100},
{7, 2500000, 2570000, 2620000, 2690000, 20, 524000, 100},
{8, 880000, 915000, 925000, 960000, 20, 185000, 100},
{12, 698000, 716000, 729000, 746000, 20, 145800, 100},
{12, 699000, 716000, 729000, 746000, 20, 145800, 100},
{13, 777000, 787000, 746000, 756000, 20, 149200, 100},
{14, 788000, 798000, 758000, 768000, 20, 151600, 100},
{18, 815000, 830000, 860000, 875000, 20, 172000, 100},
{20, 832000, 862000, 791000, 821000, 20, 158200, 100},
{24, 1627500, 1656500, 1526000, 1536000, 20, 305000, 100},
{25, 1850000, 1915000, 1930000, 1995000, 20, 386000, 100},
{26, 814000, 849000, 859000, 894000, 20, 171800, 100},
{28, 703000, 758000, 758000, 813000, 20, 151600, 100},
@@ -141,6 +143,7 @@ const nr_bandentry_t nr_bandtable[] = {
{53, 2483500, 2495000, 2483500, 2495000, 20, 496700, 100},
{65, 1920000, 2010000, 2110000, 2200000, 20, 422000, 100},
{66, 1710000, 1780000, 2110000, 2200000, 20, 422000, 100},
{67, 000, 000, 738000, 758000, 20, 147600, 100},
{70, 1695000, 1710000, 1995000, 2020000, 20, 399000, 100},
{71, 663000, 698000, 617000, 652000, 20, 123400, 100},
{74, 1427000, 1470000, 1475000, 1518000, 20, 295000, 100},
@@ -157,6 +160,7 @@ const nr_bandentry_t nr_bandtable[] = {
{82, 832000, 862000, 000, 000, 20, 166400, 100},
{83, 703000, 748000, 000, 000, 20, 140600, 100},
{84, 1920000, 1980000, 000, 000, 20, 384000, 100},
{85, 698000, 716000, 728000, 746000, 20, 145600, 100},
{86, 1710000, 1785000, 000, 000, 20, 342000, 100},
{89, 824000, 849000, 000, 000, 20, 342000, 100},
{90, 2496000, 2690000, 2496000, 2690000, 3, 499200, 15},

View File

@@ -21,7 +21,7 @@ In this tutorial we describe how to configure and run a 5G end-to-end setup with
Minimum hardware requirements:
- Laptop/Desktop/Server for OAI CN5G and OAI gNB
- Operating System: [Ubuntu 22.04 LTS](https://releases.ubuntu.com/22.04/ubuntu-22.04.3-desktop-amd64.iso)
- Operating System: [Ubuntu 22.04 LTS](https://releases.ubuntu.com/22.04/ubuntu-22.04.4-desktop-amd64.iso)
- CPU: 8 cores x86_64 @ 3.5 GHz
- RAM: 32 GB
- Laptop for UE

View File

@@ -21,7 +21,7 @@ In this tutorial we describe how to configure and run a 5G end-to-end setup with
Minimum hardware requirements:
- Laptop/Desktop/Server for OAI CN5G and OAI gNB
- Operating System: [Ubuntu 22.04 LTS](https://releases.ubuntu.com/22.04/ubuntu-22.04.3-desktop-amd64.iso)
- Operating System: [Ubuntu 22.04 LTS](https://releases.ubuntu.com/22.04/ubuntu-22.04.4-desktop-amd64.iso)
- CPU: 8 cores x86_64 @ 3.5 GHz
- RAM: 32 GB

View File

@@ -21,11 +21,11 @@ In this tutorial we describe how to configure and run a 5G end-to-end setup with
Minimum hardware requirements:
- Laptop/Desktop/Server for OAI CN5G and OAI gNB
- Operating System: [Ubuntu 22.04 LTS](https://releases.ubuntu.com/22.04/ubuntu-22.04.3-desktop-amd64.iso)
- Operating System: [Ubuntu 22.04 LTS](https://releases.ubuntu.com/22.04/ubuntu-22.04.4-desktop-amd64.iso)
- CPU: 8 cores x86_64 @ 3.5 GHz
- RAM: 32 GB
- Laptop for UE
- Operating System: [Ubuntu 22.04 LTS](https://releases.ubuntu.com/22.04/ubuntu-22.04.3-desktop-amd64.iso)
- Operating System: [Ubuntu 22.04 LTS](https://releases.ubuntu.com/22.04/ubuntu-22.04.4-desktop-amd64.iso)
- CPU: 8 cores x86_64 @ 3.5 GHz
- RAM: 8 GB
- [USRP B210](https://www.ettus.com/all-products/ub210-kit/), [USRP N300](https://www.ettus.com/all-products/USRP-N300/) or [USRP X300](https://www.ettus.com/all-products/x300-kit/)

View File

@@ -114,11 +114,7 @@ database:
## general single_nssai configuration
## Defines YAML anchors, which are reused in the config file
snssais:
- &embb_slice1
sst: 1
- &embb_slice2
sst: 1
- &embb_slice3
- &embb_slice
sst: 1
############## NF-specific configuration
@@ -145,9 +141,7 @@ amf:
mnc: 01
tac: 0x0001
nssai:
- *embb_slice1
- *embb_slice2
- *embb_slice3
- *embb_slice
supported_integrity_algorithms:
- "NIA1"
- "NIA2"
@@ -178,29 +172,25 @@ smf:
# follows the SmfInfo datatype from 3GPP TS 29.510
smf_info:
sNssaiSmfInfoList:
- sNssai: *embb_slice1
- sNssai: *embb_slice
dnnSmfInfoList:
- dnn: "oai"
- sNssai: *embb_slice2
dnnSmfInfoList:
- dnn: "openairinterface"
- sNssai: *embb_slice3
dnnSmfInfoList:
- dnn: "ims"
local_subscription_infos:
- single_nssai: *embb_slice1
- single_nssai: *embb_slice
dnn: "oai"
qos_profile:
5qi: 9
session_ambr_ul: "10Gbps"
session_ambr_dl: "10Gbps"
- single_nssai: *embb_slice2
- single_nssai: *embb_slice
dnn: "openairinterface"
qos_profile:
5qi: 9
session_ambr_ul: "10Gbps"
session_ambr_dl: "10Gbps"
- single_nssai: *embb_slice3
- single_nssai: *embb_slice
dnn: "ims"
qos_profile:
5qi: 9
@@ -216,14 +206,10 @@ upf:
- host: oai-smf # To be used for PFCP association in case of no-NRF
upf_info:
sNssaiUpfInfoList:
- sNssai: *embb_slice1
- sNssai: *embb_slice
dnnUpfInfoList:
- dnn: "oai"
- sNssai: *embb_slice2
dnnUpfInfoList:
- dnn: "openairinterface"
- sNssai: *embb_slice3
dnnUpfInfoList:
- dnn: "ims"
## DNN configuration

View File

@@ -1,4 +1,3 @@
version: '3.8'
services:
mysql:
container_name: "mysql"
@@ -168,14 +167,11 @@ services:
public_net:
ipv4_address: 192.168.70.135
networks:
# public_net:
# external:
# name: demo-oai-public-net
public_net:
driver: bridge
name: demo-oai-public-net
name: oai-cn5g-public-net
ipam:
config:
- subnet: 192.168.70.128/26
driver_opts:
com.docker.network.bridge.name: "demo-oai"
com.docker.network.bridge.name: "oai-cn5g"

View File

@@ -93,12 +93,6 @@ void stop_RU(RU_t **rup,int nb_ru);
static void do_ru_synch(RU_t *ru);
void configure_ru(int idx,
void *arg);
void configure_rru(int idx,
void *arg);
void reset_proc(RU_t *ru);
int connect_rau(RU_t *ru);
@@ -2183,8 +2177,6 @@ int stop_rf(RU_t *ru) {
return 0;
}
extern void configure_ru(int idx, void *arg);
extern void fep_full(RU_t *ru, int subframe);
extern void feptx_ofdm(RU_t *ru, int frame_tx, int tti_tx);
extern void feptx_ofdm_2thread(RU_t *ru, int frame_tx, int tti_tx);

View File

@@ -189,8 +189,6 @@ void kill_feptx_thread(RU_t *ru);
void init_fep_thread(RU_t *ru, pthread_attr_t *attr_fep);
void init_feptx_thread(RU_t *ru, pthread_attr_t *attr_feptx);
void fep_full(RU_t *ru, int subframe);
void configure_ru(int, void *arg);
void configure_rru(int, void *arg);
void ru_fep_full_2thread(RU_t *ru,int subframe);
void feptx_ofdm(RU_t*ru, int frame_tx, int tti_tx);
void feptx_prec(struct RU_t_s *ru, int frame_tx, int tti_tx);

View File

@@ -106,11 +106,10 @@ time_stats_t softmodem_stats_rx_sf; // total rx time
//#define TICK_TO_US(ts) (ts.diff)
#define TICK_TO_US(ts) (ts.trials==0?0:ts.diff/ts.trials)
#define L1STATSSTRLEN 16384
static void rx_func(processingData_L1_t *param);
static void tx_func(void *param)
static void tx_func(processingData_L1tx_t *info)
{
processingData_L1tx_t *info = (processingData_L1tx_t *) param;
int frame_tx = info->frame;
int slot_tx = info->slot;
int frame_rx = info->frame_rx;
@@ -176,7 +175,6 @@ static void tx_func(void *param)
deref_sched_response(info->sched_response_id);
}
void *L1_rx_thread(void *arg)
{
PHY_VARS_gNB *gNB = (PHY_VARS_gNB*)arg;
@@ -206,9 +204,8 @@ void *L1_tx_thread(void *arg) {
return NULL;
}
void rx_func(void *param)
static void rx_func(processingData_L1_t *info)
{
processingData_L1_t *info = (processingData_L1_t *) param;
PHY_VARS_gNB *gNB = info->gNB;
int frame_rx = info->frame_rx;
int slot_rx = info->slot_rx;
@@ -387,7 +384,7 @@ void init_gNB_Tpool(int inst) {
// create the TX thread responsible for TX processing start event (L1_tx_out msg queue), then launch tx_func()
threadCreate(&gNB->L1_tx_thread, L1_tx_thread, (void *)gNB, "L1_tx_thread", gNB->L1_tx_thread_core, OAI_PRIORITY_RT_MAX);
notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t), 0, &gNB->L1_tx_out, tx_func);
notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t), 0, &gNB->L1_tx_out, NULL);
processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx);
memset(msgDataTx, 0, sizeof(processingData_L1tx_t));
init_DLSCH_struct(gNB, msgDataTx);

View File

@@ -53,14 +53,6 @@
#include "common/utils/LOG/vcd_signal_dumper.h"
#include <executables/softmodem-common.h>
#ifdef SMBV
#include "PHY/TOOLS/smbv.h"
unsigned short config_frames[4] = {2,9,11,13};
#endif
/* these variables have to be defined before including ENB_APP/enb_paramdef.h and GNB_APP/gnb_paramdef.h */
static int DEFBANDS[] = {7};
static int DEFENBS[] = {0};
@@ -81,35 +73,14 @@ static int DEFRUTPCORES[] = {-1,-1,-1,-1};
#include "T.h"
#include "nfapi_interface.h"
#include <nfapi/oai_integration/vendor_ext.h>
extern int oai_exit;
#include "executables/nr-softmodem-common.h"
uint16_t sl_ahead;
extern struct timespec timespec_sub(struct timespec lhs, struct timespec rhs);
extern struct timespec timespec_add(struct timespec lhs, struct timespec rhs);
extern void nr_phy_free_RU(RU_t *);
extern void nr_phy_config_request(NR_PHY_Config_t *gNB);
#include "executables/thread-common.h"
//extern PARALLEL_CONF_t get_thread_parallel_conf(void);
//extern WORKER_CONF_t get_thread_worker_conf(void);
void stop_RU(int nb_ru);
void configure_ru(int idx, void *arg);
void configure_rru(int idx, void *arg);
int attach_rru(RU_t *ru);
int connect_rau(RU_t *ru);
static void NRRCconfig_RU(configmodule_interface_t *cfg);
extern int emulate_rf;
extern int numerology;
/*************************************************************/
/* Functions to attach and configure RRU */
extern void wait_gNBs(void);
int attach_rru(RU_t *ru) {
ssize_t msg_len,len;
RRU_CONFIG_msg_t rru_config_msg;
@@ -146,8 +117,7 @@ int attach_rru(RU_t *ru) {
}
}
configure_ru(ru->idx,
(RRU_capabilities_t *)&rru_config_msg.msg[0]);
configure_ru(ru, (RRU_capabilities_t *)&rru_config_msg.msg[0]);
rru_config_msg.type = RRU_config;
rru_config_msg.len = sizeof(RRU_CONFIG_msg_t)-MAX_RRU_CONFIG_SIZE+sizeof(RRU_config_t);
LOG_I(PHY,"Sending Configuration to RRU %d (num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL %d,3/4FS %d, prach_FO %d, prach_CI %d)\n",ru->idx,
@@ -263,8 +233,7 @@ int connect_rau(RU_t *ru) {
((RRU_config_t *)&rru_config_msg.msg[0])->threequarter_fs[0],
((RRU_config_t *)&rru_config_msg.msg[0])->prach_FreqOffset[0],
((RRU_config_t *)&rru_config_msg.msg[0])->prach_ConfigIndex[0]);
configure_rru(ru->idx,
(void *)&rru_config_msg.msg[0]);
configure_rru(ru, (void *)&rru_config_msg.msg[0]);
configuration_received = 1;
}
}
@@ -1120,9 +1089,11 @@ void ru_tx_func(void *param) {
if(!emulate_rf) {
// do outgoing fronthaul (south) if needed
if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out)) ru->fh_south_out(ru,frame_tx,slot_tx,info->timestamp_tx);
if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out))
ru->fh_south_out(ru, frame_tx, slot_tx, info->timestamp_tx);
if (ru->fh_north_out) ru->fh_north_out(ru);
if (ru->fh_north_out)
ru->fh_north_out(ru);
} else {
if(frame_tx == print_frame) {
for (int i=0; i<ru->nb_tx; i++) {
@@ -1289,13 +1260,12 @@ void *ru_thread( void *param ) {
// We should make a VNF main loop with proper tasks calls in case of VNF
slot_start = timespec_add(slot_start,slot_duration);
struct timespec curr_time;
clock_gettime(CLOCK_MONOTONIC, &curr_time);
clock_gettime(CLOCK_MONOTONIC, &curr_time);
struct timespec sleep_time;
if((slot_start.tv_sec > curr_time.tv_sec) || (slot_start.tv_sec == curr_time.tv_sec && slot_start.tv_nsec > curr_time.tv_nsec)){
if((slot_start.tv_sec > curr_time.tv_sec) ||
(slot_start.tv_sec == curr_time.tv_sec && slot_start.tv_nsec > curr_time.tv_nsec)){
sleep_time = timespec_sub(slot_start,curr_time);
usleep(sleep_time.tv_nsec * 1e-3);
}
}
@@ -1377,10 +1347,10 @@ void *ru_thread( void *param ) {
if (!res)
break;
}
ru->feprx(ru,proc->tti_rx);
// set the tti that was generated to busy
LOG_D(NR_PHY, "Setting %d.%d (%d) to busy\n", proc->frame_rx, proc->tti_rx, proc->tti_rx % RU_RX_SLOT_DEPTH);
rx_tti_busy[proc->tti_rx % RU_RX_SLOT_DEPTH] = true;
ru->feprx(ru,proc->tti_rx);
LOG_D(NR_PHY, "Setting %d.%d (%d) to busy\n", proc->frame_rx, proc->tti_rx, proc->tti_rx % RU_RX_SLOT_DEPTH);
clock_gettime(CLOCK_MONOTONIC,&ru->rt_ru_profiling.return_RU_feprx[rt_prof_idx]);
//LOG_M("rxdata.m","rxs",ru->common.rxdata[0],1228800,1,1);
LOG_D(PHY,"RU proc: frame_rx = %d, tti_rx = %d\n", proc->frame_rx, proc->tti_rx);
@@ -1486,10 +1456,8 @@ void init_RU_proc(RU_t *ru) {
if(emulate_rf)
threadCreate( &proc->pthread_emulateRF, emulatedRF_thread, (void *)proc, "emulateRF", -1, OAI_PRIORITY_RT );
if (opp_enabled == 1)
threadCreate( &ru->ru_stats_thread, ru_stats_thread, (void *)ru,"ru_stats", -1, OAI_PRIORITY_RT );
if (get_thread_worker_conf() == WORKER_ENABLE) {
}
if (opp_enabled == 1)
threadCreate(&ru->ru_stats_thread, ru_stats_thread, (void *)ru, "ru_stats", -1, OAI_PRIORITY_RT);
LOG_I(PHY, "Initialized RU proc %d (%s,%s),\n", ru->idx, NB_functions[ru->function], NB_timing[ru->if_timing]);
}
@@ -1585,19 +1553,19 @@ const char rru_format_options[4][20] = {"OAI_IF5_only", "OAI_IF4p5_only", "OAI_I
const char rru_formats[3][20] = {"OAI_IF5", "MBP_IF5", "OAI_IF4p5"};
const char ru_if_formats[4][20] = {"LOCAL_RF", "REMOTE_OAI_IF5", "REMOTE_MBP_IF5", "REMOTE_OAI_IF4p5"};
void configure_ru(int idx,
void *arg) {
RU_t *ru = RC.ru[idx];
void configure_ru(void *ruu, void *arg)
{
RU_t *ru = (RU_t *)ruu;
RRU_config_t *config = (RRU_config_t *)arg;
RRU_capabilities_t *capabilities = (RRU_capabilities_t *)arg;
nfapi_nr_config_request_scf_t *cfg = &ru->config;
int ret;
LOG_I(PHY, "Received capabilities from RRU %d\n",idx);
LOG_I(PHY, "Received capabilities from RRU %d\n", ru->idx);
if (capabilities->FH_fmt < MAX_FH_FMTs) LOG_I(PHY, "RU FH options %s\n",rru_format_options[capabilities->FH_fmt]);
ret = check_capabilities(ru,capabilities);
AssertFatal(ret == 0, "Cannot configure RRU %d, check_capabilities returned %d\n", idx, ret);
AssertFatal(ret == 0, "Cannot configure RRU %d, check_capabilities returned %d\n", ru->idx, ret);
// take antenna capabilities of RRU
ru->nb_tx = capabilities->nb_tx[0];
ru->nb_rx = capabilities->nb_rx[0];
@@ -1625,10 +1593,10 @@ void configure_ru(int idx,
nr_phy_init_RU(ru);
}
void configure_rru(int idx,
void *arg) {
void configure_rru(void *ruu, void *arg)
{
RRU_config_t *config = (RRU_config_t *)arg;
RU_t *ru = RC.ru[idx];
RU_t *ru = (RU_t *)ruu;
nfapi_nr_config_request_scf_t *cfg = &ru->config;
ru->nr_frame_parms->nr_band = config->band_list[0];
ru->nr_frame_parms->dl_CarrierFreq = config->tx_freq[0];

View File

@@ -151,5 +151,5 @@ extern double cpuf;
extern int emulate_rf;
extern int numerology;
extern int usrp_tx_thread;
void wait_gNBs(void);
#endif

View File

@@ -526,6 +526,14 @@ void processSlotTX(void *arg)
PHY_VARS_NR_UE *UE = rxtxD->UE;
nr_phy_data_tx_t phy_data = {0};
// Force sequential execution, even if we launch in // for all slots
// at least ULstatus variable is a pure race condition that is quickly detected by assert() in the code because one thread sets it
// to active, so the other thread try to steal&run the ul work
if (rxtxD->stream_status == STREAM_STATUS_SYNCED) {
notifiedFIFO_elt_t *res = pullNotifiedFIFO(UE->tx_resume_ind_fifo + proc->nr_slot_tx);
delNotifiedFIFO_elt(res);
}
if (UE->if_inst)
UE->if_inst->slot_indication(UE->Mod_id);
@@ -560,11 +568,6 @@ void processSlotTX(void *arg)
instead,
we may run in place the processSlotTX() when the conditions are met (when a decreasing tx_wait_for_dlsch[slot] will become 0)
It will remove the condition signals (for a thread safe semaphore or counter) and make the system simpler
This require also other modifications to
remove txFifo that is also a big issue
add out of order RF board sending, because,
if we encode and send tx slot as soon as we can,
it will be thrown out of order, especially in TDD mode
*/
notifiedFIFO_elt_t *res = pollNotifiedFIFO(UE->tx_resume_ind_fifo + proc->nr_slot_tx);
if (res)
@@ -590,6 +593,11 @@ void processSlotTX(void *arg)
phy_procedures_nrUE_TX(UE, proc, &phy_data);
}
notifiedFIFO_elt_t *newElt = newNotifiedFIFO_elt(sizeof(int), 0, NULL, NULL);
int *msgData = (int *)NotifiedFifoData(newElt);
int newslot = (proc->nr_slot_tx + 1) % UE->frame_parms.slots_per_frame;
*msgData = newslot;
pushNotifiedFIFO(UE->tx_resume_ind_fifo + newslot, newElt);
RU_write(rxtxD);
}
@@ -743,7 +751,7 @@ void *UE_thread(void *arg)
PHY_VARS_NR_UE *UE = (PHY_VARS_NR_UE *) arg;
// int tx_enabled = 0;
void *rxp[NB_ANTENNAS_RX];
int start_rx_stream = 0;
enum stream_status_e stream_status = STREAM_STATUS_UNSYNC;
fapi_nr_config_request_t *cfg = &UE->nrUE_config;
int tmp = openair0_device_load(&(UE->rfdevice), &openair0_cfg[0]);
AssertFatal(tmp == 0, "Could not load the device\n");
@@ -755,9 +763,6 @@ void *UE_thread(void *arg)
notifiedFIFO_t nf;
initNotifiedFIFO(&nf);
notifiedFIFO_t txFifo;
initNotifiedFIFO(&txFifo);
notifiedFIFO_t freeBlocks;
initNotifiedFIFO_nothreadSafe(&freeBlocks);
@@ -796,7 +801,7 @@ void *UE_thread(void *arg)
intialSyncOffset = syncMsg->rx_offset;
}
delNotifiedFIFO_elt(res);
start_rx_stream = 0;
stream_status = STREAM_STATUS_UNSYNC;
} else {
if (IS_SOFTMODEM_IQPLAYER || IS_SOFTMODEM_IQRECORDER) {
// For IQ recorder-player we force synchronization to happen in 280 ms
@@ -826,9 +831,10 @@ void *UE_thread(void *arg)
continue;
}
if (start_rx_stream == 0) {
start_rx_stream=1;
if (stream_status == STREAM_STATUS_UNSYNC) {
stream_status = STREAM_STATUS_SYNCING;
syncInFrame(UE, &sync_timestamp, intialSyncOffset);
openair0_write_reorder_clear_context(&UE->rfdevice);
shiftForNextFrame = 0; // will be used to track clock drift
// read in first symbol
AssertFatal(UE->frame_parms.ofdm_symbol_size + UE->frame_parms.nb_prefix_samples0
@@ -937,25 +943,18 @@ void *UE_thread(void *arg)
// Start TX slot processing here. It runs in parallel with RX slot processing
// in current code, DURATION_RX_TO_TX constant is the limit to get UL data to encode from a RX slot
notifiedFIFO_elt_t *newTx = newNotifiedFIFO_elt(sizeof(nr_rxtx_thread_data_t), curMsg.proc.nr_slot_tx, &txFifo, processSlotTX);
notifiedFIFO_elt_t *newTx = newNotifiedFIFO_elt(sizeof(nr_rxtx_thread_data_t), curMsg.proc.nr_slot_tx, NULL, processSlotTX);
nr_rxtx_thread_data_t *curMsgTx = (nr_rxtx_thread_data_t *)NotifiedFifoData(newTx);
curMsgTx->proc = curMsg.proc;
curMsgTx->writeBlockSize = writeBlockSize;
curMsgTx->proc.timestamp_tx = writeTimestamp;
curMsgTx->UE = UE;
curMsgTx->tx_wait_for_dlsch = tx_wait_for_dlsch[curMsgTx->proc.nr_slot_tx];
curMsgTx->stream_status = stream_status;
stream_status = STREAM_STATUS_SYNCED;
tx_wait_for_dlsch[curMsgTx->proc.nr_slot_tx] = 0;
pushTpool(&(get_nrUE_params()->Tpool), newTx);
// Wait for TX slot processing to finish
// Should be removed when bugs, race conditions, will be fixed
notifiedFIFO_elt_t *res;
res = pullTpool(&txFifo, &(get_nrUE_params()->Tpool));
if (res == NULL)
LOG_E(PHY, "Tpool has been aborted\n");
else
delNotifiedFIFO_elt(res);
} // while !oai_exit
}
return NULL;
}

View File

@@ -62,13 +62,11 @@
#include "SCHED/sched_eNB.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "PHY/INIT/phy_init.h"
#include "executables/softmodem-common.h"
#include "common/utils/LOG/log.h"
int attach_rru(RU_t *ru);
void configure_ru(RU_t *ru, void *arg);
void configure_rru(RU_t *ru, void *arg);
void fill_rf_config(RU_t *ru, char *rf_config_file);
void* ru_thread_control( void* param );
@@ -372,9 +370,9 @@ int check_capabilities(RU_t *ru,
return(-1);
}
void configure_ru(RU_t *ru,
void *arg)
void configure_ru(void *ruu, void *arg)
{
RU_t *ru = (RU_t *)ruu;
RRU_config_t *config = (RRU_config_t *)arg;
RRU_capabilities_t *capabilities = (RRU_capabilities_t*)arg;
int ret;
@@ -423,9 +421,9 @@ void configure_ru(RU_t *ru,
phy_init_RU(ru);
}
void configure_rru(RU_t *ru,
void *arg)
void configure_rru(void *ruu, void *arg)
{
RU_t *ru = (RU_t *)ruu;
RRU_config_t *config = (RRU_config_t *)arg;
ru->frame_parms->eutra_band = config->band_list[0];

View File

@@ -372,8 +372,11 @@ extern uint16_t sl_ahead;
extern uint16_t sf_ahead;
extern int oai_exit;
void rx_func(void *param);
void ru_tx_func(void *param);
void configure_ru(void *, void *arg);
void configure_rru(void *, void *arg);
struct timespec timespec_add(struct timespec lhs, struct timespec rhs);
struct timespec timespec_sub(struct timespec lhs, struct timespec rhs);
extern uint8_t nfapi_mode;
extern int16_t vnf_pnf_sfnslot_delta;
#ifdef __cplusplus

View File

@@ -621,7 +621,7 @@ uint32_t polar_decoder_int16(int16_t *input,
uint8_t ones_flag,
int8_t messageType,
uint16_t messageLength,
uint8_t aggregation_level )
uint8_t aggregation_level)
{
t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true);
@@ -638,7 +638,13 @@ uint32_t polar_decoder_int16(int16_t *input,
#endif
int16_t d_tilde[polarParams->N];
nr_polar_rate_matching_int16(input, d_tilde, polarParams->rate_matching_pattern, polarParams->K, polarParams->N, polarParams->encoderLength, polarParams->i_bil);
nr_polar_rate_matching_int16(input,
d_tilde,
polarParams->rate_matching_pattern,
polarParams->K,
polarParams->N,
polarParams->encoderLength,
polarParams->i_bil);
for (int i=0; i<polarParams->N; i++) {
if (d_tilde[i]<-128) d_tilde[i]=-128;
@@ -792,13 +798,20 @@ uint32_t polar_decoder_int16(int16_t *input,
printf("\n\n");
#endif
#if 0
printf("A %llx B %llx|%llx Cprime %llx|%llx (crc %x,rxcrc %llx %d)\n",
#ifdef POLAR_CODING_DEBUG
printf("A %lx B %lx|%lx Cprime %lx|%lx (crc %x,rxcrc %lx, XOR %lx, bits%d)\n",
Ar,
B[1],B[0],Cprime[1],Cprime[0],crc,
rxcrc,polarParams->payloadBits);
B[1],
B[0],
Cprime[1],
Cprime[0],
crc,
rxcrc,
crc^rxcrc,
polarParams->payloadBits);
#endif
out[0]=Ar;
out[0] = Ar;
polarReturn crc^rxcrc;
}

View File

@@ -488,12 +488,12 @@ void build_polar_tables(t_nrPolar_params *polarParams) {
void polar_encoder_fast(uint64_t *A,
void *out,
int32_t crcmask,
uint8_t ones_flag,
int8_t messageType,
uint16_t messageLength,
uint8_t aggregation_level) {
int32_t crcmask,
uint8_t ones_flag,
int8_t messageType,
uint16_t messageLength,
uint8_t aggregation_level)
{
t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false);
#ifdef POLAR_CODING_DEBUG

View File

@@ -98,7 +98,7 @@ int nr_phy_init_RU(RU_t *ru) {
ru->common.rxdataF = (int32_t**)malloc16(ru->nb_rx*sizeof(int32_t*) );
for (i=0; i<ru->nb_rx; i++) {
// allocate 4 slots of I/Q signal data (frequency)
ru->common.rxdataF[i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(4*fp->symbols_per_slot*fp->ofdm_symbol_size) );
ru->common.rxdataF[i] = (int32_t*)malloc16_clear(sizeof(**ru->common.rxdataF)*(RU_RX_SLOT_DEPTH*fp->symbols_per_slot*fp->ofdm_symbol_size) );
LOG_I(PHY,"rxdataF[%d] %p for RU %d\n",i,ru->common.rxdataF[i],ru->idx);
}

View File

@@ -645,7 +645,7 @@ void clean_UE_harq(PHY_VARS_NR_UE *UE)
for (int harq_pid = 0; harq_pid < NR_MAX_ULSCH_HARQ_PROCESSES; harq_pid++) {
NR_UL_UE_HARQ_t *ul_harq_process = &UE->ul_harq_processes[harq_pid];
ul_harq_process->tx_status = NEW_TRANSMISSION_HARQ;
ul_harq_process->status = SCH_IDLE;
ul_harq_process->ULstatus = SCH_IDLE;
ul_harq_process->round = 0;
}
}

View File

@@ -29,17 +29,61 @@ static const uint32_t nr_subcarrier_spacing[MAX_NUM_SUBCARRIER_SPACING] = {15e3,
static const uint16_t nr_slots_per_subframe[MAX_NUM_SUBCARRIER_SPACING] = {1, 2, 4, 8, 16};
// Table 5.4.3.3-1 38-101
static const int nr_ssb_table[48][3] = {
{1, 15, nr_ssb_type_A}, {2, 15, nr_ssb_type_A}, {3, 15, nr_ssb_type_A}, {5, 15, nr_ssb_type_A}, {5, 30, nr_ssb_type_B},
{7, 15, nr_ssb_type_A}, {8, 15, nr_ssb_type_A}, {12, 15, nr_ssb_type_A}, {14, 15, nr_ssb_type_A}, {18, 15, nr_ssb_type_A},
{20, 15, nr_ssb_type_A}, {25, 15, nr_ssb_type_A}, {26, 15, nr_ssb_type_A}, {28, 15, nr_ssb_type_A}, {29, 15, nr_ssb_type_A},
{30, 15, nr_ssb_type_A}, {34, 15, nr_ssb_type_A}, {34, 30, nr_ssb_type_C}, {38, 15, nr_ssb_type_A}, {38, 30, nr_ssb_type_C},
{39, 15, nr_ssb_type_A}, {39, 30, nr_ssb_type_C}, {40, 30, nr_ssb_type_C}, {41, 15, nr_ssb_type_A}, {41, 30, nr_ssb_type_C},
{46, 30, nr_ssb_type_C}, {48, 30, nr_ssb_type_C}, {50, 30, nr_ssb_type_C}, {51, 15, nr_ssb_type_A}, {53, 15, nr_ssb_type_A},
{65, 15, nr_ssb_type_A}, {66, 15, nr_ssb_type_A}, {66, 30, nr_ssb_type_B}, {70, 15, nr_ssb_type_A}, {71, 15, nr_ssb_type_A},
{74, 15, nr_ssb_type_A}, {75, 15, nr_ssb_type_A}, {76, 15, nr_ssb_type_A}, {77, 30, nr_ssb_type_C}, {78, 30, nr_ssb_type_C},
{79, 30, nr_ssb_type_C}, {90, 15, nr_ssb_type_A}, {90, 30, nr_ssb_type_C}, {91, 15, nr_ssb_type_A}, {92, 15, nr_ssb_type_A},
{93, 15, nr_ssb_type_A}, {94, 15, nr_ssb_type_A}, {96, 30, nr_ssb_type_C}};
static const int nr_ssb_table[54][3] = {
{1, 15, nr_ssb_type_A},
{2, 15, nr_ssb_type_A},
{3, 15, nr_ssb_type_A},
{5, 15, nr_ssb_type_A},
{5, 30, nr_ssb_type_B},
{7, 15, nr_ssb_type_A},
{8, 15, nr_ssb_type_A},
{12, 15, nr_ssb_type_A},
{13, 15, nr_ssb_type_A},
{14, 15, nr_ssb_type_A},
{18, 15, nr_ssb_type_A},
{20, 15, nr_ssb_type_A},
{24, 15, nr_ssb_type_A},
{24, 30, nr_ssb_type_B},
{25, 15, nr_ssb_type_A},
{26, 15, nr_ssb_type_A},
{28, 15, nr_ssb_type_A},
{29, 15, nr_ssb_type_A},
{30, 15, nr_ssb_type_A},
{34, 15, nr_ssb_type_A},
{34, 30, nr_ssb_type_C},
{38, 15, nr_ssb_type_A},
{38, 30, nr_ssb_type_C},
{39, 15, nr_ssb_type_A},
{39, 30, nr_ssb_type_C},
{40, 30, nr_ssb_type_C},
{41, 15, nr_ssb_type_A},
{41, 30, nr_ssb_type_C},
{46, 30, nr_ssb_type_C},
{48, 30, nr_ssb_type_C},
{50, 30, nr_ssb_type_C},
{51, 15, nr_ssb_type_A},
{53, 15, nr_ssb_type_A},
{53, 30, nr_ssb_type_C},
{65, 15, nr_ssb_type_A},
{66, 15, nr_ssb_type_A},
{66, 30, nr_ssb_type_B},
{67, 15, nr_ssb_type_A},
{70, 15, nr_ssb_type_A},
{71, 15, nr_ssb_type_A},
{74, 15, nr_ssb_type_A},
{75, 15, nr_ssb_type_A},
{76, 15, nr_ssb_type_A},
{77, 30, nr_ssb_type_C},
{78, 30, nr_ssb_type_C},
{79, 30, nr_ssb_type_C},
{85, 15, nr_ssb_type_A},
{90, 15, nr_ssb_type_A},
{90, 30, nr_ssb_type_C},
{91, 15, nr_ssb_type_A},
{92, 15, nr_ssb_type_A},
{93, 15, nr_ssb_type_A},
{94, 15, nr_ssb_type_A},
{96, 30, nr_ssb_type_C}};
void set_Lmax(NR_DL_FRAME_PARMS *fp) {
if (get_softmodem_params()->sl_mode == 2) {

View File

@@ -73,8 +73,8 @@ int16_t find_nr_prach(PHY_VARS_gNB *gNB,int frame, int slot, find_type_t type) {
void nr_fill_prach(PHY_VARS_gNB *gNB,
int SFN,
int Slot,
nfapi_nr_prach_pdu_t *prach_pdu) {
nfapi_nr_prach_pdu_t *prach_pdu)
{
int prach_id = find_nr_prach(gNB,SFN,Slot,SEARCH_EXIST_OR_FREE);
AssertFatal(((prach_id >= 0) && (prach_id < NUMBER_OF_NR_PRACH_MAX)), "illegal or no prach_id found!!! prach_id %d\n", prach_id);

View File

@@ -1389,6 +1389,20 @@ static void inner_rx(PHY_VARS_gNB *gNB,
rel15_ul->qam_mod_order);
}
typedef struct puschSymbolProc_s {
PHY_VARS_gNB *gNB;
NR_DL_FRAME_PARMS *frame_parms;
nfapi_nr_pusch_pdu_t *rel15_ul;
int ulsch_id;
int slot;
int startSymbol;
int numSymbols;
int16_t *llr;
int16_t **llr_layers;
int16_t *scramblingSequence;
uint32_t nvar;
} puschSymbolProc_t;
static void nr_pusch_symbol_processing(void *arg)
{
puschSymbolProc_t *rdata=(puschSymbolProc_t*)arg;
@@ -1438,8 +1452,10 @@ static void nr_pusch_symbol_processing(void *arg)
}
// unscrambling
int16_t *llr16 = (int16_t*)&rdata->llr[pusch_vars->llr_offset[symbol] * rel15_ul->nrOfLayers];
for (int i = 0; i < (nb_re_pusch * rel15_ul->qam_mod_order * rel15_ul->nrOfLayers); i++)
llr16[i] = llr_ptr[i] * rdata->s[i];
int16_t *s = rdata->scramblingSequence + pusch_vars->llr_offset[symbol] * rel15_ul->nrOfLayers;
const int end = nb_re_pusch * rel15_ul->qam_mod_order * rel15_ul->nrOfLayers;
for (int i = 0; i < end; i++)
llr16[i] = llr_ptr[i] * s[i];
}
}
@@ -1455,7 +1471,7 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
NR_gNB_PUSCH *pusch_vars = &gNB->pusch_vars[ulsch_id];
pusch_vars->dmrs_symbol = INVALID_VALUE;
gNB->nbSymb = 0;
int nbSymb = 0;
uint32_t bwp_start_subcarrier = ((rel15_ul->rb_start + rel15_ul->bwp_start) * NR_NB_SC_PER_RB + frame_parms->first_carrier_offset) % frame_parms->ofdm_symbol_size;
LOG_D(PHY,"pusch %d.%d : bwp_start_subcarrier %d, rb_start %d, first_carrier_offset %d\n", frame,slot,bwp_start_subcarrier, rel15_ul->rb_start, frame_parms->first_carrier_offset);
LOG_D(PHY,"pusch %d.%d : ul_dmrs_symb_pos %x\n",frame,slot,rel15_ul->ul_dmrs_symb_pos);
@@ -1571,9 +1587,9 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
gNB->ulsch[ulsch_id].unav_res = unav_res;
// initialize scrambling sequence //
int16_t s[G+96] __attribute__((aligned(32)));
int16_t scramblingSequence[G + 96] __attribute__((aligned(32)));
nr_codeword_unscrambling_init(s, G, 0, rel15_ul->data_scrambling_id, rel15_ul->rnti);
nr_codeword_unscrambling_init(scramblingSequence, G, 0, rel15_ul->data_scrambling_id, rel15_ul->rnti);
// first the computation of channel levels
@@ -1674,23 +1690,23 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
rdata->ulsch_id = ulsch_id;
rdata->llr = pusch_vars->llr;
rdata->llr_layers = pusch_vars->llr_layers;
rdata->s = &s[pusch_vars->llr_offset[symbol]*rel15_ul->nrOfLayers];
rdata->scramblingSequence = scramblingSequence;
rdata->nvar = nvar;
if (rel15_ul->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) {
nr_pusch_symbol_processing(rdata);
} else {
pushTpool(&gNB->threadPool, req);
gNB->nbSymb++;
nbSymb++;
}
LOG_D(PHY,"%d.%d Added symbol %d (count %d) to process, in pipe\n",frame,slot,symbol,gNB->nbSymb);
LOG_D(PHY, "%d.%d Added symbol %d (count %d) to process, in pipe\n", frame, slot, symbol, nbSymb);
}
} // symbol loop
while (gNB->nbSymb > 0) {
while (nbSymb) {
notifiedFIFO_elt_t *req = pullTpool(&gNB->respPuschSymb, &gNB->threadPool);
gNB->nbSymb--;
nbSymb--;
delNotifiedFIFO_elt(req);
}

View File

@@ -1087,7 +1087,8 @@ void NFAPI_NR_DMRS_TYPE1_linear_interp(NR_DL_FRAME_PARMS *frame_parms,
unsigned short bwp_start_subcarrier,
unsigned short nb_rb_pdsch,
int8_t delta,
delay_t *delay)
delay_t *delay,
uint32_t *nvar)
{
c16_t *dl_ch0 = dl_ch;
int re_offset = bwp_start_subcarrier % frame_parms->ofdm_symbol_size;
@@ -1095,6 +1096,9 @@ void NFAPI_NR_DMRS_TYPE1_linear_interp(NR_DL_FRAME_PARMS *frame_parms,
c16_t dl_ls_est[frame_parms->ofdm_symbol_size] __attribute__((aligned(32)));
memset(dl_ls_est, 0, sizeof(dl_ls_est));
int nest_count = 0;
uint64_t noise_amp2 = 0;
for (int pilot_cnt = 0; pilot_cnt < 6 * nb_rb_pdsch; pilot_cnt++) {
if (pilot_cnt % 2 == 0) {
c16_t ch = c16mulShift(*pil, rxF[re_offset], 15);
@@ -1150,6 +1154,12 @@ void NFAPI_NR_DMRS_TYPE1_linear_interp(NR_DL_FRAME_PARMS *frame_parms,
c16_t *dl_inv_delay_table = frame_parms->delay_table[inv_delay_idx];
for (int k = 0; k < 12 * nb_rb_pdsch; k++) {
dl_ch[k] = c16mulShift(dl_ch[k], dl_inv_delay_table[k], 8);
noise_amp2 += c16amp2(c16sub(dl_ls_est[k], dl_ch[k]));
nest_count++;
}
if (nvar && nest_count > 0) {
*nvar = (uint32_t)(noise_amp2 / (nest_count * frame_parms->nb_antennas_rx));
}
}
@@ -1245,7 +1255,8 @@ void NFAPI_NR_DMRS_TYPE2_linear_interp(NR_DL_FRAME_PARMS *frame_parms,
unsigned short nb_rb_pdsch,
int8_t delta,
unsigned short p,
delay_t *delay)
delay_t *delay,
uint32_t *nvar)
{
int re_offset = bwp_start_subcarrier % frame_parms->ofdm_symbol_size;
c16_t *dl_ch0 = dl_ch;
@@ -1253,6 +1264,9 @@ void NFAPI_NR_DMRS_TYPE2_linear_interp(NR_DL_FRAME_PARMS *frame_parms,
c16_t dl_ls_est[frame_parms->ofdm_symbol_size] __attribute__((aligned(32)));
memset(dl_ls_est, 0, sizeof(dl_ls_est));
int nest_count = 0;
uint64_t noise_amp2 = 0;
for (int pilot_cnt = 0; pilot_cnt < 4 * nb_rb_pdsch; pilot_cnt += 2) {
c16_t ch_l = c16mulShift(*pil, rxF[re_offset], 15);
#ifdef DEBUG_PDSCH
@@ -1301,6 +1315,12 @@ void NFAPI_NR_DMRS_TYPE2_linear_interp(NR_DL_FRAME_PARMS *frame_parms,
c16_t *dl_inv_delay_table = frame_parms->delay_table[inv_delay_idx];
for (int k = 0; k < 12 * nb_rb_pdsch; k++) {
dl_ch[k] = c16mulShift(dl_ch[k], dl_inv_delay_table[k], 8);
noise_amp2 += c16amp2(c16sub(dl_ls_est[k], dl_ch[k]));
nest_count++;
}
if (nvar && nest_count > 0) {
*nvar = (uint32_t)(noise_amp2 / (nest_count * frame_parms->nb_antennas_rx));
}
}
@@ -1402,7 +1422,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
uint32_t pdsch_est_size,
int32_t dl_ch_estimates[][pdsch_est_size],
int rxdataFsize,
c16_t rxdataF[][rxdataFsize])
c16_t rxdataF[][rxdataFsize],
uint32_t *nvar)
{
int gNB_id = proc->gNB_id;
int Ns = proc->nr_slot_rx;
@@ -1456,7 +1477,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
bwp_start_subcarrier,
nb_rb_pdsch,
delta,
&delay);
&delay,
nvar);
} else if (config_type == NFAPI_NR_DMRS_TYPE2 && ue->chest_freq == 0) {
NFAPI_NR_DMRS_TYPE2_linear_interp(&ue->frame_parms,
@@ -1467,7 +1489,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
nb_rb_pdsch,
delta,
p,
&delay);
&delay,
nvar);
} else if (config_type == NFAPI_NR_DMRS_TYPE1) {
NFAPI_NR_DMRS_TYPE1_average_prb(&ue->frame_parms,

View File

@@ -93,7 +93,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
uint32_t pdsch_est_size,
int32_t dl_ch_estimates[][pdsch_est_size],
int rxdataFsize,
c16_t rxdataF[][rxdataFsize]);
c16_t rxdataF[][rxdataFsize],
uint32_t *nvar);
int nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
PHY_VARS_NR_UE *ue,

View File

@@ -680,36 +680,6 @@ static void nr_pdcch_unscrambling(c16_t *e_rx,
}
}
/* This function compares the received DCI bits with
* re-encoded DCI bits and returns the number of mismatched bits
*/
static uint16_t nr_dci_false_detection(uint64_t *dci,
int16_t *soft_in,
int encoded_length,
int rnti,
int8_t messageType,
uint16_t messageLength,
uint8_t aggregation_level)
{
uint32_t encoder_output[NR_MAX_DCI_SIZE_DWORD];
polar_encoder_fast(dci, (void *)encoder_output, rnti, 1, messageType, messageLength, aggregation_level);
uint8_t *enout_p = (uint8_t*)encoder_output;
uint16_t x = 0;
for (int i=0; i<encoded_length/8; i++) {
x += (enout_p[i] & 1) ^ ((soft_in[i * 8] >> 15) & 1);
x += ((enout_p[i] >> 1) & 1) ^ ((soft_in[i * 8 + 1] >> 15) & 1);
x += ((enout_p[i] >> 2) & 1) ^ ((soft_in[i * 8 + 2] >> 15) & 1);
x += ((enout_p[i] >> 3) & 1) ^ ((soft_in[i * 8 + 3] >> 15) & 1);
x += ((enout_p[i] >> 4) & 1) ^ ((soft_in[i * 8 + 4] >> 15) & 1);
x += ((enout_p[i] >> 5) & 1) ^ ((soft_in[i * 8 + 5] >> 15) & 1);
x += ((enout_p[i] >> 6) & 1) ^ ((soft_in[i * 8 + 6] >> 15) & 1);
x += ((enout_p[i] >> 7) & 1) ^ ((soft_in[i * 8 + 7] >> 15) & 1);
}
return x;
}
void nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc,
c16_t *pdcch_e_rx,
@@ -758,7 +728,7 @@ void nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
rel15->coreset.pdcch_dmrs_scrambling_id,
tmp_e);
uint16_t crc = polar_decoder_int16(tmp_e, dci_estimation, 1, NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L);
const uint32_t crc = polar_decoder_int16(tmp_e, dci_estimation, 1, NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L);
rnti_t n_rnti = rel15->rnti;
if (crc == n_rnti) {
@@ -771,35 +741,23 @@ void nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
CCEind,
dci_length,
*(unsigned long long *)dci_estimation);
uint16_t mb = nr_dci_false_detection(dci_estimation, tmp_e, L * 108, n_rnti, NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L);
ue->dci_thres = (ue->dci_thres + mb) / 2;
if (mb > (ue->dci_thres + 30)) {
LOG_W(NR_PHY_DCI,
"DCI false positive. Dropping DCI index %d. Mismatched bits: %d/%d. Current DCI threshold: %d\n",
j,
mb,
L * 108,
ue->dci_thres);
continue;
} else {
AssertFatal(dci_ind->number_of_dcis < sizeofArray(dci_ind->dci_list), "Fix allocation\n");
fapi_nr_dci_indication_pdu_t *dci = dci_ind->dci_list + dci_ind->number_of_dcis;
*dci = (fapi_nr_dci_indication_pdu_t){
.rnti = n_rnti,
.n_CCE = CCEind,
.N_CCE = L,
.dci_format = rel15->dci_format_options[k],
.ss_type = rel15->ss_type_options[k],
.coreset_type = rel15->coreset.CoreSetType,
};
int n_rb, rb_offset;
get_coreset_rballoc(rel15->coreset.frequency_domain_resource, &n_rb, &rb_offset);
dci->cset_start = rel15->BWPStart + rb_offset;
dci->payloadSize = dci_length;
memcpy(dci->payloadBits, dci_estimation, (dci_length + 7) / 8);
dci_ind->number_of_dcis++;
break; // If DCI is found, no need to check for remaining DCI lengths
}
AssertFatal(dci_ind->number_of_dcis < sizeofArray(dci_ind->dci_list), "Fix allocation\n");
fapi_nr_dci_indication_pdu_t *dci = dci_ind->dci_list + dci_ind->number_of_dcis;
*dci = (fapi_nr_dci_indication_pdu_t){
.rnti = n_rnti,
.n_CCE = CCEind,
.N_CCE = L,
.dci_format = rel15->dci_format_options[k],
.ss_type = rel15->ss_type_options[k],
.coreset_type = rel15->coreset.CoreSetType,
};
int n_rb, rb_offset;
get_coreset_rballoc(rel15->coreset.frequency_domain_resource, &n_rb, &rb_offset);
dci->cset_start = rel15->BWPStart + rb_offset;
dci->payloadSize = dci_length;
memcpy(dci->payloadBits, dci_estimation, (dci_length + 7) / 8);
dci_ind->number_of_dcis++;
break; // If DCI is found, no need to check for remaining DCI lengths
} else {
LOG_D(NR_PHY_DCI,
"(%i.%i) Decoded crc %x does not match rnti %x for DCI format %d\n",

View File

@@ -82,20 +82,21 @@ unsigned char offset_mumimo_llr_drange[29][3]={{8,8,8},{7,7,7},{7,7,7},{7,7,7},{
#define print_ints(s,x) printf("%s = %d %d %d %d\n",s,(x)[0],(x)[1],(x)[2],(x)[3])
#define print_shorts(s,x) printf("%s = [%d+j*%d, %d+j*%d, %d+j*%d, %d+j*%d]\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7])
/* compute H_h_H matrix inversion up to 4x4 matrices */
uint8_t nr_zero_forcing_rx(uint32_t rx_size_symbol,
unsigned char n_rx,
unsigned char n_tx,//number of layer
int32_t rxdataF_comp[][n_rx][rx_size_symbol * NR_SYMBOLS_PER_SLOT],
int32_t dl_ch_mag[][n_rx][rx_size_symbol],
int32_t dl_ch_magb[][n_rx][rx_size_symbol],
int32_t dl_ch_magr[][n_rx][rx_size_symbol],
int32_t dl_ch_estimates_ext[][rx_size_symbol],
unsigned short nb_rb,
unsigned char mod_order,
int shift,
unsigned char symbol,
int length);
/* compute the MMSE up to 4x4 matrices */
static void nr_dlsch_mmse(uint32_t rx_size_symbol,
unsigned char n_rx,
unsigned char n_tx, // number of layer
int32_t rxdataF_comp[][n_rx][rx_size_symbol * NR_SYMBOLS_PER_SLOT],
int32_t dl_ch_mag[][n_rx][rx_size_symbol],
int32_t dl_ch_magb[][n_rx][rx_size_symbol],
int32_t dl_ch_magr[][n_rx][rx_size_symbol],
int32_t dl_ch_estimates_ext[][rx_size_symbol],
unsigned short nb_rb,
unsigned char mod_order,
int shift,
unsigned char symbol,
int length,
uint32_t noise_var);
/* Apply layer demapping */
static void nr_dlsch_layer_demapping(int16_t *llr_cw[2],
@@ -259,7 +260,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
int32_t rxdataF_comp[][nbRx][rx_size_symbol * NR_SYMBOLS_PER_SLOT],
c16_t ptrs_phase_per_slot[][NR_SYMBOLS_PER_SLOT],
int32_t ptrs_re_per_slot[][NR_SYMBOLS_PER_SLOT],
int G)
int G,
uint32_t nvar)
{
const int nl = dlsch[0].Nl;
const int matrixSz = ue->frame_parms.nb_antennas_rx * nl;
@@ -529,26 +531,27 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
symbol,
nb_rb_pdsch,
nb_re_pdsch);
if (nl >= 2) // Apply zero forcing for 2, 3, and 4 Tx layers
nr_zero_forcing_rx(rx_size_symbol,
n_rx,
nl,
rxdataF_comp,
dl_ch_mag,
dl_ch_magb,
dl_ch_magr,
dl_ch_estimates_ext,
nb_rb_pdsch,
dlsch_config->qamModOrder,
*log2_maxh,
symbol,
nb_re_pdsch);
if (nl >= 2) // Apply MMSE for 2, 3, and 4 Tx layers
nr_dlsch_mmse(rx_size_symbol,
n_rx,
nl,
rxdataF_comp,
dl_ch_mag,
dl_ch_magb,
dl_ch_magr,
dl_ch_estimates_ext,
nb_rb_pdsch,
dlsch_config->qamModOrder,
*log2_maxh,
symbol,
nb_re_pdsch,
nvar);
}
if (meas_enabled) {
stop_meas(&meas);
LOG_D(PHY,
"[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine and zero forcing %5.2f \n",
"[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine and MMSE %5.2f \n",
frame,
nr_slot_rx,
slot,
@@ -738,6 +741,20 @@ void nr_dlsch_deinterleaving(uint8_t symbol,
// Pre-processing for LLR computation
//==============================================================================================
simde__m128i nr_dlsch_a_mult_conjb(simde__m128i a, simde__m128i b, unsigned char output_shift)
{
simde__m128i mmtmpD0 = simde_mm_madd_epi16(b, a);
simde__m128i mmtmpD1 = simde_mm_shufflelo_epi16(b, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1, *(simde__m128i *)&conjugate[0]);
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1, a);
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1, output_shift);
simde__m128i mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0, mmtmpD1);
simde__m128i mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0, mmtmpD1);
return simde_mm_packs_epi32(mmtmpD2, mmtmpD3);
}
static void nr_dlsch_channel_compensation(uint32_t rx_size_symbol,
int nbRx,
c16_t rxdataF_ext[][rx_size_symbol],
@@ -757,21 +774,18 @@ static void nr_dlsch_channel_compensation(uint32_t rx_size_symbol,
unsigned char output_shift,
PHY_NR_MEASUREMENTS *measurements)
{
unsigned short rb;
unsigned char aarx,atx;
simde__m128i *dl_ch128,*dl_ch128_2,*dl_ch_mag128,*dl_ch_mag128b,*dl_ch_mag128r,*rxdataF128,*rxdataF_comp128,*rho128;
simde__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128={0},QAM_amp128b={0},QAM_amp128r={0};
simde__m128i *dl_ch128, *dl_ch128_2, *dl_ch_mag128, *dl_ch_mag128b, *dl_ch_mag128r, *rxdataF128, *rxdataF_comp128, *rho128;
simde__m128i mmtmpD0, mmtmpD1, mmtmpD2, mmtmpD3, QAM_amp128 = {0}, QAM_amp128b = {0}, QAM_amp128r = {0};
uint32_t nb_rb_0 = length / 12 + ((length % 12) ? 1 : 0);
for (int l = 0; l < n_layers; l++) {
if (mod_order == 4) {
QAM_amp128 = simde_mm_set1_epi16(QAM16_n1); // 2/sqrt(10)
QAM_amp128 = simde_mm_set1_epi16(QAM16_n1); // 2/sqrt(10)
QAM_amp128b = simde_mm_setzero_si128();
QAM_amp128r = simde_mm_setzero_si128();
} else if (mod_order == 6) {
QAM_amp128 = simde_mm_set1_epi16(QAM64_n1); //
QAM_amp128 = simde_mm_set1_epi16(QAM64_n1); //
QAM_amp128b = simde_mm_set1_epi16(QAM64_n2);
QAM_amp128r = simde_mm_setzero_si128();
} else if (mod_order == 8) {
@@ -782,257 +796,140 @@ static void nr_dlsch_channel_compensation(uint32_t rx_size_symbol,
// printf("comp: rxdataF_comp %p, symbol %d\n",rxdataF_comp[0],symbol);
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
dl_ch128 = (simde__m128i *)dl_ch_estimates_ext[(l * frame_parms->nb_antennas_rx) + aarx];
for (int aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
dl_ch128 = (simde__m128i *)dl_ch_estimates_ext[(l * frame_parms->nb_antennas_rx) + aarx];
dl_ch_mag128 = (simde__m128i *)dl_ch_mag[l][aarx];
dl_ch_mag128b = (simde__m128i *)dl_ch_magb[l][aarx];
dl_ch_mag128r = (simde__m128i *)dl_ch_magr[l][aarx];
rxdataF128 = (simde__m128i *)rxdataF_ext[aarx];
rxdataF128 = (simde__m128i *)rxdataF_ext[aarx];
rxdataF_comp128 = (simde__m128i *)(rxdataF_comp[l][aarx] + symbol * nb_rb * 12);
for (rb=0; rb<nb_rb_0; rb++) {
if (mod_order>2) {
for (int rb = 0; rb < nb_rb_0; rb++) {
if (mod_order > 2) {
// get channel amplitude if not QPSK
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[0],dl_ch128[0]);
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
mmtmpD1 = simde_mm_madd_epi16(dl_ch128[1],dl_ch128[1]);
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
mmtmpD0 = simde_mm_packs_epi32(mmtmpD0,mmtmpD1); //|H[0]|^2 |H[1]|^2 |H[2]|^2 |H[3]|^2 |H[4]|^2 |H[5]|^2 |H[6]|^2 |H[7]|^2
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[0], dl_ch128[0]);
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
mmtmpD1 = simde_mm_madd_epi16(dl_ch128[1], dl_ch128[1]);
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1, output_shift);
mmtmpD0 = simde_mm_packs_epi32(mmtmpD0, mmtmpD1); //|H[0]|^2 |H[1]|^2 |H[2]|^2 |H[3]|^2 |H[4]|^2 |H[5]|^2 |H[6]|^2 |H[7]|^2
// store channel magnitude here in a new field of dlsch
dl_ch_mag128[0] = simde_mm_unpacklo_epi16(mmtmpD0,mmtmpD0);
dl_ch_mag128[0] = simde_mm_unpacklo_epi16(mmtmpD0, mmtmpD0);
dl_ch_mag128b[0] = dl_ch_mag128[0];
dl_ch_mag128r[0] = dl_ch_mag128[0];
dl_ch_mag128[0] = simde_mm_mulhi_epi16(dl_ch_mag128[0],QAM_amp128);
dl_ch_mag128[0] = simde_mm_slli_epi16(dl_ch_mag128[0],1);
dl_ch_mag128[0] = simde_mm_mulhrs_epi16(dl_ch_mag128[0], QAM_amp128);
dl_ch_mag128b[0] = simde_mm_mulhrs_epi16(dl_ch_mag128b[0], QAM_amp128b);
dl_ch_mag128r[0] = simde_mm_mulhrs_epi16(dl_ch_mag128r[0], QAM_amp128r);
dl_ch_mag128b[0] = simde_mm_mulhi_epi16(dl_ch_mag128b[0],QAM_amp128b);
dl_ch_mag128b[0] = simde_mm_slli_epi16(dl_ch_mag128b[0],1);
dl_ch_mag128r[0] = simde_mm_mulhi_epi16(dl_ch_mag128r[0],QAM_amp128r);
dl_ch_mag128r[0] = simde_mm_slli_epi16(dl_ch_mag128r[0],1);
//print_ints("Re(ch):",(int16_t*)&mmtmpD0);
//print_shorts("QAM_amp:",(int16_t*)&QAM_amp128);
//print_shorts("mag:",(int16_t*)&dl_ch_mag128[0]);
dl_ch_mag128[1] = simde_mm_unpackhi_epi16(mmtmpD0,mmtmpD0);
dl_ch_mag128[1] = simde_mm_unpackhi_epi16(mmtmpD0, mmtmpD0);
dl_ch_mag128b[1] = dl_ch_mag128[1];
dl_ch_mag128r[1] = dl_ch_mag128[1];
dl_ch_mag128[1] = simde_mm_mulhi_epi16(dl_ch_mag128[1],QAM_amp128);
dl_ch_mag128[1] = simde_mm_slli_epi16(dl_ch_mag128[1],1);
dl_ch_mag128[1] = simde_mm_mulhrs_epi16(dl_ch_mag128[1], QAM_amp128);
dl_ch_mag128b[1] = simde_mm_mulhrs_epi16(dl_ch_mag128b[1], QAM_amp128b);
dl_ch_mag128r[1] = simde_mm_mulhrs_epi16(dl_ch_mag128r[1], QAM_amp128r);
dl_ch_mag128b[1] = simde_mm_mulhi_epi16(dl_ch_mag128b[1],QAM_amp128b);
dl_ch_mag128b[1] = simde_mm_slli_epi16(dl_ch_mag128b[1],1);
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[2], dl_ch128[2]);
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
mmtmpD1 = simde_mm_packs_epi32(mmtmpD0, mmtmpD0);
dl_ch_mag128r[1] = simde_mm_mulhi_epi16(dl_ch_mag128r[1],QAM_amp128r);
dl_ch_mag128r[1] = simde_mm_slli_epi16(dl_ch_mag128r[1],1);
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[2],dl_ch128[2]);//[H_I(0)^2+H_Q(0)^2 H_I(1)^2+H_Q(1)^2 H_I(2)^2+H_Q(2)^2 H_I(3)^2+H_Q(3)^2]
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
mmtmpD1 = simde_mm_packs_epi32(mmtmpD0,mmtmpD0);//[|H(0)|^2 |H(1)|^2 |H(2)|^2 |H(3)|^2 |H(0)|^2 |H(1)|^2 |H(2)|^2 |H(3)|^2]
dl_ch_mag128[2] = simde_mm_unpacklo_epi16(mmtmpD1,mmtmpD1);//[|H(0)|^2 |H(0)|^2 |H(1)|^2 |H(1)|^2 |H(2)|^2 |H(2)|^2 |H(3)|^2 |H(3)|^2]
dl_ch_mag128[2] = simde_mm_unpacklo_epi16(mmtmpD1, mmtmpD1);
dl_ch_mag128b[2] = dl_ch_mag128[2];
dl_ch_mag128r[2] = dl_ch_mag128[2];
dl_ch_mag128[2] = simde_mm_mulhi_epi16(dl_ch_mag128[2],QAM_amp128);
dl_ch_mag128[2] = simde_mm_slli_epi16(dl_ch_mag128[2],1);
dl_ch_mag128b[2] = simde_mm_mulhi_epi16(dl_ch_mag128b[2],QAM_amp128b);
dl_ch_mag128b[2] = simde_mm_slli_epi16(dl_ch_mag128b[2],1);
dl_ch_mag128r[2] = simde_mm_mulhi_epi16(dl_ch_mag128r[2],QAM_amp128r);
dl_ch_mag128r[2] = simde_mm_slli_epi16(dl_ch_mag128r[2],1);
dl_ch_mag128[2] = simde_mm_mulhrs_epi16(dl_ch_mag128[2], QAM_amp128);
dl_ch_mag128b[2] = simde_mm_mulhrs_epi16(dl_ch_mag128b[2], QAM_amp128b);
dl_ch_mag128r[2] = simde_mm_mulhrs_epi16(dl_ch_mag128r[2], QAM_amp128r);
}
// multiply by conjugated channel
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[0],rxdataF128[0]);
// print_ints("re",&mmtmpD0);
// Multiply received data by conjugated channel
rxdataF_comp128[0] = nr_dlsch_a_mult_conjb(rxdataF128[0], dl_ch128[0], output_shift);
rxdataF_comp128[1] = nr_dlsch_a_mult_conjb(rxdataF128[1], dl_ch128[1], output_shift);
rxdataF_comp128[2] = nr_dlsch_a_mult_conjb(rxdataF128[2], dl_ch128[2], output_shift);
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[0],SIMDE_MM_SHUFFLE(2,3,0,1));
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1,SIMDE_MM_SHUFFLE(2,3,0,1));
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i*)&conjugate[0]);
// print_ints("im",&mmtmpD1);
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,rxdataF128[0]);
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
// print_ints("re(shift)",&mmtmpD0);
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
// print_ints("im(shift)",&mmtmpD1);
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
// print_ints("c0",&mmtmpD2);
// print_ints("c1",&mmtmpD3);
rxdataF_comp128[0] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
#ifdef DEBUG_DLSCH_DEMOD
printf("%%arx%d atx%d rb_index %d symbol %d shift %d\n",aarx,l,rb,symbol,output_shift);
printf("rx_%d(%d,:)",aarx+1,rb+1);
print_shorts(" ",(int16_t *)&rxdataF128[0]);
printf("ch_%d%d(%d,:)",aarx+1,l+1,rb+1);
print_shorts(" ",(int16_t *)&dl_ch128[0]);
printf("rx_comp_%d%d(%d,:)",aarx+1,l+1,rb+1);
print_shorts(" ",(int16_t *)&rxdataF_comp128[0]);
#endif
// multiply by conjugated channel
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[1],rxdataF128[1]);
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[1],SIMDE_MM_SHUFFLE(2,3,0,1));
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1,SIMDE_MM_SHUFFLE(2,3,0,1));
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i*)conjugate);
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,rxdataF128[1]);
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
rxdataF_comp128[1] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
#ifdef DEBUG_DLSCH_DEMOD
print_shorts("rx:",(int16_t*)&rxdataF128[1]);
print_shorts("ch:",(int16_t*)&dl_ch128[1]);
print_shorts("pack:",(int16_t*)&rxdataF_comp128[1]);
#endif
// multiply by conjugated channel
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[2],rxdataF128[2]);
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[2],SIMDE_MM_SHUFFLE(2,3,0,1));
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1,SIMDE_MM_SHUFFLE(2,3,0,1));
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i*)conjugate);
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,rxdataF128[2]);
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
rxdataF_comp128[2] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
#ifdef DEBUG_DLSCH_DEMOD
print_shorts("rx:",(int16_t*)&rxdataF128[2]);
print_shorts("ch:",(int16_t*)&dl_ch128[2]);
print_shorts("pack:",(int16_t*)&rxdataF_comp128[2]);
#endif
dl_ch128+=3;
dl_ch_mag128+=3;
dl_ch_mag128b+=3;
dl_ch_mag128r+=3;
rxdataF128+=3;
rxdataF_comp128+=3;
dl_ch128 += 3;
dl_ch_mag128 += 3;
dl_ch_mag128b += 3;
dl_ch_mag128r += 3;
rxdataF128 += 3;
rxdataF_comp128 += 3;
}
}
}
if (rho) {
//we compute the Tx correlation matrix for each Rx antenna
//As an example the 2x2 MIMO case requires
//rho[aarx][nl*nl] = [cov(H_aarx_0,H_aarx_0) cov(H_aarx_0,H_aarx_1)
// cov(H_aarx_1,H_aarx_0) cov(H_aarx_1,H_aarx_1)], aarx=0,...,nb_antennas_rx-1
//int avg_rho_re[frame_parms->nb_antennas_rx][nl*nl];
//int avg_rho_im[frame_parms->nb_antennas_rx][nl*nl];
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
// we compute the Tx correlation matrix for each Rx antenna
// As an example the 2x2 MIMO case requires
// rho[aarx][nl*nl] = [cov(H_aarx_0,H_aarx_0) cov(H_aarx_0,H_aarx_1)
// cov(H_aarx_1,H_aarx_0) cov(H_aarx_1,H_aarx_1)], aarx=0,...,nb_antennas_rx-1
for (int aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
for (int l = 0; l < n_layers; l++) {
for (int atx = 0; atx < n_layers; atx++) {
rho128 = (simde__m128i *)&rho[aarx][l * n_layers + atx][symbol * nb_rb * 12];
dl_ch128 = (simde__m128i *)dl_ch_estimates_ext[l * frame_parms->nb_antennas_rx + aarx];
dl_ch128_2 = (simde__m128i *)dl_ch_estimates_ext[atx * frame_parms->nb_antennas_rx + aarx];
for (atx = 0; atx < n_layers; atx++) {
//avg_rho_re[aarx][l*n_layers+atx] = 0;
//avg_rho_im[aarx][l*n_layers+atx] = 0;
rho128 = (simde__m128i *)&rho[aarx][l * n_layers + atx][symbol * nb_rb * 12];
dl_ch128 = (simde__m128i *)dl_ch_estimates_ext[l * frame_parms->nb_antennas_rx + aarx];
dl_ch128_2 = (simde__m128i *)dl_ch_estimates_ext[atx * frame_parms->nb_antennas_rx + aarx];
for (int rb = 0; rb < nb_rb_0; rb++) {
// multiply by conjugated channel
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[0], dl_ch128_2[0]);
// print_ints("re",&mmtmpD0);
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[0], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1, *(simde__m128i *)&conjugate[0]);
// print_ints("im",&mmtmpD1);
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1, dl_ch128_2[0]);
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
// print_ints("re(shift)",&mmtmpD0);
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1, output_shift);
// print_ints("im(shift)",&mmtmpD1);
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0, mmtmpD1);
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0, mmtmpD1);
// print_ints("c0",&mmtmpD2);
// print_ints("c1",&mmtmpD3);
rho128[0] = simde_mm_packs_epi32(mmtmpD2, mmtmpD3);
// print_shorts("rx:",dl_ch128_2);
// print_shorts("ch:",dl_ch128);
// print_shorts("pack:",rho128);
for (rb=0; rb<nb_rb_0; rb++) {
// multiply by conjugated channel
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[0],dl_ch128_2[0]);
// print_ints("re",&mmtmpD0);
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[0],SIMDE_MM_SHUFFLE(2,3,0,1));
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1,SIMDE_MM_SHUFFLE(2,3,0,1));
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i*)&conjugate[0]);
// print_ints("im",&mmtmpD1);
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,dl_ch128_2[0]);
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
// print_ints("re(shift)",&mmtmpD0);
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
// print_ints("im(shift)",&mmtmpD1);
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
// print_ints("c0",&mmtmpD2);
// print_ints("c1",&mmtmpD3);
rho128[0] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
//print_shorts("rx:",dl_ch128_2);
//print_shorts("ch:",dl_ch128);
//print_shorts("pack:",rho128);
// multiply by conjugated channel
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[1], dl_ch128_2[1]);
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[1], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1, *(simde__m128i *)conjugate);
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1, dl_ch128_2[1]);
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1, output_shift);
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0, mmtmpD1);
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0, mmtmpD1);
rho128[1] = simde_mm_packs_epi32(mmtmpD2, mmtmpD3);
// print_shorts("rx:",dl_ch128_2+1);
// print_shorts("ch:",dl_ch128+1);
// print_shorts("pack:",rho128+1);
/*avg_rho_re[aarx][l*n_layers+atx] +=(((int16_t*)&rho128[0])[0]+
((int16_t*)&rho128[0])[2] +
((int16_t*)&rho128[0])[4] +
((int16_t*)&rho128[0])[6])/16;*/
/*avg_rho_im[aarx][l*n_layers+atx] +=(((int16_t*)&rho128[0])[1]+
((int16_t*)&rho128[0])[3] +
((int16_t*)&rho128[0])[5] +
((int16_t*)&rho128[0])[7])/16;*/
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[2], dl_ch128_2[2]);
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[2], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1, *(simde__m128i *)conjugate);
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1, dl_ch128_2[2]);
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1, output_shift);
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0, mmtmpD1);
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0, mmtmpD1);
// multiply by conjugated channel
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[1],dl_ch128_2[1]);
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[1],SIMDE_MM_SHUFFLE(2,3,0,1));
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1,SIMDE_MM_SHUFFLE(2,3,0,1));
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i*)conjugate);
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,dl_ch128_2[1]);
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
rho128[1] =simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
//print_shorts("rx:",dl_ch128_2+1);
//print_shorts("ch:",dl_ch128+1);
//print_shorts("pack:",rho128+1);
// multiply by conjugated channel
/*avg_rho_re[aarx][l*n_layers+atx] +=(((int16_t*)&rho128[1])[0]+
((int16_t*)&rho128[1])[2] +
((int16_t*)&rho128[1])[4] +
((int16_t*)&rho128[1])[6])/16;*/
/*avg_rho_im[aarx][l*n_layers+atx] +=(((int16_t*)&rho128[1])[1]+
((int16_t*)&rho128[1])[3] +
((int16_t*)&rho128[1])[5] +
((int16_t*)&rho128[1])[7])/16;*/
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[2],dl_ch128_2[2]);
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[2],SIMDE_MM_SHUFFLE(2,3,0,1));
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1,SIMDE_MM_SHUFFLE(2,3,0,1));
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i*)conjugate);
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,dl_ch128_2[2]);
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
rho128[2] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
//print_shorts("rx:",dl_ch128_2+2);
//print_shorts("ch:",dl_ch128+2);
//print_shorts("pack:",rho128+2);
/*avg_rho_re[aarx][l*n_layers+atx] +=(((int16_t*)&rho128[2])[0]+
((int16_t*)&rho128[2])[2] +
((int16_t*)&rho128[2])[4] +
((int16_t*)&rho128[2])[6])/16;*/
/*avg_rho_im[aarx][l*n_layers+atx] +=(((int16_t*)&rho128[2])[1]+
((int16_t*)&rho128[2])[3] +
((int16_t*)&rho128[2])[5] +
((int16_t*)&rho128[2])[7])/16;*/
rho128[2] = simde_mm_packs_epi32(mmtmpD2, mmtmpD3);
// print_shorts("rx:",dl_ch128_2+2);
// print_shorts("ch:",dl_ch128+2);
// print_shorts("pack:",rho128+2);
dl_ch128+=3;
dl_ch128_2+=3;
@@ -1723,23 +1620,23 @@ void nr_conjch0_mult_ch1(int *ch0,
simde_m_empty();
}
/* Zero Forcing Rx function: up to 4 layers
*
*
* */
uint8_t nr_zero_forcing_rx(uint32_t rx_size_symbol,
unsigned char n_rx,
unsigned char n_tx,//number of layer
int32_t rxdataF_comp[][n_rx][rx_size_symbol * NR_SYMBOLS_PER_SLOT],
int32_t dl_ch_mag[][n_rx][rx_size_symbol],
int32_t dl_ch_magb[][n_rx][rx_size_symbol],
int32_t dl_ch_magr[][n_rx][rx_size_symbol],
int32_t dl_ch_estimates_ext[][rx_size_symbol],
unsigned short nb_rb,
unsigned char mod_order,
int shift,
unsigned char symbol,
int length)
/*
* MMSE Rx function: up to 4 layers
*/
static void nr_dlsch_mmse(uint32_t rx_size_symbol,
unsigned char n_rx,
unsigned char n_tx, // number of layer
int32_t rxdataF_comp[][n_rx][rx_size_symbol * NR_SYMBOLS_PER_SLOT],
int32_t dl_ch_mag[][n_rx][rx_size_symbol],
int32_t dl_ch_magb[][n_rx][rx_size_symbol],
int32_t dl_ch_magr[][n_rx][rx_size_symbol],
int32_t dl_ch_estimates_ext[][rx_size_symbol],
unsigned short nb_rb,
unsigned char mod_order,
int shift,
unsigned char symbol,
int length,
uint32_t noise_var)
{
int *ch0r, *ch0c;
uint32_t nb_rb_0 = length/12 + ((length%12)?1:0);
@@ -1771,6 +1668,18 @@ uint8_t nr_zero_forcing_rx(uint32_t rx_size_symbol,
}
}
// Add noise_var such that: H^h * H + noise_var * I
if (noise_var != 0) {
simde__m128i nvar_128i = simde_mm_set1_epi32(noise_var >> 3);
for (int p = 0; p < n_tx; p++) {
simde__m128i *conjH_H_128i = (simde__m128i *)conjH_H_elements[0][p][p];
for (int k = 0; k < 3 * nb_rb_0; k++) {
conjH_H_128i[0] = simde_mm_add_epi32(conjH_H_128i[0], nvar_128i);
conjH_H_128i++;
}
}
}
//Compute the inverse and determinant of the H^*H matrix
//Allocate the inverse matrix
c16_t *inv_H_h_H[n_tx][n_tx];
@@ -1868,8 +1777,6 @@ uint8_t nr_zero_forcing_rx(uint32_t rx_size_symbol,
dl_ch_mag128r_0 += 1;
}
}
return 0;
}
static void nr_dlsch_layer_demapping(int16_t *llr_cw[2],

View File

@@ -508,12 +508,10 @@ int nr_rx_pbch(PHY_VARS_NR_UE *ue,
#endif
}
uint32_t payload = 0;
result->xtra_byte = (out>>24)&0xff;
for (int i=0; i<NR_POLAR_PBCH_PAYLOAD_BITS; i++)
payload |= ((out>>i)&1)<<(NR_POLAR_PBCH_PAYLOAD_BITS-i-1);
const uint64_t payload = reverse_bits(out, NR_POLAR_PBCH_PAYLOAD_BITS);
for (int i=0; i<3; i++)
result->decoded_output[i] = (uint8_t)((payload>>((3-i)<<3))&0xff);

View File

@@ -406,13 +406,14 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
uint32_t dl_valid_re[NR_SYMBOLS_PER_SLOT],
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP],
uint32_t llr_offset[NR_SYMBOLS_PER_SLOT],
int32_t *log2_maxhrx_size_symbol,
int32_t *log2_maxh,
int rx_size_symbol,
int nbRx,
int32_t rxdataF_comp[][nbRx][rx_size_symbol * NR_SYMBOLS_PER_SLOT],
c16_t ptrs_phase_per_slot[][NR_SYMBOLS_PER_SLOT],
int32_t ptrs_re_per_slot[][NR_SYMBOLS_PER_SLOT],
int G);
int G,
uint32_t nvar);
int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int frame, uint8_t slot);

View File

@@ -47,7 +47,7 @@ typedef struct {
/// HARQ tx status
harq_result_t tx_status;
/// Status Flag indicating for this ULSCH (idle,active,disabled)
SCH_status_t status;
SCH_status_t ULstatus;
/// Last TPC command
uint8_t TPC;
/// Length of ACK information (bits)

View File

@@ -557,7 +557,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
NR_UL_UE_HARQ_t *harq_process_ulsch = NULL;
harq_process_ulsch = &UE->ul_harq_processes[harq_pid];
harq_process_ulsch->status = SCH_IDLE;
harq_process_ulsch->ULstatus = SCH_IDLE;
///////////
////////////////////////////////////////////////////////////////////////
}

View File

@@ -716,7 +716,6 @@ typedef struct PHY_VARS_gNB_s {
notifiedFIFO_t L1_rx_out;
notifiedFIFO_t resp_RU_tx;
tpool_t threadPool;
int nbSymb;
int num_pusch_symbols_per_thread;
pthread_t L1_rx_thread;
int L1_rx_thread_core;
@@ -728,20 +727,6 @@ typedef struct PHY_VARS_gNB_s {
rt_L1_profiling_t rt_L1_profiling;
} PHY_VARS_gNB;
typedef struct puschSymbolProc_s {
PHY_VARS_gNB *gNB;
NR_DL_FRAME_PARMS *frame_parms;
nfapi_nr_pusch_pdu_t *rel15_ul;
int ulsch_id;
int slot;
int startSymbol;
int numSymbols;
int16_t *llr;
int16_t **llr_layers;
int16_t *s;
uint32_t nvar;
} puschSymbolProc_t;
struct puschSymbolReqId {
uint16_t ulsch_id;
uint16_t frame;

View File

@@ -632,6 +632,8 @@ typedef struct nr_phy_data_s {
sl_nr_rx_config_type_enum_t sl_rx_action;
} nr_phy_data_t;
enum stream_status_e { STREAM_STATUS_UNSYNC, STREAM_STATUS_SYNCING, STREAM_STATUS_SYNCED};
/* this structure is used to pass both UE phy vars and
* proc to the function UE_thread_rxn_txnp4
*/
@@ -642,6 +644,7 @@ typedef struct nr_rxtx_thread_data_s {
nr_phy_data_t phy_data;
int tx_wait_for_dlsch;
int rx_offset;
enum stream_status_e stream_status;
} nr_rxtx_thread_data_t;
typedef struct LDPCDecode_ue_s {

View File

@@ -159,8 +159,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO)
if (NFAPI_MODE == NFAPI_MONOLITHIC){
if (slot_type == NR_DOWNLINK_SLOT || slot_type == NR_MIXED_SLOT) {
processingData_L1tx_t *msgTx=NULL;
msgTx = gNB->msgDataTx;
processingData_L1tx_t *msgTx = gNB->msgDataTx;
msgTx->num_pdsch_slot = 0;
msgTx->num_dl_pdcch = 0;
msgTx->num_ul_pdcch = number_ul_dci_pdu;

View File

@@ -81,7 +81,7 @@ void nr_common_signal_procedures(PHY_VARS_gNB *gNB,int frame,int slot, nfapi_nr_
fp->print_ue_help_cmdline_log = false;
if (fp->dl_CarrierFreq != fp->ul_CarrierFreq)
LOG_A(PHY,
"Command line parameters for the UE: -C %lu --CO %lu -r %d --numerology %d --ssb %d\n",
"Command line parameters for the UE: -C %lu --CO %ld -r %d --numerology %d --ssb %d\n",
fp->dl_CarrierFreq,
fp->dl_CarrierFreq - fp->ul_CarrierFreq,
fp->N_RB_DL,

View File

@@ -473,7 +473,7 @@ static void nr_ue_scheduled_response_ul(PHY_VARS_NR_UE *phy, fapi_nr_ul_config_r
pdu->pusch_config_pdu.tx_request_body.pdu_length);
}
harq_process_ul_ue->status = ACTIVE;
harq_process_ul_ue->ULstatus = ACTIVE;
pdu->pdu_type = FAPI_NR_UL_CONFIG_TYPE_DONE; // not handle it any more
} break;

View File

@@ -294,7 +294,7 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, n
start_meas(&ue->phy_proc_tx);
for (uint8_t harq_pid = 0; harq_pid < NR_MAX_ULSCH_HARQ_PROCESSES; harq_pid++) {
if (ue->ul_harq_processes[harq_pid].status == ACTIVE) {
if (ue->ul_harq_processes[harq_pid].ULstatus == ACTIVE) {
nr_ue_ulsch_procedures(ue, harq_pid, frame_tx, slot_tx, gNB_id, phy_data, (c16_t **)&txdataF);
}
}
@@ -528,10 +528,13 @@ static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
__attribute__((aligned(32))) int32_t rxdataF_comp[dlsch[0].Nl][ue->frame_parms.nb_antennas_rx][rx_size_symbol * NR_SYMBOLS_PER_SLOT];
memset(rxdataF_comp, 0, sizeof(rxdataF_comp));
uint32_t nvar = 0;
for (int m = dlschCfg->start_symbol; m < (dlschCfg->start_symbol + dlschCfg->number_symbols); m++) {
if (dlschCfg->dlDmrsSymbPos & (1 << m)) {
for (int nl = 0; nl < dlsch0->Nl; nl++) { //for MIMO Config: it shall loop over no_layers
LOG_D(PHY,"PDSCH Channel estimation layer %d, slot %d, symbol %d\n", nl, nr_slot_rx, m);
uint32_t nvar_tmp = 0;
nr_pdsch_channel_estimation(ue,
proc,
nl,
@@ -547,7 +550,9 @@ static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
pdsch_est_size,
pdsch_dl_ch_estimates,
ue->frame_parms.samples_per_slot_wCP,
rxdataF);
rxdataF,
&nvar_tmp);
nvar += nvar_tmp;
#if 0
///LOG_M: the channel estimation
int nr_frame_rx = proc->frame_rx;
@@ -561,6 +566,9 @@ static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
}
}
}
nvar /= (dlschCfg->number_symbols * dlsch0->Nl * ue->frame_parms.nb_antennas_rx);
nr_ue_measurement_procedures(2, ue, proc, &dlsch[0], pdsch_est_size, pdsch_dl_ch_estimates);
if (ue->chest_time == 1) { // averaging time domain channel estimates
@@ -618,7 +626,8 @@ static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
rxdataF_comp,
ptrs_phase_per_slot,
ptrs_re_per_slot,
G)
G,
nvar)
< 0)
return -1;

View File

@@ -27,11 +27,14 @@ MESSAGE_DEF(F1AP_DU_REGISTER_REQ, MESSAGE_PRIORITY_MED, f1ap_du_register_req_t,
MESSAGE_DEF(F1AP_SETUP_REQ , MESSAGE_PRIORITY_MED, f1ap_setup_req_t , f1ap_setup_req)
MESSAGE_DEF(F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE , MESSAGE_PRIORITY_MED, f1ap_gnb_cu_configuration_update_acknowledge_t , f1ap_gnb_cu_configuration_update_acknowledge)
MESSAGE_DEF(F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE , MESSAGE_PRIORITY_MED, f1ap_gnb_cu_configuration_update_failure_t , f1ap_gnb_cu_configuration_update_failure)
MESSAGE_DEF(F1AP_GNB_DU_CONFIGURATION_UPDATE, MESSAGE_PRIORITY_MED, f1ap_gnb_du_configuration_update_t, f1ap_gnb_du_configuration_update)
/* F1AP -> eNB_DU or eNB_CU_RRC -> F1AP application layer messages */
MESSAGE_DEF(F1AP_SETUP_RESP , MESSAGE_PRIORITY_MED, f1ap_setup_resp_t , f1ap_setup_resp)
MESSAGE_DEF(F1AP_SETUP_FAILURE , MESSAGE_PRIORITY_MED, f1ap_setup_failure_t , f1ap_setup_failure)
MESSAGE_DEF(F1AP_GNB_CU_CONFIGURATION_UPDATE , MESSAGE_PRIORITY_MED, f1ap_gnb_cu_configuration_update_t , f1ap_gnb_cu_configuration_update)
MESSAGE_DEF(F1AP_GNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE , MESSAGE_PRIORITY_MED, f1ap_gnb_du_configuration_update_acknowledge_t, f1ap_gnb_du_configuration_update_acknowledge)
MESSAGE_DEF(F1AP_GNB_DU_CONFIGURATION_UPDATE_FAILURE , MESSAGE_PRIORITY_MED, f1ap_gnb_du_configuration_update_failure_t, f1ap_gnb_du_configuration_update_failure)
/* F1AP -> RRC to inform about lost connection */
MESSAGE_DEF(F1AP_LOST_CONNECTION, MESSAGE_PRIORITY_MED, f1ap_lost_connection_t, f1ap_lost_connection)

View File

@@ -39,6 +39,10 @@
#define F1AP_GNB_CU_CONFIGURATION_UPDATE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_gnb_cu_configuration_update
#define F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_gnb_cu_configuration_update_acknowledge
#define F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_gnb_cu_configuration_update_failure
#define F1AP_GNB_DU_CONFIGURATION_UPDATE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_gnb_du_configuration_update
#define F1AP_GNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_gnb_du_configuration_update_acknowledge
#define F1AP_GNB_DU_CONFIGURATION_UPDATE_FAILURE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_gnb_du_configuration_update_failure
#define F1AP_SETUP_FAILURE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_setup_failure
#define F1AP_LOST_CONNECTION(mSGpTR) (mSGpTR)->ittiMsg.f1ap_lost_connection
@@ -125,10 +129,9 @@ typedef struct f1ap_served_cell_info_t {
/* Tracking area code */
uint32_t *tac;
// Number of slide support items (max 16, could be increased to as much as 1024)
// Number of slice support items (max 16, could be increased to as much as 1024)
uint16_t num_ssi;
uint8_t sst;
uint8_t sd;
nssai_t nssai[16];
f1ap_mode_t mode;
union {
@@ -136,7 +139,8 @@ typedef struct f1ap_served_cell_info_t {
f1ap_tdd_info_t tdd;
};
char *measurement_timing_information;
uint8_t *measurement_timing_config;
int measurement_timing_config_len;
} f1ap_served_cell_info_t;
typedef struct f1ap_gnb_du_system_info_t {
@@ -247,6 +251,57 @@ typedef struct f1ap_gnb_cu_configuration_update_failure_s {
uint16_t criticality_diagnostics;
} f1ap_gnb_cu_configuration_update_failure_t;
/*DU configuration messages*/
typedef struct f1ap_gnb_du_configuration_update_s {
/*TODO UPDATE TO SUPPORT DU CONFIG*/
/* Transaction ID */
uint64_t transaction_id;
/// int cells_to_add
uint16_t num_cells_to_add;
struct {
f1ap_served_cell_info_t info;
f1ap_gnb_du_system_info_t *sys_info;
} cell_to_add[F1AP_MAX_NB_CELLS];
/// int cells_to_modify
uint16_t num_cells_to_modify;
struct {
f1ap_plmn_t old_plmn;
uint64_t old_nr_cellid; // NR Global Cell Id
f1ap_served_cell_info_t info;
f1ap_gnb_du_system_info_t *sys_info;
} cell_to_modify[F1AP_MAX_NB_CELLS];
/// int cells_to_delete
uint16_t num_cells_to_delete;
struct {
// NR CGI
f1ap_plmn_t plmn;
uint64_t nr_cellid; // NR Global Cell Id
} cell_to_delete[F1AP_MAX_NB_CELLS];
/// string holding gNB_CU_name
uint64_t *gNB_DU_ID;
} f1ap_gnb_du_configuration_update_t;
typedef struct f1ap_gnb_du_configuration_update_acknowledge_s {
/// ulong transaction id
uint64_t transaction_id;
/// string holding gNB_CU_name
char *gNB_CU_name;
/// number of DU cells to activate
uint16_t num_cells_to_activate; // 0< num_cells_to_activate <= 512;
served_cells_to_activate_t cells_to_activate[F1AP_MAX_NB_CELLS];
} f1ap_gnb_du_configuration_update_acknowledge_t;
typedef struct f1ap_gnb_du_configuration_update_failure_s {
/*TODO UPDATE TO SUPPORT DU CONFIG*/
uint16_t cause;
uint16_t time_to_wait;
uint16_t criticality_diagnostics;
} f1ap_gnb_du_configuration_update_failure_t;
typedef struct f1ap_dl_rrc_message_s {
uint32_t gNB_CU_ue_id;

View File

@@ -583,6 +583,8 @@ typedef struct ngap_ue_ctxt_modification_resp_s {
typedef struct ngap_ue_release_complete_s {
uint32_t gNB_ue_ngap_id;
int num_pdu_sessions;
uint32_t pdu_session_id[256];
} ngap_ue_release_complete_t;
//-------------------------------------------------------------------------------------------//

View File

@@ -54,7 +54,8 @@ bool read_mac_sm(void* data)
mac_ue_stats_impl_t* rd = &mac->msg.ue_stats[i];
rd->frame = RC.nrmac[mod_id]->frame;
rd->slot = RC.nrmac[mod_id]->slot;
rd->slot = 0; // previously had slot info, but the gNB runs multiple slots
// in parallel, so this has no real meaning
rd->dl_aggr_tbs = UE->mac_stats.dl.total_bytes;
rd->ul_aggr_tbs = UE->mac_stats.ul.total_bytes;

View File

@@ -67,6 +67,40 @@ int CU_send_ERROR_INDICATION(sctp_assoc_t assoc_id, F1AP_ErrorIndication_t *Erro
AssertFatal(1==0,"Not implemented yet\n");
}
static uint8_t *cp_octet_string(const OCTET_STRING_t *os, int *len)
{
uint8_t *buf = calloc(os->size, sizeof(*buf));
AssertFatal(buf != NULL, "out of memory\n");
memcpy(buf, os->buf, os->size);
*len = os->size;
return buf;
}
static int read_slice_info(const F1AP_ServedPLMNs_Item_t *plmn, nssai_t *nssai, int max_nssai)
{
if (plmn->iE_Extensions == NULL)
return 0;
const F1AP_ProtocolExtensionContainer_10696P34_t *p = (F1AP_ProtocolExtensionContainer_10696P34_t *)plmn->iE_Extensions;
if (p->list.count == 0)
return 0;
const F1AP_ServedPLMNs_ItemExtIEs_t *splmn = p->list.array[0];
DevAssert(splmn->id == F1AP_ProtocolIE_ID_id_TAISliceSupportList);
DevAssert(splmn->extensionValue.present == F1AP_ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList);
const F1AP_SliceSupportList_t *ssl = &splmn->extensionValue.choice.SliceSupportList;
AssertFatal(ssl->list.count <= max_nssai, "cannot handle more than 16 slices\n");
for (int s = 0; s < ssl->list.count; ++s) {
const F1AP_SliceSupportItem_t *sl = ssl->list.array[s];
nssai_t *n = &nssai[s];
OCTET_STRING_TO_INT8(&sl->sNSSAI.sST, n->sst);
n->sd = 0xffffff;
if (sl->sNSSAI.sD != NULL)
OCTET_STRING_TO_INT24(sl->sNSSAI.sD, n->sd);
}
return ssl->list.count;
}
/*
F1 Setup
@@ -124,7 +158,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, sctp_assoc_t assoc_id, uint3
if (servedCellInformation->fiveGS_TAC) {
req->cell[i].info.tac = malloc(sizeof(*req->cell[i].info.tac));
AssertFatal(req->cell[i].info.tac != NULL, "out of memory\n");
OCTET_STRING_TO_INT16(servedCellInformation->fiveGS_TAC, *req->cell[i].info.tac);
OCTET_STRING_TO_INT24(servedCellInformation->fiveGS_TAC, *req->cell[i].info.tac);
LOG_D(F1AP, "req->tac[%d] %d \n", i, *req->cell[i].info.tac);
}
@@ -144,6 +178,9 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, sctp_assoc_t assoc_id, uint3
req->cell[i].info.nr_pci = servedCellInformation->nRPCI;
LOG_D(F1AP, "req->nr_pci[%d] %d \n", i, req->cell[i].info.nr_pci);
AssertFatal(servedCellInformation->servedPLMNs.list.count == 1, "only one PLMN handled\n");
req->cell[i].info.num_ssi = read_slice_info(servedCellInformation->servedPLMNs.list.array[0], req->cell[i].info.nssai, 16);
// FDD Cells
if (servedCellInformation->nR_Mode_Info.present==F1AP_NR_Mode_Info_PR_fDD) {
req->cell[i].info.mode = F1AP_MODE_FDD;
@@ -187,6 +224,11 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, sctp_assoc_t assoc_id, uint3
AssertFatal(false, "unknown NR Mode info %d\n", servedCellInformation->nR_Mode_Info.present);
}
/* MeasurementConfig */
if (servedCellInformation->measurementTimingConfiguration.size > 0)
req->cell[i].info.measurement_timing_config =
cp_octet_string(&servedCellInformation->measurementTimingConfiguration, &req->cell[i].info.measurement_timing_config_len);
struct F1AP_GNB_DU_System_Information * DUsi=served_cells_item->gNB_DU_System_Information;
if (DUsi != NULL) {
// System Information
@@ -431,17 +473,367 @@ int CU_send_F1_SETUP_FAILURE(sctp_assoc_t assoc_id, const f1ap_setup_failure_t *
int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu)
{
AssertFatal(1==0,"Not implemented yet\n");
LOG_D(F1AP, "CU_handle_gNB_DU_CONFIGURATION_UPDATE\n");
F1AP_GNBDUConfigurationUpdate_t *container;
F1AP_GNBDUConfigurationUpdateIEs_t *ie;
int i = 0;
DevAssert(pdu != NULL);
container = &pdu->choice.initiatingMessage->value.choice.GNBDUConfigurationUpdate;
/* gNB DU Configuration Update == Non UE-related procedure -> stream 0 */
if (stream != 0) {
LOG_W(F1AP, "[SCTP %d] Received f1 setup request on stream != 0 (%d)\n", assoc_id, stream);
}
MessageDef *message_p = itti_alloc_new_message(TASK_CU_F1, 0, F1AP_GNB_DU_CONFIGURATION_UPDATE);
message_p->ittiMsgHeader.originInstance = assoc_id;
f1ap_gnb_du_configuration_update_t *req = &F1AP_GNB_DU_CONFIGURATION_UPDATE(message_p);
/* 3GPP TS 38.473 Transaction ID*/
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_GNBDUConfigurationUpdateIEs_t, ie, container, F1AP_ProtocolIE_ID_id_TransactionID, true);
req->transaction_id = ie->value.choice.TransactionID;
LOG_D(F1AP, "req->transaction_id %lu \n", req->transaction_id);
/* 3GPP TS 38.473 Served Cells To Add List */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_GNBDUConfigurationUpdateIEs_t,
ie,
container,
F1AP_ProtocolIE_ID_id_Served_Cells_To_Add_List,
false);
if (ie != NULL) {
req->num_cells_to_add = ie->value.choice.Served_Cells_To_Add_List.list.count;
LOG_D(F1AP, "req->num_cells_to_add %d \n", req->num_cells_to_add);
for (i = 0; i < req->num_cells_to_add; i++) {
F1AP_Served_Cells_To_Add_Item_t *served_cells_item =
&((F1AP_Served_Cells_To_Add_ItemIEs_t *)ie->value.choice.Served_Cells_To_Add_List.list.array[i])
->value.choice.Served_Cells_To_Add_Item;
F1AP_Served_Cell_Information_t *servedCellInformation = &served_cells_item->served_Cell_Information;
/* tac */
if (servedCellInformation->fiveGS_TAC) {
req->cell_to_add[i].info.tac = malloc(sizeof(*req->cell_to_add[i].info.tac));
AssertFatal(req->cell_to_add[i].info.tac != NULL, "out of memory\n");
OCTET_STRING_TO_INT24(servedCellInformation->fiveGS_TAC, *req->cell_to_add[i].info.tac);
LOG_D(F1AP, "req->tac[%d] %d \n", i, *req->cell_to_add[i].info.tac);
}
/* - nRCGI */
TBCD_TO_MCC_MNC(&(servedCellInformation->nRCGI.pLMN_Identity),
req->cell_to_add[i].info.plmn.mcc,
req->cell_to_add[i].info.plmn.mnc,
req->cell_to_add[i].info.plmn.mnc_digit_length);
// NR cellID
BIT_STRING_TO_NR_CELL_IDENTITY(&servedCellInformation->nRCGI.nRCellIdentity, req->cell_to_add[i].info.nr_cellid);
LOG_D(F1AP,
"[SCTP %d] Received nRCGI: MCC %d, MNC %d, CELL_ID %llu\n",
assoc_id,
req->cell_to_add[i].info.plmn.mcc,
req->cell_to_add[i].info.plmn.mnc,
(long long unsigned int)req->cell_to_add[i].info.nr_cellid);
/* - nRPCI */
req->cell_to_add[i].info.nr_pci = servedCellInformation->nRPCI;
LOG_D(F1AP, "req->nr_pci[%d] %d \n", i, req->cell_to_add[i].info.nr_pci);
AssertFatal(servedCellInformation->servedPLMNs.list.count == 1, "only one PLMN handled\n");
req->cell_to_add[i].info.num_ssi =
read_slice_info(servedCellInformation->servedPLMNs.list.array[0], req->cell_to_add[i].info.nssai, 16);
// FDD Cells
if (servedCellInformation->nR_Mode_Info.present == F1AP_NR_Mode_Info_PR_fDD) {
req->cell_to_add[i].info.mode = F1AP_MODE_FDD;
f1ap_fdd_info_t *FDDs = &req->cell_to_add[i].info.fdd;
F1AP_FDD_Info_t *fDD_Info = servedCellInformation->nR_Mode_Info.choice.fDD;
FDDs->ul_freqinfo.arfcn = fDD_Info->uL_NRFreqInfo.nRARFCN;
AssertFatal(fDD_Info->uL_NRFreqInfo.freqBandListNr.list.count == 1, "cannot handle more than one frequency band\n");
for (int f = 0; f < fDD_Info->uL_NRFreqInfo.freqBandListNr.list.count; f++) {
F1AP_FreqBandNrItem_t *FreqItem = fDD_Info->uL_NRFreqInfo.freqBandListNr.list.array[f];
FDDs->ul_freqinfo.band = FreqItem->freqBandIndicatorNr;
AssertFatal(FreqItem->supportedSULBandList.list.count == 0, "cannot handle SUL bands!\n");
}
FDDs->dl_freqinfo.arfcn = fDD_Info->dL_NRFreqInfo.nRARFCN;
int dlBands = fDD_Info->dL_NRFreqInfo.freqBandListNr.list.count;
AssertFatal(dlBands == 0, "cannot handled more than one frequency band\n");
for (int dlB = 0; dlB < dlBands; dlB++) {
F1AP_FreqBandNrItem_t *FreqItem = fDD_Info->dL_NRFreqInfo.freqBandListNr.list.array[dlB];
FDDs->dl_freqinfo.band = FreqItem->freqBandIndicatorNr;
int num_available_supported_SULBands = FreqItem->supportedSULBandList.list.count;
AssertFatal(num_available_supported_SULBands == 0, "cannot handle SUL bands!\n");
}
FDDs->ul_tbw.scs = fDD_Info->uL_Transmission_Bandwidth.nRSCS;
FDDs->ul_tbw.nrb = nrb_lut[fDD_Info->uL_Transmission_Bandwidth.nRNRB];
FDDs->dl_tbw.scs = fDD_Info->dL_Transmission_Bandwidth.nRSCS;
FDDs->dl_tbw.nrb = nrb_lut[fDD_Info->dL_Transmission_Bandwidth.nRNRB];
} else if (servedCellInformation->nR_Mode_Info.present == F1AP_NR_Mode_Info_PR_tDD) {
req->cell_to_add[i].info.mode = F1AP_MODE_TDD;
f1ap_tdd_info_t *TDDs = &req->cell_to_add[i].info.tdd;
F1AP_TDD_Info_t *tDD_Info = servedCellInformation->nR_Mode_Info.choice.tDD;
TDDs->freqinfo.arfcn = tDD_Info->nRFreqInfo.nRARFCN;
AssertFatal(tDD_Info->nRFreqInfo.freqBandListNr.list.count == 1, "cannot handle more than one frequency band\n");
for (int f = 0; f < tDD_Info->nRFreqInfo.freqBandListNr.list.count; f++) {
struct F1AP_FreqBandNrItem *FreqItem = tDD_Info->nRFreqInfo.freqBandListNr.list.array[f];
TDDs->freqinfo.band = FreqItem->freqBandIndicatorNr;
int num_available_supported_SULBands = FreqItem->supportedSULBandList.list.count;
AssertFatal(num_available_supported_SULBands == 0, "cannot hanlde SUL bands!\n");
}
TDDs->tbw.scs = tDD_Info->transmission_Bandwidth.nRSCS;
TDDs->tbw.nrb = nrb_lut[tDD_Info->transmission_Bandwidth.nRNRB];
} else {
AssertFatal(false, "unknown NR Mode info %d\n", servedCellInformation->nR_Mode_Info.present);
}
/* MeasurementConfig */
if (servedCellInformation->measurementTimingConfiguration.size > 0)
req->cell_to_add[i].info.measurement_timing_config =
cp_octet_string(&servedCellInformation->measurementTimingConfiguration,
&req->cell_to_add[i].info.measurement_timing_config_len);
struct F1AP_GNB_DU_System_Information *DUsi = served_cells_item->gNB_DU_System_Information;
// System Information
req->cell_to_add[i].sys_info = calloc(1, sizeof(*req->cell_to_add[i].sys_info));
AssertFatal(req->cell_to_add[i].sys_info != NULL, "out of memory\n");
f1ap_gnb_du_system_info_t *sys_info = req->cell_to_add[i].sys_info;
/* mib */
sys_info->mib = calloc(DUsi->mIB_message.size, sizeof(char));
memcpy(sys_info->mib, DUsi->mIB_message.buf, DUsi->mIB_message.size);
sys_info->mib_length = DUsi->mIB_message.size;
/* sib1 */
sys_info->sib1 = calloc(DUsi->sIB1_message.size, sizeof(char));
memcpy(sys_info->sib1, DUsi->sIB1_message.buf, DUsi->sIB1_message.size);
sys_info->sib1_length = DUsi->sIB1_message.size;
}
} else {
req->num_cells_to_add = 0;
}
/* 3GPP TS 38.473 Served Cells To Modify List */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_GNBDUConfigurationUpdateIEs_t,
ie,
container,
F1AP_ProtocolIE_ID_id_Served_Cells_To_Modify_List,
false);
if (ie) {
req->num_cells_to_modify = ie->value.choice.Served_Cells_To_Modify_List.list.count;
LOG_D(F1AP, "req->num_cells_to_modify %d \n", req->num_cells_to_modify);
for (i = 0; i < req->num_cells_to_modify; i++) {
F1AP_Served_Cells_To_Modify_Item_t *served_cells_item =
&((F1AP_Served_Cells_To_Modify_ItemIEs_t *)ie->value.choice.Served_Cells_To_Modify_List.list.array[i])
->value.choice.Served_Cells_To_Modify_Item;
/* OLD NRCGI */
TBCD_TO_MCC_MNC(&(served_cells_item->oldNRCGI.pLMN_Identity),
req->cell_to_modify[i].old_plmn.mcc,
req->cell_to_modify[i].old_plmn.mnc,
req->cell_to_modify[i].old_plmn.mnc_digit_length);
BIT_STRING_TO_NR_CELL_IDENTITY(&served_cells_item->oldNRCGI.nRCellIdentity, req->cell_to_modify[i].old_nr_cellid);
F1AP_Served_Cell_Information_t *servedCellInformation = &served_cells_item->served_Cell_Information;
/* SERVED CELL INFORMATION*/
/* tac */
if (servedCellInformation->fiveGS_TAC) {
req->cell_to_modify[i].info.tac = malloc(sizeof(*req->cell_to_modify[i].info.tac));
AssertFatal(req->cell_to_modify[i].info.tac != NULL, "out of memory\n");
OCTET_STRING_TO_INT24(servedCellInformation->fiveGS_TAC, *req->cell_to_modify[i].info.tac);
LOG_D(F1AP, "req->tac[%d] %d \n", i, *req->cell_to_modify[i].info.tac);
}
/* - nRCGI */
TBCD_TO_MCC_MNC(&(servedCellInformation->nRCGI.pLMN_Identity),
req->cell_to_modify[i].info.plmn.mcc,
req->cell_to_modify[i].info.plmn.mnc,
req->cell_to_modify[i].info.plmn.mnc_digit_length);
// NR cellID
BIT_STRING_TO_NR_CELL_IDENTITY(&servedCellInformation->nRCGI.nRCellIdentity, req->cell_to_modify[i].info.nr_cellid);
LOG_D(F1AP,
"[SCTP %d] Received nRCGI: MCC %d, MNC %d, CELL_ID %llu\n",
assoc_id,
req->cell_to_modify[i].info.plmn.mcc,
req->cell_to_modify[i].info.plmn.mnc,
(long long unsigned int)req->cell_to_modify[i].info.nr_cellid);
/* - nRPCI */
req->cell_to_modify[i].info.nr_pci = servedCellInformation->nRPCI;
LOG_D(F1AP, "req->nr_pci[%d] %d \n", i, req->cell_to_modify[i].info.nr_pci);
// FDD Cells
if (servedCellInformation->nR_Mode_Info.present == F1AP_NR_Mode_Info_PR_fDD) {
req->cell_to_modify[i].info.mode = F1AP_MODE_FDD;
f1ap_fdd_info_t *FDDs = &req->cell_to_modify[i].info.fdd;
F1AP_FDD_Info_t *fDD_Info = servedCellInformation->nR_Mode_Info.choice.fDD;
FDDs->ul_freqinfo.arfcn = fDD_Info->uL_NRFreqInfo.nRARFCN;
AssertFatal(fDD_Info->uL_NRFreqInfo.freqBandListNr.list.count == 1, "cannot handle more than one frequency band\n");
for (int f = 0; f < fDD_Info->uL_NRFreqInfo.freqBandListNr.list.count; f++) {
F1AP_FreqBandNrItem_t *FreqItem = fDD_Info->uL_NRFreqInfo.freqBandListNr.list.array[f];
FDDs->ul_freqinfo.band = FreqItem->freqBandIndicatorNr;
AssertFatal(FreqItem->supportedSULBandList.list.count == 0, "cannot handle SUL bands!\n");
}
FDDs->dl_freqinfo.arfcn = fDD_Info->dL_NRFreqInfo.nRARFCN;
int dlBands = fDD_Info->dL_NRFreqInfo.freqBandListNr.list.count;
AssertFatal(dlBands == 0, "cannot handled more than one frequency band\n");
for (int dlB = 0; dlB < dlBands; dlB++) {
F1AP_FreqBandNrItem_t *FreqItem = fDD_Info->dL_NRFreqInfo.freqBandListNr.list.array[dlB];
FDDs->dl_freqinfo.band = FreqItem->freqBandIndicatorNr;
int num_available_supported_SULBands = FreqItem->supportedSULBandList.list.count;
AssertFatal(num_available_supported_SULBands == 0, "cannot handle SUL bands!\n");
}
FDDs->ul_tbw.scs = fDD_Info->uL_Transmission_Bandwidth.nRSCS;
FDDs->ul_tbw.nrb = nrb_lut[fDD_Info->uL_Transmission_Bandwidth.nRNRB];
FDDs->dl_tbw.scs = fDD_Info->dL_Transmission_Bandwidth.nRSCS;
FDDs->dl_tbw.nrb = nrb_lut[fDD_Info->dL_Transmission_Bandwidth.nRNRB];
} else if (servedCellInformation->nR_Mode_Info.present == F1AP_NR_Mode_Info_PR_tDD) {
req->cell_to_modify[i].info.mode = F1AP_MODE_TDD;
f1ap_tdd_info_t *TDDs = &req->cell_to_modify[i].info.tdd;
F1AP_TDD_Info_t *tDD_Info = servedCellInformation->nR_Mode_Info.choice.tDD;
TDDs->freqinfo.arfcn = tDD_Info->nRFreqInfo.nRARFCN;
AssertFatal(tDD_Info->nRFreqInfo.freqBandListNr.list.count == 1, "cannot handle more than one frequency band\n");
for (int f = 0; f < tDD_Info->nRFreqInfo.freqBandListNr.list.count; f++) {
struct F1AP_FreqBandNrItem *FreqItem = tDD_Info->nRFreqInfo.freqBandListNr.list.array[f];
TDDs->freqinfo.band = FreqItem->freqBandIndicatorNr;
int num_available_supported_SULBands = FreqItem->supportedSULBandList.list.count;
AssertFatal(num_available_supported_SULBands == 0, "cannot hanlde SUL bands!\n");
}
TDDs->tbw.scs = tDD_Info->transmission_Bandwidth.nRSCS;
TDDs->tbw.nrb = nrb_lut[tDD_Info->transmission_Bandwidth.nRNRB];
} else {
AssertFatal(false, "unknown NR Mode info %d\n", servedCellInformation->nR_Mode_Info.present);
}
/* MeasurementConfig */
if (servedCellInformation->measurementTimingConfiguration.size > 0)
req->cell_to_modify[i].info.measurement_timing_config =
cp_octet_string(&servedCellInformation->measurementTimingConfiguration,
&req->cell_to_modify[i].info.measurement_timing_config_len);
/*gNB DU SYSTEM INFORMATION */
struct F1AP_GNB_DU_System_Information *DUsi = served_cells_item->gNB_DU_System_Information;
if (DUsi != NULL) {
// System Information
req->cell_to_modify[i].sys_info = calloc(1, sizeof(*req->cell_to_modify[i].sys_info));
AssertFatal(req->cell_to_modify[i].sys_info != NULL, "out of memory\n");
f1ap_gnb_du_system_info_t *sys_info = req->cell_to_modify[i].sys_info;
/* mib */
sys_info->mib = calloc(DUsi->mIB_message.size, sizeof(char));
AssertFatal(req->cell_to_modify[i].sys_info->mib != NULL, "out of memory\n");
memcpy(sys_info->mib, DUsi->mIB_message.buf, DUsi->mIB_message.size);
sys_info->mib_length = DUsi->mIB_message.size;
/* sib1 */
sys_info->sib1 = calloc(DUsi->sIB1_message.size, sizeof(char));
AssertFatal(req->cell_to_modify[i].sys_info->sib1 != NULL, "out of memory\n");
memcpy(sys_info->sib1, DUsi->sIB1_message.buf, DUsi->sIB1_message.size);
sys_info->sib1_length = DUsi->sIB1_message.size;
}
}
} else {
req->num_cells_to_modify = 0;
}
/* 3GPP TS 38.473 Served Cells To Delete List */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_GNBDUConfigurationUpdateIEs_t,
ie,
container,
F1AP_ProtocolIE_ID_id_Served_Cells_To_Delete_List,
false);
if (ie) {
req->num_cells_to_delete = ie->value.choice.Served_Cells_To_Delete_List.list.count;
LOG_D(F1AP, "req->num_cells_to_delete %d \n", req->num_cells_to_delete);
for (i = 0; i < req->num_cells_to_delete; i++) {
F1AP_Served_Cells_To_Delete_Item_t *served_cells_item =
&((F1AP_Served_Cells_To_Delete_ItemIEs_t *)ie->value.choice.Served_Cells_To_Delete_List.list.array[i])
->value.choice.Served_Cells_To_Delete_Item;
/* - Old nRCGI */
TBCD_TO_MCC_MNC(&(served_cells_item->oldNRCGI.pLMN_Identity),
req->cell_to_delete[i].plmn.mcc,
req->cell_to_delete[i].plmn.mnc,
req->cell_to_delete[i].plmn.mnc_digit_length);
// NR cellID
BIT_STRING_TO_NR_CELL_IDENTITY(&served_cells_item->oldNRCGI.nRCellIdentity, req->cell_to_delete[i].nr_cellid);
LOG_D(F1AP,
"[SCTP %d] Received nRCGI to delete: MCC %d, MNC %d, CELL_ID %llu\n",
assoc_id,
req->cell_to_delete[i].plmn.mcc,
req->cell_to_delete[i].plmn.mnc,
(long long unsigned int)req->cell_to_delete[i].nr_cellid);
}
} else {
req->num_cells_to_delete = 0;
}
/* 3GPP TS 38.473 Cells Status List */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_GNBDUConfigurationUpdateIEs_t, ie, container, F1AP_ProtocolIE_ID_id_Cells_Status_List, false);
/* 3GPP TS 38.473 Dedicated SI Delivery Needed UE List */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_GNBDUConfigurationUpdateIEs_t,
ie,
container,
F1AP_ProtocolIE_ID_id_Dedicated_SIDelivery_NeededUE_List,
false);
/* 3GPP TS 38.473 gNB-DU ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_GNBDUConfigurationUpdateIEs_t, ie, container, F1AP_ProtocolIE_ID_id_gNB_DU_ID, false);
if (ie != NULL)
asn_INTEGER2ulong(&ie->value.choice.GNB_DU_ID, req->gNB_DU_ID);
/* 3GPP TS 38.473 gNB-DU TNL Association To Remove List */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_GNBDUConfigurationUpdateIEs_t,
ie,
container,
F1AP_ProtocolIE_ID_id_GNB_DU_TNL_Association_To_Remove_List,
false);
LOG_D(F1AP, "Sending F1AP_GNB_DU_CONFIGURATION_UPDATE ITTI message \n");
itti_send_msg_to_task(TASK_RRC_GNB, GNB_MODULE_ID_TO_INSTANCE(instance), message_p);
return 0;
}
int CU_send_gNB_DU_CONFIGURATION_FAILURE(sctp_assoc_t assoc_id,
F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure) {
f1ap_gnb_du_configuration_update_failure_t *GNBDUConfigurationUpdateFailure)
{
AssertFatal(1==0,"Not implemented yet\n");
}
int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(sctp_assoc_t assoc_id,
F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n");
int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(
sctp_assoc_t assoc_id,
f1ap_gnb_du_configuration_update_acknowledge_t *GNBDUConfigurationUpdateAcknowledge)
{
F1AP_F1AP_PDU_t pdu = {};
uint8_t *buffer;
uint32_t len;
/* Create */
/* 0. Message */
pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome;
asn1cCalloc(pdu.choice.successfulOutcome, succOut);
succOut->procedureCode = F1AP_ProcedureCode_id_gNBDUConfigurationUpdate;
succOut->criticality = F1AP_Criticality_reject;
succOut->value.present = F1AP_SuccessfulOutcome__value_PR_GNBDUConfigurationUpdateAcknowledge;
F1AP_GNBDUConfigurationUpdateAcknowledge_t *ack = &succOut->value.choice.GNBDUConfigurationUpdateAcknowledge;
/* Mandatory */
/* Transaction Id */
asn1cSequenceAdd(ack->protocolIEs.list, F1AP_GNBDUConfigurationUpdateAcknowledgeIEs_t, ie1);
ie1->id = F1AP_ProtocolIE_ID_id_TransactionID;
ie1->criticality = F1AP_Criticality_reject;
ie1->value.present = F1AP_GNBDUConfigurationUpdateAcknowledgeIEs__value_PR_TransactionID;
ie1->value.choice.TransactionID = GNBDUConfigurationUpdateAcknowledge->transaction_id;
/* Todo add optional fields */
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
LOG_E(F1AP, "Failed to encode F1 gNB-DU CONFIGURATION UPDATE\n");
return -1;
}
LOG_DUMPMSG(F1AP, LOG_DUMP_CHAR, buffer, len, "F1AP gNB-DU CONFIGURATION UPDATE : ");
ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0;
}
/*

View File

@@ -62,10 +62,11 @@ int CU_send_F1_SETUP_FAILURE(sctp_assoc_t assoc_id, const f1ap_setup_failure_t *
int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
int CU_send_gNB_DU_CONFIGURATION_FAILURE(sctp_assoc_t assoc_id,
F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure);
f1ap_gnb_du_configuration_update_failure_t *GNBDUConfigurationUpdateFailure);
int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(sctp_assoc_t assoc_id,
F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge);
int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(
sctp_assoc_t assoc_id,
f1ap_gnb_du_configuration_update_acknowledge_t *GNBDUConfigurationUpdateAcknowledge);
/*
* gNB-CU Configuration Update

View File

@@ -174,6 +174,9 @@ void *F1AP_CU_task(void *arg) {
&F1AP_GNB_CU_CONFIGURATION_UPDATE(received_msg));
break;
case F1AP_GNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE:
CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(assoc_id, &F1AP_GNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(received_msg));
break;
case F1AP_DL_RRC_MESSAGE: // from rrc
CU_send_DL_RRC_MESSAGE_TRANSFER(assoc_id,
&F1AP_DL_RRC_MESSAGE(received_msg));

View File

@@ -273,27 +273,27 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(sctp_assoc_t assoc_id, f1ap_ue_context_setu
f1ap_ue_context_setup_req->cu_to_du_rrc_information->measConfig_length);
}
}
/* mandatory */
/* c7. Candidate_SpCell_List */
asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie7);
ie7->id = F1AP_ProtocolIE_ID_id_Candidate_SpCell_List; //90
ie7->criticality = F1AP_Criticality_ignore;
ie7->value.present = F1AP_UEContextSetupRequestIEs__value_PR_Candidate_SpCell_List;
/* optional */
if (0) {
/* c7. Candidate_SpCell_List */
asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie7);
ie7->id = F1AP_ProtocolIE_ID_id_Candidate_SpCell_List; // 90
ie7->criticality = F1AP_Criticality_ignore;
ie7->value.present = F1AP_UEContextSetupRequestIEs__value_PR_Candidate_SpCell_List;
for (int i=0; i<1; i++) {
asn1cSequenceAdd(ie7->value.choice.Candidate_SpCell_List.list,F1AP_Candidate_SpCell_ItemIEs_t, candidate_spCell_item_ies);
candidate_spCell_item_ies->id = F1AP_ProtocolIE_ID_id_Candidate_SpCell_Item; // 91
candidate_spCell_item_ies->criticality = F1AP_Criticality_reject;
candidate_spCell_item_ies->value.present = F1AP_Candidate_SpCell_ItemIEs__value_PR_Candidate_SpCell_Item;
/* 7.1 Candidate_SpCell_Item */
F1AP_Candidate_SpCell_Item_t *candidate_spCell_item=
&candidate_spCell_item_ies->value.choice.Candidate_SpCell_Item;
/* - candidate_SpCell_ID */
//FixMe: first cell ???
addnRCGI(candidate_spCell_item->candidate_SpCell_ID,f1ap_ue_context_setup_req);
/* TODO add correct mcc/mnc */
for (int i = 0; i < 1; i++) {
asn1cSequenceAdd(ie7->value.choice.Candidate_SpCell_List.list, F1AP_Candidate_SpCell_ItemIEs_t, candidate_spCell_item_ies);
candidate_spCell_item_ies->id = F1AP_ProtocolIE_ID_id_Candidate_SpCell_Item; // 91
candidate_spCell_item_ies->criticality = F1AP_Criticality_ignore;
candidate_spCell_item_ies->value.present = F1AP_Candidate_SpCell_ItemIEs__value_PR_Candidate_SpCell_Item;
/* 7.1 Candidate_SpCell_Item */
F1AP_Candidate_SpCell_Item_t *candidate_spCell_item = &candidate_spCell_item_ies->value.choice.Candidate_SpCell_Item;
/* - candidate_SpCell_ID */
// FixMe: first cell ???
addnRCGI(candidate_spCell_item->candidate_SpCell_ID, f1ap_ue_context_setup_req);
/* TODO add correct mcc/mnc */
}
}
/* optional */
@@ -335,32 +335,33 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(sctp_assoc_t assoc_id, f1ap_ue_context_setu
strlen("asdsa1d32sa1d31asd31as"));
}
/* mandatory */
/* c10. SCell_ToBeSetup_List */
asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie10);
ie10->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetup_List;
ie10->criticality = F1AP_Criticality_ignore;
ie10->value.present = F1AP_UEContextSetupRequestIEs__value_PR_SCell_ToBeSetup_List;
/* optional */
if (0) {
/* c10. SCell_ToBeSetup_List */
asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie10);
ie10->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetup_List;
ie10->criticality = F1AP_Criticality_ignore;
ie10->value.present = F1AP_UEContextSetupRequestIEs__value_PR_SCell_ToBeSetup_List;
for (int i=0; i<1; i++) {
//
asn1cSequenceAdd(ie10->value.choice.SCell_ToBeSetup_List.list, F1AP_SCell_ToBeSetup_ItemIEs_t, scell_toBeSetup_item_ies);
scell_toBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetup_Item; //53
scell_toBeSetup_item_ies->criticality = F1AP_Criticality_ignore;
scell_toBeSetup_item_ies->value.present = F1AP_SCell_ToBeSetup_ItemIEs__value_PR_SCell_ToBeSetup_Item;
/* 10.1 SCell_ToBeSetup_Item */
F1AP_SCell_ToBeSetup_Item_t *scell_toBeSetup_item=&scell_toBeSetup_item_ies->value.choice.SCell_ToBeSetup_Item;
/* 10.1.1 sCell_ID */
addnRCGI(scell_toBeSetup_item->sCell_ID, f1ap_ue_context_setup_req);
/* TODO correct MCC/MNC */
/* 10.1.2 sCellIndex */
scell_toBeSetup_item->sCellIndex = 3; // issue here
for (int i = 0; i < 1; i++) {
asn1cSequenceAdd(ie10->value.choice.SCell_ToBeSetup_List.list, F1AP_SCell_ToBeSetup_ItemIEs_t, scell_toBeSetup_item_ies);
scell_toBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetup_Item; // 53
scell_toBeSetup_item_ies->criticality = F1AP_Criticality_ignore;
scell_toBeSetup_item_ies->value.present = F1AP_SCell_ToBeSetup_ItemIEs__value_PR_SCell_ToBeSetup_Item;
/* 10.1 SCell_ToBeSetup_Item */
F1AP_SCell_ToBeSetup_Item_t *scell_toBeSetup_item = &scell_toBeSetup_item_ies->value.choice.SCell_ToBeSetup_Item;
/* 10.1.1 sCell_ID */
addnRCGI(scell_toBeSetup_item->sCell_ID, f1ap_ue_context_setup_req);
/* TODO correct MCC/MNC */
/* 10.1.2 sCellIndex */
scell_toBeSetup_item->sCellIndex = 3; // issue here
/* OPTIONAL */
/* 10.1.3 sCellULConfigured*/
if (0) {
asn1cCallocOne(scell_toBeSetup_item->sCellULConfigured,
F1AP_CellULConfigured_ul_and_sul); // enum
/* OPTIONAL */
/* 10.1.3 sCellULConfigured*/
if (0) {
asn1cCallocOne(scell_toBeSetup_item->sCellULConfigured,
F1AP_CellULConfigured_ul_and_sul); // enum
}
}
}
@@ -375,7 +376,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(sctp_assoc_t assoc_id, f1ap_ue_context_setu
for (int i=0; i<f1ap_ue_context_setup_req->srbs_to_be_setup_length; i++) {
asn1cSequenceAdd(ie11->value.choice.SRBs_ToBeSetup_List.list, F1AP_SRBs_ToBeSetup_ItemIEs_t, srbs_toBeSetup_item_ies);
srbs_toBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeSetup_Item; // 73
srbs_toBeSetup_item_ies->criticality = F1AP_Criticality_ignore;
srbs_toBeSetup_item_ies->criticality = F1AP_Criticality_reject;
srbs_toBeSetup_item_ies->value.present = F1AP_SRBs_ToBeSetup_ItemIEs__value_PR_SRBs_ToBeSetup_Item;
/* 11.1 SRBs_ToBeSetup_Item */
F1AP_SRBs_ToBeSetup_Item_t *srbs_toBeSetup_item=&srbs_toBeSetup_item_ies->value.choice.SRBs_ToBeSetup_Item;
@@ -539,7 +540,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(sctp_assoc_t assoc_id, f1ap_ue_context_setu
if(f1ap_ue_context_setup_req->rrc_container_length > 0) {
asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie14);
ie14->id = F1AP_ProtocolIE_ID_id_RRCContainer;
ie14->criticality = F1AP_Criticality_reject;
ie14->criticality = F1AP_Criticality_ignore;
ie14->value.present = F1AP_UEContextSetupRequestIEs__value_PR_RRCContainer;
OCTET_STRING_fromBuf(&ie14->value.choice.RRCContainer, (const char *)f1ap_ue_context_setup_req->rrc_container,
f1ap_ue_context_setup_req->rrc_container_length);

View File

@@ -83,12 +83,145 @@ int DU_handle_ERROR_INDICATION(instance_t instance, sctp_assoc_t assoc_id, uint3
AssertFatal(1==0,"Not implemented yet\n");
}
/*
F1 Setup
*/
static F1AP_Served_Cell_Information_t encode_served_cell_info(const f1ap_served_cell_info_t *c)
{
/* 4.1.1 served cell Information */
F1AP_Served_Cell_Information_t scell_info = {0};
addnRCGI(scell_info.nRCGI, c);
/* - nRPCI */
scell_info.nRPCI = c->nr_pci; // int 0..1007
/* - fiveGS_TAC */
if (c->tac != NULL) {
uint32_t tac = htonl(*c->tac);
asn1cCalloc(scell_info.fiveGS_TAC, netOrder);
OCTET_STRING_fromBuf(netOrder, ((char *)&tac) + 1, 3);
}
/* - Configured_EPS_TAC */
if (0) {
scell_info.configured_EPS_TAC = (F1AP_Configured_EPS_TAC_t *)calloc(1, sizeof(F1AP_Configured_EPS_TAC_t));
OCTET_STRING_fromBuf(scell_info.configured_EPS_TAC, "2", 2);
}
/* servedPLMN information */
asn1cSequenceAdd(scell_info.servedPLMNs.list, F1AP_ServedPLMNs_Item_t, servedPLMN_item);
MCC_MNC_TO_PLMNID(c->plmn.mcc, c->plmn.mnc, c->plmn.mnc_digit_length, &servedPLMN_item->pLMN_Identity);
F1AP_NR_Mode_Info_t *nR_Mode_Info = &scell_info.nR_Mode_Info;
if (c->num_ssi > 0) {
F1AP_ProtocolExtensionContainer_10696P34_t *p = calloc(1, sizeof(*p));
servedPLMN_item->iE_Extensions = (struct F1AP_ProtocolExtensionContainer *)p;
asn1cSequenceAdd(p->list, F1AP_ServedPLMNs_ItemExtIEs_t, served_plmns_itemExtIEs);
served_plmns_itemExtIEs->criticality = F1AP_Criticality_ignore;
served_plmns_itemExtIEs->id = F1AP_ProtocolIE_ID_id_TAISliceSupportList;
served_plmns_itemExtIEs->extensionValue.present = F1AP_ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList;
F1AP_SliceSupportList_t *slice_support_list = &served_plmns_itemExtIEs->extensionValue.choice.SliceSupportList;
for (int s = 0; s < c->num_ssi; s++) {
asn1cSequenceAdd(slice_support_list->list, F1AP_SliceSupportItem_t, slice);
const nssai_t *nssai = &c->nssai[s];
INT8_TO_OCTET_STRING(nssai->sst, &slice->sNSSAI.sST);
if (nssai->sd != 0xffffff) {
asn1cCalloc(slice->sNSSAI.sD, tmp);
INT24_TO_OCTET_STRING(nssai->sd, tmp);
}
}
}
if (c->mode == F1AP_MODE_FDD) { // FDD
const f1ap_fdd_info_t *fdd = &c->fdd;
nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_fDD;
asn1cCalloc(nR_Mode_Info->choice.fDD, fDD_Info);
/* FDD.1.1 UL NRFreqInfo ARFCN */
fDD_Info->uL_NRFreqInfo.nRARFCN = fdd->ul_freqinfo.arfcn; // Integer
/* FDD.1.2 F1AP_SUL_Information */
/* FDD.1.3 freqBandListNr */
int ul_band = 1;
for (int j = 0; j < ul_band; j++) {
asn1cSequenceAdd(fDD_Info->uL_NRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, nr_freqBandNrItem);
/* FDD.1.3.1 freqBandIndicatorNr*/
nr_freqBandNrItem->freqBandIndicatorNr = fdd->ul_freqinfo.band;
/* FDD.1.3.2 supportedSULBandList*/
}
/* FDD.2.1 DL NRFreqInfo ARFCN */
fDD_Info->dL_NRFreqInfo.nRARFCN = fdd->dl_freqinfo.arfcn; // Integer
/* FDD.2.2 F1AP_SUL_Information */
/* FDD.2.3 freqBandListNr */
int dl_bands = 1;
for (int j = 0; j < dl_bands; j++) {
asn1cSequenceAdd(fDD_Info->dL_NRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, nr_freqBandNrItem);
/* FDD.2.3.1 freqBandIndicatorNr*/
nr_freqBandNrItem->freqBandIndicatorNr = fdd->dl_freqinfo.band;
/* FDD.2.3.2 supportedSULBandList*/
} // for FDD : DL freq_Bands
/* FDD.3 UL Transmission Bandwidth */
fDD_Info->uL_Transmission_Bandwidth.nRSCS = fdd->ul_tbw.scs;
fDD_Info->uL_Transmission_Bandwidth.nRNRB = to_NRNRB(fdd->ul_tbw.nrb);
/* FDD.4 DL Transmission Bandwidth */
fDD_Info->dL_Transmission_Bandwidth.nRSCS = fdd->dl_tbw.scs;
fDD_Info->dL_Transmission_Bandwidth.nRNRB = to_NRNRB(fdd->dl_tbw.nrb);
} else if (c->mode == F1AP_MODE_TDD) {
const f1ap_tdd_info_t *tdd = &c->tdd;
nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_tDD;
asn1cCalloc(nR_Mode_Info->choice.tDD, tDD_Info);
/* TDD.1.1 nRFreqInfo ARFCN */
tDD_Info->nRFreqInfo.nRARFCN = tdd->freqinfo.arfcn;
/* TDD.1.2 F1AP_SUL_Information */
/* TDD.1.3 freqBandListNr */
int bands = 1;
for (int j = 0; j < bands; j++) {
asn1cSequenceAdd(tDD_Info->nRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, nr_freqBandNrItem);
/* TDD.1.3.1 freqBandIndicatorNr*/
nr_freqBandNrItem->freqBandIndicatorNr = tdd->freqinfo.band;
/* TDD.1.3.2 supportedSULBandList*/
}
/* TDD.2 transmission_Bandwidth */
tDD_Info->transmission_Bandwidth.nRSCS = tdd->tbw.scs;
tDD_Info->transmission_Bandwidth.nRNRB = to_NRNRB(tdd->tbw.nrb);
} else {
AssertFatal(false, "unknown mode %d\n", c->mode);
}
/* - measurementTimingConfiguration */
OCTET_STRING_fromBuf(&scell_info.measurementTimingConfiguration,
(const char *)c->measurement_timing_config,
c->measurement_timing_config_len);
return scell_info;
}
static F1AP_GNB_DU_System_Information_t *encode_system_info(const f1ap_gnb_du_system_info_t *sys_info)
{
if (sys_info == NULL)
return NULL; /* optional: can be NULL */
F1AP_GNB_DU_System_Information_t *enc_sys_info = calloc(1, sizeof(*enc_sys_info));
AssertFatal(enc_sys_info != NULL, "out of memory\n");
AssertFatal(sys_info->mib != NULL, "MIB must be present in DU sys info\n");
OCTET_STRING_fromBuf(&enc_sys_info->mIB_message, (const char *)sys_info->mib, sys_info->mib_length);
AssertFatal(sys_info->sib1 != NULL, "SIB1 must be present in DU sys info\n");
OCTET_STRING_fromBuf(&enc_sys_info->sIB1_message, (const char *)sys_info->sib1, sys_info->sib1_length);
return enc_sys_info;
}
// SETUP REQUEST
int DU_send_F1_SETUP_REQUEST(sctp_assoc_t assoc_id, f1ap_setup_req_t *setup_req)
int DU_send_F1_SETUP_REQUEST(sctp_assoc_t assoc_id, const f1ap_setup_req_t *setup_req)
{
F1AP_F1AP_PDU_t pdu= {0};
uint8_t *buffer;
@@ -139,151 +272,16 @@ int DU_send_F1_SETUP_REQUEST(sctp_assoc_t assoc_id, f1ap_setup_req_t *setup_req)
for (int i=0; i<num_cells_available; i++) {
/* mandatory */
/* 4.1 served cells item */
f1ap_served_cell_info_t *cell = &setup_req->cell[i].info;
const f1ap_served_cell_info_t *cell = &setup_req->cell[i].info;
const f1ap_gnb_du_system_info_t *sys_info = setup_req->cell[i].sys_info;
asn1cSequenceAdd(ieCells->value.choice.GNB_DU_Served_Cells_List.list,
F1AP_GNB_DU_Served_Cells_ItemIEs_t, duServedCell);
duServedCell->id = F1AP_ProtocolIE_ID_id_GNB_DU_Served_Cells_Item;
duServedCell->criticality = F1AP_Criticality_reject;
duServedCell->value.present = F1AP_GNB_DU_Served_Cells_ItemIEs__value_PR_GNB_DU_Served_Cells_Item;
F1AP_GNB_DU_Served_Cells_Item_t *gnb_du_served_cells_item=&duServedCell->value.choice.GNB_DU_Served_Cells_Item;
/* 4.1.1 served cell Information */
F1AP_Served_Cell_Information_t *served_cell_information= &gnb_du_served_cells_item->served_Cell_Information;
addnRCGI(served_cell_information->nRCGI, cell);
/* - nRPCI */
served_cell_information->nRPCI = cell->nr_pci; // int 0..1007
/* - fiveGS_TAC */
if (cell->tac != NULL) {
uint32_t tac=htonl(*cell->tac);
asn1cCalloc(served_cell_information->fiveGS_TAC, netOrder);
OCTET_STRING_fromBuf(netOrder, ((char *)&tac)+1, 3);
}
/* - Configured_EPS_TAC */
if(0) {
served_cell_information->configured_EPS_TAC = (F1AP_Configured_EPS_TAC_t *)calloc(1, sizeof(F1AP_Configured_EPS_TAC_t));
OCTET_STRING_fromBuf(served_cell_information->configured_EPS_TAC, "2", 2);
}
/* servedPLMN information */
asn1cSequenceAdd(served_cell_information->servedPLMNs.list, F1AP_ServedPLMNs_Item_t,servedPLMN_item);
MCC_MNC_TO_PLMNID(cell->plmn.mcc, cell->plmn.mnc, cell->plmn.mnc_digit_length, &servedPLMN_item->pLMN_Identity);
// // /* - CHOICE NR-MODE-Info */
F1AP_NR_Mode_Info_t *nR_Mode_Info= &served_cell_information->nR_Mode_Info;
F1AP_ProtocolExtensionContainer_10696P34_t *p = calloc(1, sizeof(*p));
servedPLMN_item->iE_Extensions = (struct F1AP_ProtocolExtensionContainer *) p;
asn1cSequenceAdd(p->list, F1AP_ServedPLMNs_ItemExtIEs_t , served_plmns_itemExtIEs);
served_plmns_itemExtIEs->criticality = F1AP_Criticality_ignore;
served_plmns_itemExtIEs->id = F1AP_ProtocolIE_ID_id_TAISliceSupportList;
served_plmns_itemExtIEs->extensionValue.present = F1AP_ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList;
F1AP_SliceSupportList_t *slice_support_list = &served_plmns_itemExtIEs->extensionValue.choice.SliceSupportList;
/* get list of sst/sd from configuration file */
paramdef_t SNSSAIParams[] = GNBSNSSAIPARAMS_DESC;
paramlist_def_t SNSSAIParamList = {GNB_CONFIG_STRING_SNSSAI_LIST, NULL, 0};
char sstr[100];
/* TODO: be sure that %d in the line below is at the right place */
sprintf(sstr, "%s.[%d].%s.[0]", GNB_CONFIG_STRING_GNB_LIST, i, GNB_CONFIG_STRING_PLMN_LIST);
config_getlist(config_get_if(), &SNSSAIParamList, SNSSAIParams, sizeofArray(SNSSAIParams), sstr);
AssertFatal(SNSSAIParamList.numelt > 0, "no slice configuration found (snssaiList in the configuration file)\n");
AssertFatal(SNSSAIParamList.numelt <= 1024, "maximum size for slice support list is 1024, see F1AP 38.473 9.3.1.37\n");
for (int s = 0; s < SNSSAIParamList.numelt; s++) {
uint32_t sst;
uint32_t sd;
bool has_sd;
sst = *SNSSAIParamList.paramarray[s][GNB_SLICE_SERVICE_TYPE_IDX].uptr;
has_sd = *SNSSAIParamList.paramarray[s][GNB_SLICE_DIFFERENTIATOR_IDX].uptr != 0xffffff;
asn1cSequenceAdd(slice_support_list->list, F1AP_SliceSupportItem_t, slice);
INT8_TO_OCTET_STRING(sst, &slice->sNSSAI.sST);
if (has_sd) {
sd = *SNSSAIParamList.paramarray[s][GNB_SLICE_DIFFERENTIATOR_IDX].uptr;
asn1cCalloc(slice->sNSSAI.sD, tmp);
INT24_TO_OCTET_STRING(sd, tmp);
}
}
if (setup_req->cell[i].info.mode == F1AP_MODE_FDD) { // FDD
const f1ap_fdd_info_t *fdd = &setup_req->cell[i].info.fdd;
nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_fDD;
asn1cCalloc(nR_Mode_Info->choice.fDD, fDD_Info);
/* FDD.1 UL NRFreqInfo */
/* FDD.1.1 UL NRFreqInfo ARFCN */
fDD_Info->uL_NRFreqInfo.nRARFCN = fdd->ul_freqinfo.arfcn; // Integer
/* FDD.1.2 F1AP_SUL_Information */
/* FDD.1.3 freqBandListNr */
int fdd_ul_num_available_freq_Bands = 1;
for (int fdd_ul_j=0; fdd_ul_j<fdd_ul_num_available_freq_Bands; fdd_ul_j++) {
asn1cSequenceAdd(fDD_Info->uL_NRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, nr_freqBandNrItem);
/* FDD.1.3.1 freqBandIndicatorNr*/
nr_freqBandNrItem->freqBandIndicatorNr = fdd->ul_freqinfo.band;
/* FDD.1.3.2 supportedSULBandList*/
} // for FDD : UL freq_Bands
/* FDD.2 DL NRFreqInfo */
/* FDD.2.1 DL NRFreqInfo ARFCN */
fDD_Info->dL_NRFreqInfo.nRARFCN = fdd->dl_freqinfo.arfcn; // Integer
/* FDD.2.2 F1AP_SUL_Information */
/* FDD.2.3 freqBandListNr */
int fdd_dl_num_available_freq_Bands = 1;
for (int fdd_dl_j=0; fdd_dl_j<fdd_dl_num_available_freq_Bands; fdd_dl_j++) {
asn1cSequenceAdd(fDD_Info->dL_NRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, nr_freqBandNrItem);
/* FDD.2.3.1 freqBandIndicatorNr*/
nr_freqBandNrItem->freqBandIndicatorNr = fdd->dl_freqinfo.band;
/* FDD.2.3.2 supportedSULBandList*/
} // for FDD : DL freq_Bands
/* FDD.3 UL Transmission Bandwidth */
fDD_Info->uL_Transmission_Bandwidth.nRSCS = fdd->ul_tbw.scs;
fDD_Info->uL_Transmission_Bandwidth.nRNRB = to_NRNRB(fdd->ul_tbw.nrb);
/* FDD.4 DL Transmission Bandwidth */
fDD_Info->dL_Transmission_Bandwidth.nRSCS = fdd->dl_tbw.scs;
fDD_Info->dL_Transmission_Bandwidth.nRNRB = to_NRNRB(fdd->dl_tbw.nrb);
} else if (setup_req->cell[i].info.mode == F1AP_MODE_TDD) { // TDD
const f1ap_tdd_info_t *tdd = &setup_req->cell[i].info.tdd;
nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_tDD;
asn1cCalloc(nR_Mode_Info->choice.tDD, tDD_Info);
/* TDD.1 nRFreqInfo */
/* TDD.1.1 nRFreqInfo ARFCN */
tDD_Info->nRFreqInfo.nRARFCN = tdd->freqinfo.arfcn; // Integer
/* TDD.1.2 F1AP_SUL_Information */
/* TDD.1.3 freqBandListNr */
int tdd_num_available_freq_Bands = 1;
for (int j=0; j<tdd_num_available_freq_Bands; j++) {
asn1cSequenceAdd(tDD_Info->nRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, nr_freqBandNrItem);
/* TDD.1.3.1 freqBandIndicatorNr*/
nr_freqBandNrItem->freqBandIndicatorNr = tdd->freqinfo.band;
/* TDD.1.3.2 supportedSULBandList*/
} // for TDD : freq_Bands
/* TDD.2 transmission_Bandwidth */
tDD_Info->transmission_Bandwidth.nRSCS = tdd->tbw.scs;
tDD_Info->transmission_Bandwidth.nRNRB = to_NRNRB(tdd->tbw.nrb);
} else {
AssertFatal(false, "unknown mode %d\n", setup_req->cell[i].info.mode);
}
/* - measurementTimingConfiguration */
char *measurementTimingConfiguration = cell->measurement_timing_information; // sept. 2018
OCTET_STRING_fromBuf(&served_cell_information->measurementTimingConfiguration,
measurementTimingConfiguration,
strlen(measurementTimingConfiguration));
/* 4.1.2 gNB-DU System Information */
if (setup_req->cell[i].sys_info != NULL) {
asn1cCalloc(gnb_du_served_cells_item->gNB_DU_System_Information, gNB_DU_System_Information);
const f1ap_gnb_du_system_info_t *sys_info = setup_req->cell[i].sys_info;
AssertFatal(sys_info->mib != NULL, "MIB must be present in DU sys info\n");
OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, (const char *)sys_info->mib, sys_info->mib_length);
AssertFatal(sys_info->sib1 != NULL, "SIB1 must be present in DU sys info\n");
OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, (const char *)sys_info->sib1, sys_info->sib1_length);
}
F1AP_GNB_DU_Served_Cells_Item_t *scell_item = &duServedCell->value.choice.GNB_DU_Served_Cells_Item;
scell_item->served_Cell_Information = encode_served_cell_info(cell);
scell_item->gNB_DU_System_Information = encode_system_info(sys_info);
}
/* mandatory */
@@ -534,7 +532,7 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance, sctp_assoc_t assoc_id, uint3
gNB-DU Configuration Update
*/
int DU_send_gNB_DU_CONFIGURATION_UPDATE(sctp_assoc_t assoc_id, f1ap_setup_req_t *f1ap_setup_req)
int DU_send_gNB_DU_CONFIGURATION_UPDATE(sctp_assoc_t assoc_id, const f1ap_gnb_du_configuration_update_t *upd)
{
F1AP_F1AP_PDU_t pdu= {0};
uint8_t *buffer=NULL;
@@ -546,227 +544,100 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(sctp_assoc_t assoc_id, f1ap_setup_req_t
initMsg->procedureCode = F1AP_ProcedureCode_id_gNBDUConfigurationUpdate;
initMsg->criticality = F1AP_Criticality_reject;
initMsg->value.present = F1AP_InitiatingMessage__value_PR_GNBDUConfigurationUpdate;
F1AP_GNBDUConfigurationUpdate_t *out = &pdu.choice.initiatingMessage->value.choice.GNBDUConfigurationUpdate;
F1AP_GNBDUConfigurationUpdate_t *out = &initMsg->value.choice.GNBDUConfigurationUpdate;
/* mandatory */
/* c1. Transaction ID (integer value) */
asn1cSequenceAdd(out, F1AP_GNBDUConfigurationUpdateIEs_t, ie1);
asn1cSequenceAdd(out->protocolIEs.list, F1AP_GNBDUConfigurationUpdateIEs_t, ie1);
ie1->id = F1AP_ProtocolIE_ID_id_TransactionID;
ie1->criticality = F1AP_Criticality_reject;
ie1->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_TransactionID;
ie1->value.choice.TransactionID = F1AP_get_next_transaction_identifier(0, 0);
ie1->value.choice.TransactionID = upd->transaction_id;
/* mandatory */
/* c2. Served_Cells_To_Add */
asn1cSequenceAdd(out, F1AP_GNBDUConfigurationUpdateIEs_t, ie2);
ie2->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Add_List;
ie2->criticality = F1AP_Criticality_reject;
ie2->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Add_List;
if (upd->num_cells_to_add > 0) {
AssertFatal(false, "code for adding cells not tested\n");
asn1cSequenceAdd(out->protocolIEs.list, F1AP_GNBDUConfigurationUpdateIEs_t, ie2);
ie2->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Add_List;
ie2->criticality = F1AP_Criticality_reject;
ie2->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Add_List;
for (int j=0; j<1; j++) {
//
asn1cSequenceAdd(ie2->value.choice.Served_Cells_To_Add_List.list, F1AP_Served_Cells_To_Add_ItemIEs_t, served_cells_to_add_item_ies);
served_cells_to_add_item_ies->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Add_Item;
served_cells_to_add_item_ies->criticality = F1AP_Criticality_reject;
served_cells_to_add_item_ies->value.present = F1AP_Served_Cells_To_Add_ItemIEs__value_PR_Served_Cells_To_Add_Item;
F1AP_Served_Cells_To_Add_Item_t *served_cells_to_add_item= &served_cells_to_add_item_ies->value.choice.Served_Cells_To_Add_Item;
F1AP_Served_Cell_Information_t *served_cell_information=&served_cells_to_add_item->served_Cell_Information;
/* - nRCGI */
addnRCGI(served_cell_information->nRCGI, &f1ap_setup_req->cell[j].info);
/* - nRPCI */
/* 2.1.1 serverd cell Information */
f1ap_served_cell_info_t *cell = &f1ap_setup_req->cell[j].info;
served_cell_information->nRPCI = cell->nr_pci; // int 0..1007
/* - fiveGS_TAC */
if (cell->tac != NULL) {
uint32_t tac = htonl(*cell->tac);
served_cell_information->fiveGS_TAC = calloc(1, sizeof(*served_cell_information->fiveGS_TAC));
OCTET_STRING_fromBuf(served_cell_information->fiveGS_TAC, ((char *)&tac)+1, 3);
for (int j = 0; j < upd->num_cells_to_add; j++) {
const f1ap_served_cell_info_t *cell = &upd->cell_to_add[j].info;
const f1ap_gnb_du_system_info_t *sys_info = upd->cell_to_add[j].sys_info;
asn1cSequenceAdd(ie2->value.choice.Served_Cells_To_Add_List.list,
F1AP_Served_Cells_To_Add_ItemIEs_t,
served_cells_to_add_item_ies);
served_cells_to_add_item_ies->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Add_Item;
served_cells_to_add_item_ies->criticality = F1AP_Criticality_reject;
served_cells_to_add_item_ies->value.present = F1AP_Served_Cells_To_Add_ItemIEs__value_PR_Served_Cells_To_Add_Item;
F1AP_Served_Cells_To_Add_Item_t *served_cells_to_add_item =
&served_cells_to_add_item_ies->value.choice.Served_Cells_To_Add_Item;
served_cells_to_add_item->served_Cell_Information = encode_served_cell_info(cell);
served_cells_to_add_item->gNB_DU_System_Information = encode_system_info(sys_info);
}
/* - Configured_EPS_TAC */
if(1) {
served_cell_information->configured_EPS_TAC = (F1AP_Configured_EPS_TAC_t *)calloc(1, sizeof(F1AP_Configured_EPS_TAC_t));
OCTET_STRING_fromBuf(served_cell_information->configured_EPS_TAC,"2", 2);
}
asn1cSequenceAdd(served_cell_information->servedPLMNs.list, F1AP_ServedPLMNs_Item_t, servedPLMN_item);
MCC_MNC_TO_PLMNID(cell->plmn.mcc, cell->plmn.mnc, cell->plmn.mnc_digit_length, &servedPLMN_item->pLMN_Identity);
// // /* - CHOICE NR-MODE-Info */
F1AP_NR_Mode_Info_t *nR_Mode_Info=&served_cell_information->nR_Mode_Info;
LOG_E(F1AP,"Here hardcoded values instead of values from configuration file\n");
if (cell->mode == F1AP_MODE_FDD) {
nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_fDD;
/* > FDD >> FDD Info */
asn1cCalloc(nR_Mode_Info->choice.fDD, fDD_Info);
/* >>> UL NRFreqInfo */
fDD_Info->uL_NRFreqInfo.nRARFCN = 999L;
asn1cSequenceAdd(fDD_Info->uL_NRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, ul_freqBandNrItem);
ul_freqBandNrItem->freqBandIndicatorNr = 888L;
asn1cSequenceAdd(ul_freqBandNrItem->supportedSULBandList.list, F1AP_SupportedSULFreqBandItem_t, ul_supportedSULFreqBandItem);
ul_supportedSULFreqBandItem->freqBandIndicatorNr = 777L;
/* >>> DL NRFreqInfo */
fDD_Info->dL_NRFreqInfo.nRARFCN = 666L;
asn1cSequenceAdd(fDD_Info->dL_NRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, dl_freqBandNrItem);
dl_freqBandNrItem->freqBandIndicatorNr = 555L;
asn1cSequenceAdd(dl_freqBandNrItem->supportedSULBandList.list, F1AP_SupportedSULFreqBandItem_t, dl_supportedSULFreqBandItem);
dl_supportedSULFreqBandItem->freqBandIndicatorNr = 444L;
/* >>> UL Transmission Bandwidth */
fDD_Info->uL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15;
fDD_Info->uL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11;
/* >>> DL Transmission Bandwidth */
fDD_Info->dL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15;
fDD_Info->dL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11;
} else if (cell->mode == F1AP_MODE_TDD) { // TDD
nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_tDD;
/* > TDD >> TDD Info */
asn1cCalloc(nR_Mode_Info->choice.tDD, tDD_Info);
/* >>> ARFCN */
tDD_Info->nRFreqInfo.nRARFCN = 999L; // Integer
asn1cSequenceAdd(tDD_Info->nRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, nr_freqBandNrItem);
nr_freqBandNrItem->freqBandIndicatorNr = 555L;
asn1cSequenceAdd(nr_freqBandNrItem->supportedSULBandList.list, F1AP_SupportedSULFreqBandItem_t, nr_supportedSULFreqBandItem);
nr_supportedSULFreqBandItem->freqBandIndicatorNr = 444L;
tDD_Info->transmission_Bandwidth.nRSCS= F1AP_NRSCS_scs15;
tDD_Info->transmission_Bandwidth.nRNRB= F1AP_NRNRB_nrb11;
} else {
AssertFatal(false, "illegal mode %d\n", cell->mode);
}
/* - measurementTimingConfiguration */
char *measurementTimingConfiguration = "0"; // sept. 2018
OCTET_STRING_fromBuf(&served_cell_information->measurementTimingConfiguration,
measurementTimingConfiguration,
strlen(measurementTimingConfiguration));
/* 2.1.2 gNB-DU System Information */
asn1cCalloc(served_cells_to_add_item->gNB_DU_System_Information, gNB_DU_System_Information);
OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
"1",
sizeof("1"));
OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
"1",
sizeof("1"));
}
/* mandatory */
/* c3. Served_Cells_To_Modify */
asn1cSequenceAdd(out, F1AP_GNBDUConfigurationUpdateIEs_t, ie3);
ie3->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Modify_List;
ie3->criticality = F1AP_Criticality_reject;
ie3->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Modify_List;
if (upd->num_cells_to_modify > 0) {
asn1cSequenceAdd(out->protocolIEs.list, F1AP_GNBDUConfigurationUpdateIEs_t, ie3);
ie3->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Modify_List;
ie3->criticality = F1AP_Criticality_reject;
ie3->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Modify_List;
for (int i = 0; i < upd->num_cells_to_modify; i++) {
const f1ap_served_cell_info_t *cell = &upd->cell_to_modify[i].info;
const f1ap_gnb_du_system_info_t *sys_info = upd->cell_to_modify[i].sys_info;
asn1cSequenceAdd(ie3->value.choice.Served_Cells_To_Modify_List.list,
F1AP_Served_Cells_To_Modify_ItemIEs_t,
served_cells_to_modify_item_ies);
served_cells_to_modify_item_ies->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Modify_Item;
served_cells_to_modify_item_ies->criticality = F1AP_Criticality_reject;
served_cells_to_modify_item_ies->value.present = F1AP_Served_Cells_To_Modify_ItemIEs__value_PR_Served_Cells_To_Modify_Item;
F1AP_Served_Cells_To_Modify_Item_t *served_cells_to_modify_item =
&served_cells_to_modify_item_ies->value.choice.Served_Cells_To_Modify_Item;
for (int i=0; i<1; i++) {
//
f1ap_served_cell_info_t *cell = &f1ap_setup_req->cell[i].info;
asn1cSequenceAdd(ie3->value.choice.Served_Cells_To_Modify_List.list, F1AP_Served_Cells_To_Modify_ItemIEs_t, served_cells_to_modify_item_ies);
served_cells_to_modify_item_ies->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Modify_Item;
served_cells_to_modify_item_ies->criticality = F1AP_Criticality_reject;
served_cells_to_modify_item_ies->value.present = F1AP_Served_Cells_To_Modify_ItemIEs__value_PR_Served_Cells_To_Modify_Item;
F1AP_Served_Cells_To_Modify_Item_t *served_cells_to_modify_item=&served_cells_to_modify_item_ies->value.choice.Served_Cells_To_Modify_Item;
/* 3.1 oldNRCGI */
//addnRGCI(served_cells_to_modify_item->oldNRCGI, f1ap_setup_req->cell[i]);
/* 3.2.1 serverd cell Information */
F1AP_Served_Cell_Information_t *served_cell_information= &served_cells_to_modify_item->served_Cell_Information;
/* - nRCGI */
//addnRGCI(served_cell_information->nRCGI,f1ap_setup_req->cell[i]);
/* - nRPCI */
served_cell_information->nRPCI = cell->nr_pci; // int 0..1007
/* - fiveGS_TAC */
asn1cCalloc(served_cell_information->fiveGS_TAC, tac );
OCTET_STRING_fromBuf(tac,
(const char *) &cell->tac,
3);
F1AP_NRCGI_t *oldNRCGI = &served_cells_to_modify_item->oldNRCGI;
const f1ap_plmn_t *old_plmn = &upd->cell_to_modify[i].old_plmn;
MCC_MNC_TO_PLMNID(old_plmn->mcc, old_plmn->mnc, old_plmn->mnc_digit_length, &oldNRCGI->pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(upd->cell_to_modify[i].old_nr_cellid, &oldNRCGI->nRCellIdentity);
/* - Configured_EPS_TAC */
if(1) {
asn1cCalloc(served_cell_information->configured_EPS_TAC, tmp2);
OCTET_STRING_fromBuf(tmp2,
"2",
2);
served_cells_to_modify_item->served_Cell_Information = encode_served_cell_info(cell);
served_cells_to_modify_item->gNB_DU_System_Information = encode_system_info(sys_info);
}
asn1cSequenceAdd(served_cell_information->servedPLMNs.list, F1AP_ServedPLMNs_Item_t, servedPLMN_item);
MCC_MNC_TO_PLMNID(cell->plmn.mcc, cell->plmn.mnc, cell->plmn.mnc_digit_length, &servedPLMN_item->pLMN_Identity);
// // /* - CHOICE NR-MODE-Info */
F1AP_NR_Mode_Info_t *nR_Mode_Info= &served_cell_information->nR_Mode_Info;
if (cell->mode == F1AP_MODE_FDD) {
nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_fDD;
/* > FDD >> FDD Info */
asn1cCalloc(nR_Mode_Info->choice.fDD, fDD_Info);
/* >>> UL NRFreqInfo */
fDD_Info->uL_NRFreqInfo.nRARFCN = 999L;
asn1cSequenceAdd(fDD_Info->uL_NRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, ul_freqBandNrItem);
ul_freqBandNrItem->freqBandIndicatorNr = 888L;
asn1cSequenceAdd(ul_freqBandNrItem->supportedSULBandList.list, F1AP_SupportedSULFreqBandItem_t, ul_supportedSULFreqBandItem);
ul_supportedSULFreqBandItem->freqBandIndicatorNr = 777L;
/* >>> DL NRFreqInfo */
fDD_Info->dL_NRFreqInfo.nRARFCN = 666L;
asn1cSequenceAdd(dl_freqBandNrItem->supportedSULBandList.list, F1AP_FreqBandNrItem_t, dl_freqBandNrItem);
dl_freqBandNrItem->freqBandIndicatorNr = 555L;
F1AP_SupportedSULFreqBandItem_t dl_supportedSULFreqBandItem;
memset((void *)&dl_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
dl_supportedSULFreqBandItem.freqBandIndicatorNr = 444L;
/* >>> UL Transmission Bandwidth */
fDD_Info->uL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15;
fDD_Info->uL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11;
/* >>> DL Transmission Bandwidth */
fDD_Info->dL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15;
fDD_Info->dL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11;
} else if (cell->mode == F1AP_MODE_TDD) { // TDD
nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_tDD;
/* > TDD >> TDD Info */
asn1cCalloc(nR_Mode_Info->choice.tDD, tDD_Info);
/* >>> ARFCN */
tDD_Info->nRFreqInfo.nRARFCN = 999L; // Integer
asn1cSequenceAdd(tDD_Info->nRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, nr_freqBandNrItem);
nr_freqBandNrItem->freqBandIndicatorNr = 555L;
asn1cSequenceAdd(nr_freqBandNrItem->supportedSULBandList.list, F1AP_SupportedSULFreqBandItem_t, nr_supportedSULFreqBandItem);
nr_supportedSULFreqBandItem->freqBandIndicatorNr = 444L;
tDD_Info->transmission_Bandwidth.nRSCS= F1AP_NRSCS_scs15;
tDD_Info->transmission_Bandwidth.nRNRB= F1AP_NRNRB_nrb11;
} else {
AssertFatal(false, "unknown mode %d\n", cell->mode);
}
/* - measurementTimingConfiguration */
char *measurementTimingConfiguration = "0"; // sept. 2018
OCTET_STRING_fromBuf(&served_cell_information->measurementTimingConfiguration,
measurementTimingConfiguration,
strlen(measurementTimingConfiguration));
/* 3.2.2 gNB-DU System Information */
asn1cCalloc( served_cells_to_modify_item->gNB_DU_System_Information, gNB_DU_System_Information);
OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
"1",
sizeof("1"));
OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
"1",
sizeof("1"));
}
/* mandatory */
/* c4. Served_Cells_To_Delete */
asn1cSequenceAdd(out, F1AP_GNBDUConfigurationUpdateIEs_t, ie4);
ie4->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Delete_List;
ie4->criticality = F1AP_Criticality_reject;
ie4->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Delete_List;
for (int i=0; i<1; i++) {
//
asn1cSequenceAdd(ie4->value.choice.Served_Cells_To_Delete_List.list, F1AP_Served_Cells_To_Delete_ItemIEs_t, served_cells_to_delete_item_ies);
served_cells_to_delete_item_ies->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Delete_Item;
served_cells_to_delete_item_ies->criticality = F1AP_Criticality_reject;
served_cells_to_delete_item_ies->value.present = F1AP_Served_Cells_To_Delete_ItemIEs__value_PR_Served_Cells_To_Delete_Item;
F1AP_Served_Cells_To_Delete_Item_t *served_cells_to_delete_item=&served_cells_to_delete_item_ies->value.choice.Served_Cells_To_Delete_Item;
/* 3.1 oldNRCGI */
addnRCGI(served_cells_to_delete_item->oldNRCGI, &f1ap_setup_req->cell[i].info);
if (upd->num_cells_to_delete > 0) {
asn1cSequenceAdd(out->protocolIEs.list, F1AP_GNBDUConfigurationUpdateIEs_t, ie4);
ie4->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Delete_List;
ie4->criticality = F1AP_Criticality_reject;
ie4->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Delete_List;
AssertFatal(upd->num_cells_to_delete == 0, "code for deleting cells not tested\n");
for (int i = 0; i < upd->num_cells_to_delete; i++) {
asn1cSequenceAdd(ie4->value.choice.Served_Cells_To_Delete_List.list,
F1AP_Served_Cells_To_Delete_ItemIEs_t,
served_cells_to_delete_item_ies);
served_cells_to_delete_item_ies->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Delete_Item;
served_cells_to_delete_item_ies->criticality = F1AP_Criticality_reject;
served_cells_to_delete_item_ies->value.present = F1AP_Served_Cells_To_Delete_ItemIEs__value_PR_Served_Cells_To_Delete_Item;
F1AP_Served_Cells_To_Delete_Item_t *served_cells_to_delete_item =
&served_cells_to_delete_item_ies->value.choice.Served_Cells_To_Delete_Item;
addnRCGI(served_cells_to_delete_item->oldNRCGI, &upd->cell_to_delete[i]);
}
}
AssertFatal(upd->gNB_DU_ID == 0, "encoding of gNB-DU Id not handled yet\n");
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
LOG_E(F1AP, "Failed to encode F1 gNB-DU CONFIGURATION UPDATE\n");
return -1;
}
ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0;
}

View File

@@ -50,7 +50,7 @@ int DU_handle_ERROR_INDICATION(instance_t instance, sctp_assoc_t assoc_id, uint3
/*
* F1 Setup
*/
int DU_send_F1_SETUP_REQUEST(sctp_assoc_t assoc_id, f1ap_setup_req_t *setup_req);
int DU_send_F1_SETUP_REQUEST(sctp_assoc_t assoc_id, const f1ap_setup_req_t *setup_req);
int DU_handle_F1_SETUP_RESPONSE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
@@ -59,8 +59,7 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance, sctp_assoc_t assoc_id, uint3
/*
* gNB-DU Configuration Update
*/
int DU_send_gNB_DU_CONFIGURATION_UPDATE(sctp_assoc_t assoc_id,
f1ap_setup_req_t *f1ap_du_data);
int DU_send_gNB_DU_CONFIGURATION_UPDATE(sctp_assoc_t assoc_id, const f1ap_gnb_du_configuration_update_t *upd);
int DU_handle_gNB_DU_CONFIGURATION_FAILURE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);

View File

@@ -186,6 +186,10 @@ void *F1AP_DU_task(void *arg) {
DU_send_UE_CONTEXT_MODIFICATION_REQUIRED(assoc_id, &F1AP_UE_CONTEXT_MODIFICATION_REQUIRED(msg));
break;
case F1AP_GNB_DU_CONFIGURATION_UPDATE:
DU_send_gNB_DU_CONFIGURATION_UPDATE(assoc_id, &F1AP_GNB_DU_CONFIGURATION_UPDATE(msg));
break;
case TERMINATE_MESSAGE:
LOG_W(F1AP, " *** Exiting F1AP thread\n");
itti_exit_task();

View File

@@ -45,7 +45,7 @@ static const f1ap_message_processing_t f1ap_messages_processing[][3] = {
{0, 0, 0}, /* Reset */
{CU_handle_F1_SETUP_REQUEST, DU_handle_F1_SETUP_RESPONSE, DU_handle_F1_SETUP_FAILURE}, /* F1Setup */
{0, 0, 0}, /* ErrorIndication */
{0, 0, 0}, /* gNBDUConfigurationUpdate */
{CU_handle_gNB_DU_CONFIGURATION_UPDATE, 0, 0}, /* gNBDUConfigurationUpdate */
{DU_handle_gNB_CU_CONFIGURATION_UPDATE,
CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE,
CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE}, /* gNBCUConfigurationUpdate */

View File

@@ -82,6 +82,7 @@
#include "NR_RateMatchPatternLTE-CRS.h"
#include "NR_SearchSpace.h"
#include "NR_ControlResourceSet.h"
#include "NR_MeasurementTimingConfiguration.h"
#include "NR_EUTRA-MBSFN-SubframeConfig.h"
#include "uper_decoder.h"
#include "uper_encoder.h"
@@ -108,20 +109,35 @@ const sync_raster_t sync_raster[] = {
{7, 0, 6554, 1, 6718},
{8, 0, 2318, 1, 2395},
{12, 0, 1828, 1, 1858},
{13, 0, 1871, 1, 1885},
{14, 0, 1901, 1, 1915},
{18, 0, 2156, 1, 2182},
{20, 0, 1982, 1, 2047},
{24, 0, 3818, 1, 3892},
{24, 1, 3824, 1, 3886},
{25, 0, 4829, 1, 4981},
{26, 0, 2153, 1, 2230},
{28, 0, 1901, 1, 2002},
{29, 0, 1798, 1, 1813},
{30, 0, 5879, 1, 5893},
{34, 0, 5030, 1, 5056},
{34, 1, 5036, 1, 5050},
{38, 0, 6431, 1, 6544},
{38, 1, 6437, 1, 6538},
{39, 0, 4706, 1, 4795},
{39, 1, 4712, 1, 4789},
{40, 1, 5762, 1, 5989},
{41, 0, 6246, 3, 6717},
{41, 1, 6252, 3, 6714},
{48, 1, 7884, 1, 7982},
{50, 0, 3584, 1, 3787},
{51, 0, 3572, 1, 3574},
{53, 0, 6215, 1, 6232},
{53, 1, 6221, 1, 6226},
{65, 0, 5279, 1, 5494},
{66, 0, 5279, 1, 5494},
{66, 1, 5285, 1, 5488},
{67, 0, 1850, 1, 1888},
{70, 0, 4993, 1, 5044},
{71, 0, 1547, 1, 1624},
{74, 0, 3692, 1, 3790},
@@ -130,6 +146,12 @@ const sync_raster_t sync_raster[] = {
{77, 1, 7711, 1, 8329},
{78, 1, 7711, 1, 8051},
{79, 1, 8480, 16, 8880},
{85, 0, 1826, 1, 1858},
{90, 1, 6252, 1, 6714},
{91, 0, 3572, 1, 3574},
{92, 0, 3584, 1, 3787},
{93, 0, 3572, 1, 3574},
{94, 0, 3584, 1, 3587},
{257, 3, 22388, 1, 22558},
{257, 4, 22390, 2, 22556},
{258, 3, 22257, 1, 22443},
@@ -164,12 +186,13 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) {
scc->n_TimingAdvanceOffset = CALLOC(1, sizeof(long));
scc->ssb_PositionsInBurst = CALLOC(1,sizeof(struct NR_ServingCellConfigCommon__ssb_PositionsInBurst));
scc->ssb_periodicityServingCell = CALLOC(1,sizeof(long));
// scc->rateMatchPatternToAddModList = CALLOC(1,sizeof(struct NR_ServingCellConfigCommon__rateMatchPatternToAddModList));
// scc->rateMatchPatternToReleaseList = CALLOC(1,sizeof(struct NR_ServingCellConfigCommon__rateMatchPatternToReleaseList));
// scc->rateMatchPatternToAddModList = CALLOC(1,sizeof(struct
// NR_ServingCellConfigCommon__rateMatchPatternToAddModList)); scc->rateMatchPatternToReleaseList =
// CALLOC(1,sizeof(struct NR_ServingCellConfigCommon__rateMatchPatternToReleaseList));
scc->ssbSubcarrierSpacing = CALLOC(1,sizeof(NR_SubcarrierSpacing_t));
scc->tdd_UL_DL_ConfigurationCommon = CALLOC(1,sizeof(struct NR_TDD_UL_DL_ConfigCommon));
scc->tdd_UL_DL_ConfigurationCommon->pattern2 = CALLOC(1,sizeof(struct NR_TDD_UL_DL_Pattern));
scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB = CALLOC(1,sizeof(NR_ARFCN_ValueNR_t));
dl_frequencyBandList = CALLOC(1,sizeof(NR_FreqBandIndicatorNR_t));
@@ -356,6 +379,39 @@ void fill_scc_sim(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_R
*scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing=-1;
}
static void fix_tdd_pattern(NR_ServingCellConfigCommon_t *scc)
{
int pattern_ext = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity - 7;
/* The pattern1 extension is not configured so free the ext1 and dl_UL_TransmissionPeriodicity_v1530
* as these shall not be encoded with default values in SIB1
*/
if (pattern_ext > 0) {
scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 = CALLOC(1, sizeof(struct NR_TDD_UL_DL_Pattern__ext1));
scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 = CALLOC(1, sizeof(long));
*scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 = pattern_ext - 1 ;
scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity = 5;
}
if (scc->tdd_UL_DL_ConfigurationCommon->pattern2 != NULL) {
/* The pattern2 is not configured free the memory these shall not be encoded with default values in SIB1 */
if (scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity > 320) {
free(scc->tdd_UL_DL_ConfigurationCommon->pattern2);
scc->tdd_UL_DL_ConfigurationCommon->pattern2 = NULL;
}
} else {
/* The pattern2 extension is not configured so free the ext1 and dl_UL_TransmissionPeriodicity_v1530
* as these shall not be encoded with default values in SIB1
*/
pattern_ext = scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity - 7;
if (pattern_ext > 0) {
scc->tdd_UL_DL_ConfigurationCommon->pattern2->ext1 = CALLOC(1, sizeof(struct NR_TDD_UL_DL_Pattern__ext1));
scc->tdd_UL_DL_ConfigurationCommon->pattern2->ext1->dl_UL_TransmissionPeriodicity_v1530 = CALLOC(1, sizeof(long));
*scc->tdd_UL_DL_ConfigurationCommon->pattern2->ext1->dl_UL_TransmissionPeriodicity_v1530 = pattern_ext - 1;
scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity = 5;
}
}
}
void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) {
@@ -430,11 +486,7 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) {
ASN_STRUCT_FREE(asn_DEF_NR_TDD_UL_DL_ConfigCommon, scc->tdd_UL_DL_ConfigurationCommon);
scc->tdd_UL_DL_ConfigurationCommon = NULL;
} else { // TDD
if (scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity > 320 ) {
free(scc->tdd_UL_DL_ConfigurationCommon->pattern2);
scc->tdd_UL_DL_ConfigurationCommon->pattern2 = NULL;
}
fix_tdd_pattern(scc);
}
if ((int)*scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing == -1) {
@@ -1074,6 +1126,8 @@ static int read_du_cell_info(configmodule_interface_t *cfg,
PLMNParams[I].chkPptr = &(config_check_PLMNParams[I]);
paramlist_def_t PLMNParamList = {GNB_CONFIG_STRING_PLMN_LIST, NULL, 0};
config_getlist(cfg, &PLMNParamList, PLMNParams, sizeof(PLMNParams) / sizeof(paramdef_t), aprefix);
AssertFatal(PLMNParamList.numelt > 0, "need to have a PLMN in PLMN section\n");
AssertFatal(PLMNParamList.numelt == 1, "cannot have more than one PLMN\n");
// if fronthaul is F1, require gNB_DU_ID, else use gNB_ID
if (separate_du) {
@@ -1098,12 +1152,53 @@ static int read_du_cell_info(configmodule_interface_t *cfg,
info->plmn.mnc_digit_length);
info->nr_cellid = (uint64_t) * (GNBParamList.paramarray[0][GNB_NRCELLID_IDX].u64ptr);
LOG_W(GNB_APP, "no slices transported via F1 Setup Request!\n");
info->num_ssi = 0;
paramdef_t SNSSAIParams[] = GNBSNSSAIPARAMS_DESC;
paramlist_def_t SNSSAIParamList = {GNB_CONFIG_STRING_SNSSAI_LIST, NULL, 0};
checkedparam_t config_check_SNSSAIParams[] = SNSSAIPARAMS_CHECK;
for (int J = 0; J < sizeofArray(SNSSAIParams); ++J)
SNSSAIParams[J].chkPptr = &(config_check_SNSSAIParams[J]);
char snssaistr[MAX_OPTNAME_SIZE * 2 + 8];
sprintf(snssaistr, "%s.[0].%s.[0]", GNB_CONFIG_STRING_GNB_LIST, GNB_CONFIG_STRING_PLMN_LIST);
config_getlist(config_get_if(), &SNSSAIParamList, SNSSAIParams, sizeofArray(SNSSAIParams), snssaistr);
info->num_ssi = SNSSAIParamList.numelt;
for (int s = 0; s < info->num_ssi; ++s) {
info->nssai[s].sst = *SNSSAIParamList.paramarray[s][GNB_SLICE_SERVICE_TYPE_IDX].uptr;
info->nssai[s].sd = *SNSSAIParamList.paramarray[s][GNB_SLICE_DIFFERENTIATOR_IDX].uptr;
AssertFatal(info->nssai[s].sd <= 0xffffff, "SD cannot be bigger than 0xffffff, but is %d\n", info->nssai[s].sd);
}
return 1;
}
static f1ap_tdd_info_t read_tdd_config(const NR_ServingCellConfigCommon_t *scc)
{
const NR_FrequencyInfoDL_t *dl = scc->downlinkConfigCommon->frequencyInfoDL;
f1ap_tdd_info_t tdd = {
.freqinfo.arfcn = dl->absoluteFrequencyPointA,
.freqinfo.band = *dl->frequencyBandList.list.array[0],
.tbw.scs = dl->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
.tbw.nrb = dl->scs_SpecificCarrierList.list.array[0]->carrierBandwidth,
};
return tdd;
}
static f1ap_fdd_info_t read_fdd_config(const NR_ServingCellConfigCommon_t *scc)
{
const NR_FrequencyInfoDL_t *dl = scc->downlinkConfigCommon->frequencyInfoDL;
const NR_FrequencyInfoUL_t *ul = scc->uplinkConfigCommon->frequencyInfoUL;
f1ap_fdd_info_t fdd = {
.dl_freqinfo.arfcn = dl->absoluteFrequencyPointA,
.ul_freqinfo.arfcn = *ul->absoluteFrequencyPointA,
.dl_tbw.scs = dl->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
.ul_tbw.scs = ul->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
.dl_tbw.nrb = dl->scs_SpecificCarrierList.list.array[0]->carrierBandwidth,
.ul_tbw.nrb = ul->scs_SpecificCarrierList.list.array[0]->carrierBandwidth,
.dl_freqinfo.band = *dl->frequencyBandList.list.array[0],
.ul_freqinfo.band = *ul->frequencyBandList->list.array[0],
};
return fdd;
}
static f1ap_setup_req_t *RC_read_F1Setup(uint64_t id,
const char *name,
const f1ap_served_cell_info_t *info,
@@ -1129,30 +1224,26 @@ static f1ap_setup_req_t *RC_read_F1Setup(uint64_t id,
req->cell[0].info.nr_cellid);
req->cell[0].info.nr_pci = *scc->physCellId;
struct NR_FrequencyInfoDL *frequencyInfoDL = scc->downlinkConfigCommon->frequencyInfoDL;
if (scc->tdd_UL_DL_ConfigurationCommon) {
LOG_I(GNB_APP, "ngran_DU: Configuring Cell %d for TDD\n", 0);
req->cell[0].info.mode = F1AP_MODE_TDD;
f1ap_tdd_info_t *tdd = &req->cell[0].info.tdd;
tdd->freqinfo.arfcn = frequencyInfoDL->absoluteFrequencyPointA;
tdd->tbw.scs = frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
tdd->tbw.nrb = frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
tdd->freqinfo.band = *frequencyInfoDL->frequencyBandList.list.array[0];
req->cell[0].info.tdd = read_tdd_config(scc);
} else {
LOG_I(GNB_APP, "ngran_DU: Configuring Cell %d for FDD\n", 0);
req->cell[0].info.mode = F1AP_MODE_FDD;
f1ap_fdd_info_t *fdd = &req->cell[0].info.fdd;
fdd->dl_freqinfo.arfcn = frequencyInfoDL->absoluteFrequencyPointA;
fdd->ul_freqinfo.arfcn = *scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA;
fdd->dl_tbw.scs = frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
fdd->ul_tbw.scs = scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
fdd->dl_tbw.nrb = frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
fdd->ul_tbw.nrb = scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
fdd->dl_freqinfo.band = *frequencyInfoDL->frequencyBandList.list.array[0];
fdd->ul_freqinfo.band = *scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0];
req->cell[0].info.fdd = read_fdd_config(scc);
}
req->cell[0].info.measurement_timing_information = "0";
NR_MeasurementTimingConfiguration_t *mtc = get_new_MeasurementTimingConfiguration(scc);
uint8_t buf[1024];
int len = encode_MeasurementTimingConfiguration(mtc, buf, sizeof(buf));
DevAssert(len <= sizeof(buf));
free_MeasurementTimingConfiguration(mtc);
uint8_t *mtc_buf = calloc(len, sizeof(*mtc_buf));
AssertFatal(mtc_buf != NULL, "out of memory\n");
memcpy(mtc_buf, buf, len);
req->cell[0].info.measurement_timing_config = mtc_buf;
req->cell[0].info.measurement_timing_config_len = len;
if (get_softmodem_params()->sa) {
// in NSA we don't transmit SIB1, so cannot fill DU system information
@@ -1165,7 +1256,8 @@ static f1ap_setup_req_t *RC_read_F1Setup(uint64_t id,
sys_info->mib = calloc(buf_len, sizeof(*sys_info->mib));
DevAssert(sys_info->mib != NULL);
DevAssert(mib != NULL);
sys_info->mib_length = encode_MIB_NR(mib, 0, sys_info->mib, buf_len);
// encode only the mib message itself
sys_info->mib_length = encode_MIB_NR_setup(mib->message.choice.mib, 0, sys_info->mib, buf_len);
DevAssert(sys_info->mib_length == buf_len);
DevAssert(sib1 != NULL);
@@ -1953,6 +2045,7 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) {
memset((void*)scc,0,sizeof(NR_ServingCellConfigCommon_t));
prepare_scc(scc);
paramdef_t SCCsParams[] = SCCPARAMS_DESC(scc);
paramlist_def_t SCCsParamList = {GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON, NULL, 0};
AssertFatal(i < GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt,

View File

@@ -93,7 +93,6 @@ typedef struct ru_config_s {
*/
void RCconfig_verify(configmodule_interface_t *cfg, ngran_node_t node_type);
extern void NRRCconfig_RU(void);
extern void RCconfig_nr_prs(void);
extern void RCconfig_NR_L1(void);
extern void RCconfig_nr_macrlc(configmodule_interface_t *cfg);

Some files were not shown because too many files have changed in this diff Show More