From cc635168dd2174f7a99823475949e363977cd4bd Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Wed, 29 Dec 2021 19:08:58 +0100 Subject: [PATCH 01/15] enb,rrc: add more context to log line --- srsenb/src/stack/rrc/rrc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index 74002f586..ebe659607 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -1027,7 +1027,7 @@ void rrc::tti_clock() if (p.pdu != nullptr) { log_rx_pdu_fail(p.rnti, p.lcid, *p.pdu, "unknown rnti"); } else { - logger.warning("Ignoring rnti=0x%x command. Cause: unknown rnti", p.rnti); + logger.warning("Ignoring rnti=0x%x command %d arg %d. Cause: unknown rnti", p.rnti, p.lcid, p.arg); } continue; } From 40138c7125e75c879197ef31664ebc33c225058d Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Wed, 5 Jan 2022 16:18:09 +0100 Subject: [PATCH 02/15] changed namespace of asn1 ngap from 'ngap_nr' to simply 'ngap' --- lib/include/srsran/asn1/ngap.h | 524 +++++++++--------- lib/include/srsran/asn1/ngap_utils.h | 2 +- .../srsran/interfaces/gnb_ngap_interfaces.h | 32 +- .../srsran/interfaces/gnb_rrc_nr_interfaces.h | 10 +- lib/src/asn1/asn1_utils.cc | 12 +- lib/src/asn1/ngap.cc | 158 +++--- lib/test/asn1/ngap_test.cc | 4 +- .../hdr/stack/common/test/dummy_nr_classes.h | 20 +- srsgnb/hdr/stack/ngap/ngap.h | 58 +- srsgnb/hdr/stack/ngap/ngap_ue.h | 18 +- .../hdr/stack/ngap/ngap_ue_bearer_manager.h | 12 +- srsgnb/hdr/stack/ngap/ngap_ue_proc.h | 6 +- srsgnb/hdr/stack/rrc/rrc_nr.h | 6 +- .../hdr/stack/rrc/rrc_nr_security_context.h | 16 +- srsgnb/hdr/stack/rrc/rrc_nr_ue.h | 5 +- srsgnb/src/stack/ngap/ngap.cc | 54 +- srsgnb/src/stack/ngap/ngap_ue.cc | 40 +- .../src/stack/ngap/ngap_ue_bearer_manager.cc | 6 +- srsgnb/src/stack/ngap/ngap_ue_proc.cc | 17 +- srsgnb/src/stack/ngap/test/ngap_test.cc | 32 +- srsgnb/src/stack/rrc/rrc_nr.cc | 6 +- .../src/stack/rrc/rrc_nr_security_context.cc | 2 +- srsgnb/src/stack/rrc/rrc_nr_ue.cc | 12 +- .../src/stack/rrc/test/rrc_nr_test_helpers.h | 10 +- 24 files changed, 529 insertions(+), 533 deletions(-) diff --git a/lib/include/srsran/asn1/ngap.h b/lib/include/srsran/asn1/ngap.h index b90fa9298..d3cd56432 100644 --- a/lib/include/srsran/asn1/ngap.h +++ b/lib/include/srsran/asn1/ngap.h @@ -12,280 +12,280 @@ /******************************************************************************* * - * 3GPP TS ASN1 NGAP NR v15.3.0 (2019-03) + * 3GPP TS ASN1 NGAP v15.3.0 (2019-03) * ******************************************************************************/ -#ifndef SRSASN1_NGAP_NR_H -#define SRSASN1_NGAP_NR_H +#ifndef SRSASN1_NGAP_H +#define SRSASN1_NGAP_H #include "asn1_utils.h" #include #include namespace asn1 { -namespace ngap_nr { +namespace ngap { /******************************************************************************* * Constant Definitions ******************************************************************************/ -#define ASN1_NGAP_NR_ID_AMF_CFG_UPD 0 -#define ASN1_NGAP_NR_ID_AMF_STATUS_IND 1 -#define ASN1_NGAP_NR_ID_CELL_TRAFFIC_TRACE 2 -#define ASN1_NGAP_NR_ID_DEACTIV_TRACE 3 -#define ASN1_NGAP_NR_ID_DL_NAS_TRANSPORT 4 -#define ASN1_NGAP_NR_ID_DL_NON_UEASSOCIATED_NRP_PA_TRANSPORT 5 -#define ASN1_NGAP_NR_ID_DL_RAN_CFG_TRANSFER 6 -#define ASN1_NGAP_NR_ID_DL_RAN_STATUS_TRANSFER 7 -#define ASN1_NGAP_NR_ID_DL_UEASSOCIATED_NRP_PA_TRANSPORT 8 -#define ASN1_NGAP_NR_ID_ERROR_IND 9 -#define ASN1_NGAP_NR_ID_HO_CANCEL 10 -#define ASN1_NGAP_NR_ID_HO_NOTIF 11 -#define ASN1_NGAP_NR_ID_HO_PREP 12 -#define ASN1_NGAP_NR_ID_HO_RES_ALLOC 13 -#define ASN1_NGAP_NR_ID_INIT_CONTEXT_SETUP 14 -#define ASN1_NGAP_NR_ID_INIT_UE_MSG 15 -#define ASN1_NGAP_NR_ID_LOCATION_REPORT_CTRL 16 -#define ASN1_NGAP_NR_ID_LOCATION_REPORT_FAIL_IND 17 -#define ASN1_NGAP_NR_ID_LOCATION_REPORT 18 -#define ASN1_NGAP_NR_ID_NAS_NON_DELIVERY_IND 19 -#define ASN1_NGAP_NR_ID_NG_RESET 20 -#define ASN1_NGAP_NR_ID_NG_SETUP 21 -#define ASN1_NGAP_NR_ID_OVERLOAD_START 22 -#define ASN1_NGAP_NR_ID_OVERLOAD_STOP 23 -#define ASN1_NGAP_NR_ID_PAGING 24 -#define ASN1_NGAP_NR_ID_PATH_SWITCH_REQUEST 25 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_MODIFY 26 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_MODIFY_IND 27 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_RELEASE 28 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_SETUP 29 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_NOTIFY 30 -#define ASN1_NGAP_NR_ID_PRIVATE_MSG 31 -#define ASN1_NGAP_NR_ID_PWS_CANCEL 32 -#define ASN1_NGAP_NR_ID_PWS_FAIL_IND 33 -#define ASN1_NGAP_NR_ID_PWS_RESTART_IND 34 -#define ASN1_NGAP_NR_ID_RAN_CFG_UPD 35 -#define ASN1_NGAP_NR_ID_REROUTE_NAS_REQUEST 36 -#define ASN1_NGAP_NR_ID_RRC_INACTIVE_TRANSITION_REPORT 37 -#define ASN1_NGAP_NR_ID_TRACE_FAIL_IND 38 -#define ASN1_NGAP_NR_ID_TRACE_START 39 -#define ASN1_NGAP_NR_ID_UE_CONTEXT_MOD 40 -#define ASN1_NGAP_NR_ID_UE_CONTEXT_RELEASE 41 -#define ASN1_NGAP_NR_ID_UE_CONTEXT_RELEASE_REQUEST 42 -#define ASN1_NGAP_NR_ID_UE_RADIO_CAP_CHECK 43 -#define ASN1_NGAP_NR_ID_UE_RADIO_CAP_INFO_IND 44 -#define ASN1_NGAP_NR_ID_UETNLA_BINDING_RELEASE 45 -#define ASN1_NGAP_NR_ID_UL_NAS_TRANSPORT 46 -#define ASN1_NGAP_NR_ID_UL_NON_UEASSOCIATED_NRP_PA_TRANSPORT 47 -#define ASN1_NGAP_NR_ID_UL_RAN_CFG_TRANSFER 48 -#define ASN1_NGAP_NR_ID_UL_RAN_STATUS_TRANSFER 49 -#define ASN1_NGAP_NR_ID_UL_UEASSOCIATED_NRP_PA_TRANSPORT 50 -#define ASN1_NGAP_NR_ID_WRITE_REPLACE_WARNING 51 -#define ASN1_NGAP_NR_ID_SECONDARY_RAT_DATA_USAGE_REPORT 52 -#define ASN1_NGAP_NR_MAX_PRIVATE_IES 65535 -#define ASN1_NGAP_NR_MAX_PROTOCOL_EXTS 65535 -#define ASN1_NGAP_NR_MAX_PROTOCOL_IES 65535 -#define ASN1_NGAP_NR_MAXNOOF_ALLOWED_AREAS 16 -#define ASN1_NGAP_NR_MAXNOOF_ALLOWED_S_NSSAIS 8 -#define ASN1_NGAP_NR_MAXNOOF_BPLMNS 12 -#define ASN1_NGAP_NR_MAXNOOF_CELL_IDFOR_WARNING 65535 -#define ASN1_NGAP_NR_MAXNOOF_CELLIN_AO_I 256 -#define ASN1_NGAP_NR_MAXNOOF_CELLIN_EAI 65535 -#define ASN1_NGAP_NR_MAXNOOF_CELLIN_TAI 65535 -#define ASN1_NGAP_NR_MAXNOOF_CELLSING_NB 16384 -#define ASN1_NGAP_NR_MAXNOOF_CELLSINNGENB 256 -#define ASN1_NGAP_NR_MAXNOOF_CELLSIN_UE_HISTORY_INFO 16 -#define ASN1_NGAP_NR_MAXNOOF_CELLS_UE_MOVING_TRAJECTORY 16 -#define ASN1_NGAP_NR_MAXNOOF_DRBS 32 -#define ASN1_NGAP_NR_MAXNOOF_EMERGENCY_AREA_ID 65535 -#define ASN1_NGAP_NR_MAXNOOF_EA_IFOR_RESTART 256 -#define ASN1_NGAP_NR_MAXNOOF_EPLMNS 15 -#define ASN1_NGAP_NR_MAXNOOF_EPLMNS_PLUS_ONE 16 -#define ASN1_NGAP_NR_MAXNOOF_ERABS 256 -#define ASN1_NGAP_NR_MAXNOOF_ERRORS 256 -#define ASN1_NGAP_NR_MAXNOOF_FORB_TACS 4096 -#define ASN1_NGAP_NR_MAXNOOF_MULTI_CONNECT 4 -#define ASN1_NGAP_NR_MAXNOOF_MULTI_CONNECT_MINUS_ONE 3 -#define ASN1_NGAP_NR_MAXNOOF_NG_CONNS_TO_RESET 65536 -#define ASN1_NGAP_NR_MAXNOOF_PDU_SESSIONS 256 -#define ASN1_NGAP_NR_MAXNOOF_PLMNS 12 -#define ASN1_NGAP_NR_MAXNOOF_QOS_FLOWS 64 -#define ASN1_NGAP_NR_MAXNOOF_RAN_NODEIN_AO_I 64 -#define ASN1_NGAP_NR_MAXNOOF_RECOMMENDED_CELLS 16 -#define ASN1_NGAP_NR_MAXNOOF_RECOMMENDED_RAN_NODES 16 -#define ASN1_NGAP_NR_MAXNOOF_AO_I 64 -#define ASN1_NGAP_NR_MAXNOOF_SERVED_GUAMIS 256 -#define ASN1_NGAP_NR_MAXNOOF_SLICE_ITEMS 1024 -#define ASN1_NGAP_NR_MAXNOOF_TACS 256 -#define ASN1_NGAP_NR_MAXNOOF_TA_IFOR_INACTIVE 16 -#define ASN1_NGAP_NR_MAXNOOF_TA_IFOR_PAGING 16 -#define ASN1_NGAP_NR_MAXNOOF_TA_IFOR_RESTART 2048 -#define ASN1_NGAP_NR_MAXNOOF_TA_IFOR_WARNING 65535 -#define ASN1_NGAP_NR_MAXNOOF_TA_IIN_AO_I 16 -#define ASN1_NGAP_NR_MAXNOOF_TIME_PERIODS 2 -#define ASN1_NGAP_NR_MAXNOOF_TNLASSOCS 32 -#define ASN1_NGAP_NR_MAXNOOF_XN_EXT_TLAS 2 -#define ASN1_NGAP_NR_MAXNOOF_XN_GTP_TLAS 16 -#define ASN1_NGAP_NR_MAXNOOF_XN_TLAS 16 -#define ASN1_NGAP_NR_ID_ALLOWED_NSSAI 0 -#define ASN1_NGAP_NR_ID_AMF_NAME 1 -#define ASN1_NGAP_NR_ID_AMF_OVERLOAD_RESP 2 -#define ASN1_NGAP_NR_ID_AMF_SET_ID 3 -#define ASN1_NGAP_NR_ID_AMF_TNLASSOC_FAILED_TO_SETUP_LIST 4 -#define ASN1_NGAP_NR_ID_AMF_TNLASSOC_SETUP_LIST 5 -#define ASN1_NGAP_NR_ID_AMF_TNLASSOC_TO_ADD_LIST 6 -#define ASN1_NGAP_NR_ID_AMF_TNLASSOC_TO_REM_LIST 7 -#define ASN1_NGAP_NR_ID_AMF_TNLASSOC_TO_UPD_LIST 8 -#define ASN1_NGAP_NR_ID_AMF_TRAFFIC_LOAD_REDUCTION_IND 9 -#define ASN1_NGAP_NR_ID_AMF_UE_NGAP_ID 10 -#define ASN1_NGAP_NR_ID_ASSIST_DATA_FOR_PAGING 11 -#define ASN1_NGAP_NR_ID_BROADCAST_CANCELLED_AREA_LIST 12 -#define ASN1_NGAP_NR_ID_BROADCAST_COMPLETED_AREA_LIST 13 -#define ASN1_NGAP_NR_ID_CANCEL_ALL_WARNING_MSGS 14 -#define ASN1_NGAP_NR_ID_CAUSE 15 -#define ASN1_NGAP_NR_ID_CELL_ID_LIST_FOR_RESTART 16 -#define ASN1_NGAP_NR_ID_CONCURRENT_WARNING_MSG_IND 17 -#define ASN1_NGAP_NR_ID_CORE_NETWORK_ASSIST_INFO 18 -#define ASN1_NGAP_NR_ID_CRIT_DIAGNOSTICS 19 -#define ASN1_NGAP_NR_ID_DATA_CODING_SCHEME 20 -#define ASN1_NGAP_NR_ID_DEFAULT_PAGING_DRX 21 -#define ASN1_NGAP_NR_ID_DIRECT_FORWARDING_PATH_AVAILABILITY 22 -#define ASN1_NGAP_NR_ID_EMERGENCY_AREA_ID_LIST_FOR_RESTART 23 -#define ASN1_NGAP_NR_ID_EMERGENCY_FALLBACK_IND 24 -#define ASN1_NGAP_NR_ID_EUTRA_CGI 25 -#define ASN1_NGAP_NR_ID_FIVE_G_S_TMSI 26 -#define ASN1_NGAP_NR_ID_GLOBAL_RAN_NODE_ID 27 -#define ASN1_NGAP_NR_ID_GUAMI 28 -#define ASN1_NGAP_NR_ID_HANDOV_TYPE 29 -#define ASN1_NGAP_NR_ID_IMS_VOICE_SUPPORT_IND 30 -#define ASN1_NGAP_NR_ID_IDX_TO_RFSP 31 -#define ASN1_NGAP_NR_ID_INFO_ON_RECOMMENDED_CELLS_AND_RAN_NODES_FOR_PAGING 32 -#define ASN1_NGAP_NR_ID_LOCATION_REPORT_REQUEST_TYPE 33 -#define ASN1_NGAP_NR_ID_MASKED_IMEISV 34 -#define ASN1_NGAP_NR_ID_MSG_ID 35 -#define ASN1_NGAP_NR_ID_MOB_RESTRICT_LIST 36 -#define ASN1_NGAP_NR_ID_NASC 37 -#define ASN1_NGAP_NR_ID_NAS_PDU 38 -#define ASN1_NGAP_NR_ID_NAS_SECURITY_PARAMS_FROM_NGRAN 39 -#define ASN1_NGAP_NR_ID_NEW_AMF_UE_NGAP_ID 40 -#define ASN1_NGAP_NR_ID_NEW_SECURITY_CONTEXT_IND 41 -#define ASN1_NGAP_NR_ID_NGAP_MSG 42 -#define ASN1_NGAP_NR_ID_NGRAN_CGI 43 -#define ASN1_NGAP_NR_ID_NGRAN_TRACE_ID 44 -#define ASN1_NGAP_NR_ID_NR_CGI 45 -#define ASN1_NGAP_NR_ID_NRP_PA_PDU 46 -#define ASN1_NGAP_NR_ID_NOF_BROADCASTS_REQUESTED 47 -#define ASN1_NGAP_NR_ID_OLD_AMF 48 -#define ASN1_NGAP_NR_ID_OVERLOAD_START_NSSAI_LIST 49 -#define ASN1_NGAP_NR_ID_PAGING_DRX 50 -#define ASN1_NGAP_NR_ID_PAGING_ORIGIN 51 -#define ASN1_NGAP_NR_ID_PAGING_PRIO 52 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_ADMITTED_LIST 53 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_FAILED_TO_MODIFY_LIST_MOD_RES 54 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_FAILED_TO_SETUP_LIST_CXT_RES 55 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_FAILED_TO_SETUP_LIST_HO_ACK 56 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_FAILED_TO_SETUP_LIST_PS_REQ 57 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_FAILED_TO_SETUP_LIST_SU_RES 58 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_HO_LIST 59 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_LIST_CXT_REL_CPL 60 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_LIST_HO_RQD 61 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_MODIFY_LIST_MOD_CFM 62 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_MODIFY_LIST_MOD_IND 63 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_MODIFY_LIST_MOD_REQ 64 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_MODIFY_LIST_MOD_RES 65 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_NOTIFY_LIST 66 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_RELEASED_LIST_NOT 67 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_RELEASED_LIST_PS_ACK 68 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_RELEASED_LIST_PS_FAIL 69 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_RELEASED_LIST_REL_RES 70 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_SETUP_LIST_CXT_REQ 71 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_SETUP_LIST_CXT_RES 72 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_SETUP_LIST_HO_REQ 73 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_SETUP_LIST_SU_REQ 74 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_SETUP_LIST_SU_RES 75 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_TO_BE_SWITCHED_DL_LIST 76 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_SWITCHED_LIST 77 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_TO_RELEASE_LIST_HO_CMD 78 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_TO_RELEASE_LIST_REL_CMD 79 -#define ASN1_NGAP_NR_ID_PLMN_SUPPORT_LIST 80 -#define ASN1_NGAP_NR_ID_PWS_FAILED_CELL_ID_LIST 81 -#define ASN1_NGAP_NR_ID_RAN_NODE_NAME 82 -#define ASN1_NGAP_NR_ID_RAN_PAGING_PRIO 83 -#define ASN1_NGAP_NR_ID_RAN_STATUS_TRANSFER_TRANSPARENT_CONTAINER 84 -#define ASN1_NGAP_NR_ID_RAN_UE_NGAP_ID 85 -#define ASN1_NGAP_NR_ID_RELATIVE_AMF_CAPACITY 86 -#define ASN1_NGAP_NR_ID_REPEAT_PERIOD 87 -#define ASN1_NGAP_NR_ID_RESET_TYPE 88 -#define ASN1_NGAP_NR_ID_ROUTING_ID 89 -#define ASN1_NGAP_NR_ID_RRCESTABLISHMENT_CAUSE 90 -#define ASN1_NGAP_NR_ID_RRC_INACTIVE_TRANSITION_REPORT_REQUEST 91 -#define ASN1_NGAP_NR_ID_RRC_STATE 92 -#define ASN1_NGAP_NR_ID_SECURITY_CONTEXT 93 -#define ASN1_NGAP_NR_ID_SECURITY_KEY 94 -#define ASN1_NGAP_NR_ID_SERIAL_NUM 95 -#define ASN1_NGAP_NR_ID_SERVED_GUAMI_LIST 96 -#define ASN1_NGAP_NR_ID_SLICE_SUPPORT_LIST 97 -#define ASN1_NGAP_NR_ID_SON_CFG_TRANSFER_DL 98 -#define ASN1_NGAP_NR_ID_SON_CFG_TRANSFER_UL 99 -#define ASN1_NGAP_NR_ID_SOURCE_AMF_UE_NGAP_ID 100 -#define ASN1_NGAP_NR_ID_SOURCE_TO_TARGET_TRANSPARENT_CONTAINER 101 -#define ASN1_NGAP_NR_ID_SUPPORTED_TA_LIST 102 -#define ASN1_NGAP_NR_ID_TAI_LIST_FOR_PAGING 103 -#define ASN1_NGAP_NR_ID_TAI_LIST_FOR_RESTART 104 -#define ASN1_NGAP_NR_ID_TARGET_ID 105 -#define ASN1_NGAP_NR_ID_TARGET_TO_SOURCE_TRANSPARENT_CONTAINER 106 -#define ASN1_NGAP_NR_ID_TIME_TO_WAIT 107 -#define ASN1_NGAP_NR_ID_TRACE_ACTIVATION 108 -#define ASN1_NGAP_NR_ID_TRACE_COLLECTION_ENTITY_IP_ADDRESS 109 -#define ASN1_NGAP_NR_ID_UE_AGGREGATE_MAXIMUM_BIT_RATE 110 -#define ASN1_NGAP_NR_ID_UE_ASSOCIATED_LC_NG_CONN_LIST 111 -#define ASN1_NGAP_NR_ID_UE_CONTEXT_REQUEST 112 -#define ASN1_NGAP_NR_ID_UE_NGAP_IDS 114 -#define ASN1_NGAP_NR_ID_UE_PAGING_ID 115 -#define ASN1_NGAP_NR_ID_UE_PRESENCE_IN_AREA_OF_INTEREST_LIST 116 -#define ASN1_NGAP_NR_ID_UE_RADIO_CAP 117 -#define ASN1_NGAP_NR_ID_UE_RADIO_CAP_FOR_PAGING 118 -#define ASN1_NGAP_NR_ID_UE_SECURITY_CAP 119 -#define ASN1_NGAP_NR_ID_UNAVAILABLE_GUAMI_LIST 120 -#define ASN1_NGAP_NR_ID_USER_LOCATION_INFO 121 -#define ASN1_NGAP_NR_ID_WARNING_AREA_LIST 122 -#define ASN1_NGAP_NR_ID_WARNING_MSG_CONTENTS 123 -#define ASN1_NGAP_NR_ID_WARNING_SECURITY_INFO 124 -#define ASN1_NGAP_NR_ID_WARNING_TYPE 125 -#define ASN1_NGAP_NR_ID_ADD_UL_NGU_UP_TNL_INFO 126 -#define ASN1_NGAP_NR_ID_DATA_FORWARDING_NOT_POSSIBLE 127 -#define ASN1_NGAP_NR_ID_DL_NGU_UP_TNL_INFO 128 -#define ASN1_NGAP_NR_ID_NETWORK_INSTANCE 129 -#define ASN1_NGAP_NR_ID_PDU_SESSION_AGGREGATE_MAXIMUM_BIT_RATE 130 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_FAILED_TO_MODIFY_LIST_MOD_CFM 131 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_FAILED_TO_SETUP_LIST_CXT_FAIL 132 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_LIST_CXT_REL_REQ 133 -#define ASN1_NGAP_NR_ID_PDU_SESSION_TYPE 134 -#define ASN1_NGAP_NR_ID_QOS_FLOW_ADD_OR_MODIFY_REQUEST_LIST 135 -#define ASN1_NGAP_NR_ID_QOS_FLOW_SETUP_REQUEST_LIST 136 -#define ASN1_NGAP_NR_ID_QOS_FLOW_TO_RELEASE_LIST 137 -#define ASN1_NGAP_NR_ID_SECURITY_IND 138 -#define ASN1_NGAP_NR_ID_UL_NGU_UP_TNL_INFO 139 -#define ASN1_NGAP_NR_ID_UL_NGU_UP_TNL_MODIFY_LIST 140 -#define ASN1_NGAP_NR_ID_WARNING_AREA_COORDINATES 141 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_SECONDARY_RATUSAGE_LIST 142 -#define ASN1_NGAP_NR_ID_HO_FLAG 143 -#define ASN1_NGAP_NR_ID_SECONDARY_RATUSAGE_INFO 144 -#define ASN1_NGAP_NR_ID_PDU_SESSION_RES_RELEASE_RESP_TRANSFER 145 -#define ASN1_NGAP_NR_ID_REDIRECTION_VOICE_FALLBACK 146 -#define ASN1_NGAP_NR_ID_UE_RETENTION_INFO 147 -#define ASN1_NGAP_NR_ID_S_NSSAI 148 -#define ASN1_NGAP_NR_ID_PS_CELL_INFO 149 -#define ASN1_NGAP_NR_ID_LAST_EUTRAN_PLMN_ID 150 -#define ASN1_NGAP_NR_ID_MAXIMUM_INTEGRITY_PROTECTED_DATA_RATE_DL 151 -#define ASN1_NGAP_NR_ID_ADD_DL_FORWARDING_UPTNL_INFO 152 -#define ASN1_NGAP_NR_ID_ADD_DLUPTNL_INFO_FOR_HO_LIST 153 -#define ASN1_NGAP_NR_ID_ADD_NGU_UP_TNL_INFO 154 -#define ASN1_NGAP_NR_ID_ADD_DL_QOS_FLOW_PER_TNL_INFO 155 -#define ASN1_NGAP_NR_ID_SECURITY_RESULT 156 -#define ASN1_NGAP_NR_ID_ENDC_SON_CFG_TRANSFER_DL 157 -#define ASN1_NGAP_NR_ID_ENDC_SON_CFG_TRANSFER_UL 158 +#define ASN1_NGAP_ID_AMF_CFG_UPD 0 +#define ASN1_NGAP_ID_AMF_STATUS_IND 1 +#define ASN1_NGAP_ID_CELL_TRAFFIC_TRACE 2 +#define ASN1_NGAP_ID_DEACTIV_TRACE 3 +#define ASN1_NGAP_ID_DL_NAS_TRANSPORT 4 +#define ASN1_NGAP_ID_DL_NON_UEASSOCIATED_NRP_PA_TRANSPORT 5 +#define ASN1_NGAP_ID_DL_RAN_CFG_TRANSFER 6 +#define ASN1_NGAP_ID_DL_RAN_STATUS_TRANSFER 7 +#define ASN1_NGAP_ID_DL_UEASSOCIATED_NRP_PA_TRANSPORT 8 +#define ASN1_NGAP_ID_ERROR_IND 9 +#define ASN1_NGAP_ID_HO_CANCEL 10 +#define ASN1_NGAP_ID_HO_NOTIF 11 +#define ASN1_NGAP_ID_HO_PREP 12 +#define ASN1_NGAP_ID_HO_RES_ALLOC 13 +#define ASN1_NGAP_ID_INIT_CONTEXT_SETUP 14 +#define ASN1_NGAP_ID_INIT_UE_MSG 15 +#define ASN1_NGAP_ID_LOCATION_REPORT_CTRL 16 +#define ASN1_NGAP_ID_LOCATION_REPORT_FAIL_IND 17 +#define ASN1_NGAP_ID_LOCATION_REPORT 18 +#define ASN1_NGAP_ID_NAS_NON_DELIVERY_IND 19 +#define ASN1_NGAP_ID_NG_RESET 20 +#define ASN1_NGAP_ID_NG_SETUP 21 +#define ASN1_NGAP_ID_OVERLOAD_START 22 +#define ASN1_NGAP_ID_OVERLOAD_STOP 23 +#define ASN1_NGAP_ID_PAGING 24 +#define ASN1_NGAP_ID_PATH_SWITCH_REQUEST 25 +#define ASN1_NGAP_ID_PDU_SESSION_RES_MODIFY 26 +#define ASN1_NGAP_ID_PDU_SESSION_RES_MODIFY_IND 27 +#define ASN1_NGAP_ID_PDU_SESSION_RES_RELEASE 28 +#define ASN1_NGAP_ID_PDU_SESSION_RES_SETUP 29 +#define ASN1_NGAP_ID_PDU_SESSION_RES_NOTIFY 30 +#define ASN1_NGAP_ID_PRIVATE_MSG 31 +#define ASN1_NGAP_ID_PWS_CANCEL 32 +#define ASN1_NGAP_ID_PWS_FAIL_IND 33 +#define ASN1_NGAP_ID_PWS_RESTART_IND 34 +#define ASN1_NGAP_ID_RAN_CFG_UPD 35 +#define ASN1_NGAP_ID_REROUTE_NAS_REQUEST 36 +#define ASN1_NGAP_ID_RRC_INACTIVE_TRANSITION_REPORT 37 +#define ASN1_NGAP_ID_TRACE_FAIL_IND 38 +#define ASN1_NGAP_ID_TRACE_START 39 +#define ASN1_NGAP_ID_UE_CONTEXT_MOD 40 +#define ASN1_NGAP_ID_UE_CONTEXT_RELEASE 41 +#define ASN1_NGAP_ID_UE_CONTEXT_RELEASE_REQUEST 42 +#define ASN1_NGAP_ID_UE_RADIO_CAP_CHECK 43 +#define ASN1_NGAP_ID_UE_RADIO_CAP_INFO_IND 44 +#define ASN1_NGAP_ID_UETNLA_BINDING_RELEASE 45 +#define ASN1_NGAP_ID_UL_NAS_TRANSPORT 46 +#define ASN1_NGAP_ID_UL_NON_UEASSOCIATED_NRP_PA_TRANSPORT 47 +#define ASN1_NGAP_ID_UL_RAN_CFG_TRANSFER 48 +#define ASN1_NGAP_ID_UL_RAN_STATUS_TRANSFER 49 +#define ASN1_NGAP_ID_UL_UEASSOCIATED_NRP_PA_TRANSPORT 50 +#define ASN1_NGAP_ID_WRITE_REPLACE_WARNING 51 +#define ASN1_NGAP_ID_SECONDARY_RAT_DATA_USAGE_REPORT 52 +#define ASN1_NGAP_MAX_PRIVATE_IES 65535 +#define ASN1_NGAP_MAX_PROTOCOL_EXTS 65535 +#define ASN1_NGAP_MAX_PROTOCOL_IES 65535 +#define ASN1_NGAP_MAXNOOF_ALLOWED_AREAS 16 +#define ASN1_NGAP_MAXNOOF_ALLOWED_S_NSSAIS 8 +#define ASN1_NGAP_MAXNOOF_BPLMNS 12 +#define ASN1_NGAP_MAXNOOF_CELL_IDFOR_WARNING 65535 +#define ASN1_NGAP_MAXNOOF_CELLIN_AO_I 256 +#define ASN1_NGAP_MAXNOOF_CELLIN_EAI 65535 +#define ASN1_NGAP_MAXNOOF_CELLIN_TAI 65535 +#define ASN1_NGAP_MAXNOOF_CELLSING_NB 16384 +#define ASN1_NGAP_MAXNOOF_CELLSINNGENB 256 +#define ASN1_NGAP_MAXNOOF_CELLSIN_UE_HISTORY_INFO 16 +#define ASN1_NGAP_MAXNOOF_CELLS_UE_MOVING_TRAJECTORY 16 +#define ASN1_NGAP_MAXNOOF_DRBS 32 +#define ASN1_NGAP_MAXNOOF_EMERGENCY_AREA_ID 65535 +#define ASN1_NGAP_MAXNOOF_EA_IFOR_RESTART 256 +#define ASN1_NGAP_MAXNOOF_EPLMNS 15 +#define ASN1_NGAP_MAXNOOF_EPLMNS_PLUS_ONE 16 +#define ASN1_NGAP_MAXNOOF_ERABS 256 +#define ASN1_NGAP_MAXNOOF_ERRORS 256 +#define ASN1_NGAP_MAXNOOF_FORB_TACS 4096 +#define ASN1_NGAP_MAXNOOF_MULTI_CONNECT 4 +#define ASN1_NGAP_MAXNOOF_MULTI_CONNECT_MINUS_ONE 3 +#define ASN1_NGAP_MAXNOOF_NG_CONNS_TO_RESET 65536 +#define ASN1_NGAP_MAXNOOF_PDU_SESSIONS 256 +#define ASN1_NGAP_MAXNOOF_PLMNS 12 +#define ASN1_NGAP_MAXNOOF_QOS_FLOWS 64 +#define ASN1_NGAP_MAXNOOF_RAN_NODEIN_AO_I 64 +#define ASN1_NGAP_MAXNOOF_RECOMMENDED_CELLS 16 +#define ASN1_NGAP_MAXNOOF_RECOMMENDED_RAN_NODES 16 +#define ASN1_NGAP_MAXNOOF_AO_I 64 +#define ASN1_NGAP_MAXNOOF_SERVED_GUAMIS 256 +#define ASN1_NGAP_MAXNOOF_SLICE_ITEMS 1024 +#define ASN1_NGAP_MAXNOOF_TACS 256 +#define ASN1_NGAP_MAXNOOF_TA_IFOR_INACTIVE 16 +#define ASN1_NGAP_MAXNOOF_TA_IFOR_PAGING 16 +#define ASN1_NGAP_MAXNOOF_TA_IFOR_RESTART 2048 +#define ASN1_NGAP_MAXNOOF_TA_IFOR_WARNING 65535 +#define ASN1_NGAP_MAXNOOF_TA_IIN_AO_I 16 +#define ASN1_NGAP_MAXNOOF_TIME_PERIODS 2 +#define ASN1_NGAP_MAXNOOF_TNLASSOCS 32 +#define ASN1_NGAP_MAXNOOF_XN_EXT_TLAS 2 +#define ASN1_NGAP_MAXNOOF_XN_GTP_TLAS 16 +#define ASN1_NGAP_MAXNOOF_XN_TLAS 16 +#define ASN1_NGAP_ID_ALLOWED_NSSAI 0 +#define ASN1_NGAP_ID_AMF_NAME 1 +#define ASN1_NGAP_ID_AMF_OVERLOAD_RESP 2 +#define ASN1_NGAP_ID_AMF_SET_ID 3 +#define ASN1_NGAP_ID_AMF_TNLASSOC_FAILED_TO_SETUP_LIST 4 +#define ASN1_NGAP_ID_AMF_TNLASSOC_SETUP_LIST 5 +#define ASN1_NGAP_ID_AMF_TNLASSOC_TO_ADD_LIST 6 +#define ASN1_NGAP_ID_AMF_TNLASSOC_TO_REM_LIST 7 +#define ASN1_NGAP_ID_AMF_TNLASSOC_TO_UPD_LIST 8 +#define ASN1_NGAP_ID_AMF_TRAFFIC_LOAD_REDUCTION_IND 9 +#define ASN1_NGAP_ID_AMF_UE_NGAP_ID 10 +#define ASN1_NGAP_ID_ASSIST_DATA_FOR_PAGING 11 +#define ASN1_NGAP_ID_BROADCAST_CANCELLED_AREA_LIST 12 +#define ASN1_NGAP_ID_BROADCAST_COMPLETED_AREA_LIST 13 +#define ASN1_NGAP_ID_CANCEL_ALL_WARNING_MSGS 14 +#define ASN1_NGAP_ID_CAUSE 15 +#define ASN1_NGAP_ID_CELL_ID_LIST_FOR_RESTART 16 +#define ASN1_NGAP_ID_CONCURRENT_WARNING_MSG_IND 17 +#define ASN1_NGAP_ID_CORE_NETWORK_ASSIST_INFO 18 +#define ASN1_NGAP_ID_CRIT_DIAGNOSTICS 19 +#define ASN1_NGAP_ID_DATA_CODING_SCHEME 20 +#define ASN1_NGAP_ID_DEFAULT_PAGING_DRX 21 +#define ASN1_NGAP_ID_DIRECT_FORWARDING_PATH_AVAILABILITY 22 +#define ASN1_NGAP_ID_EMERGENCY_AREA_ID_LIST_FOR_RESTART 23 +#define ASN1_NGAP_ID_EMERGENCY_FALLBACK_IND 24 +#define ASN1_NGAP_ID_EUTRA_CGI 25 +#define ASN1_NGAP_ID_FIVE_G_S_TMSI 26 +#define ASN1_NGAP_ID_GLOBAL_RAN_NODE_ID 27 +#define ASN1_NGAP_ID_GUAMI 28 +#define ASN1_NGAP_ID_HANDOV_TYPE 29 +#define ASN1_NGAP_ID_IMS_VOICE_SUPPORT_IND 30 +#define ASN1_NGAP_ID_IDX_TO_RFSP 31 +#define ASN1_NGAP_ID_INFO_ON_RECOMMENDED_CELLS_AND_RAN_NODES_FOR_PAGING 32 +#define ASN1_NGAP_ID_LOCATION_REPORT_REQUEST_TYPE 33 +#define ASN1_NGAP_ID_MASKED_IMEISV 34 +#define ASN1_NGAP_ID_MSG_ID 35 +#define ASN1_NGAP_ID_MOB_RESTRICT_LIST 36 +#define ASN1_NGAP_ID_NASC 37 +#define ASN1_NGAP_ID_NAS_PDU 38 +#define ASN1_NGAP_ID_NAS_SECURITY_PARAMS_FROM_NGRAN 39 +#define ASN1_NGAP_ID_NEW_AMF_UE_NGAP_ID 40 +#define ASN1_NGAP_ID_NEW_SECURITY_CONTEXT_IND 41 +#define ASN1_NGAP_ID_NGAP_MSG 42 +#define ASN1_NGAP_ID_NGRAN_CGI 43 +#define ASN1_NGAP_ID_NGRAN_TRACE_ID 44 +#define ASN1_NGAP_ID_NR_CGI 45 +#define ASN1_NGAP_ID_NRP_PA_PDU 46 +#define ASN1_NGAP_ID_NOF_BROADCASTS_REQUESTED 47 +#define ASN1_NGAP_ID_OLD_AMF 48 +#define ASN1_NGAP_ID_OVERLOAD_START_NSSAI_LIST 49 +#define ASN1_NGAP_ID_PAGING_DRX 50 +#define ASN1_NGAP_ID_PAGING_ORIGIN 51 +#define ASN1_NGAP_ID_PAGING_PRIO 52 +#define ASN1_NGAP_ID_PDU_SESSION_RES_ADMITTED_LIST 53 +#define ASN1_NGAP_ID_PDU_SESSION_RES_FAILED_TO_MODIFY_LIST_MOD_RES 54 +#define ASN1_NGAP_ID_PDU_SESSION_RES_FAILED_TO_SETUP_LIST_CXT_RES 55 +#define ASN1_NGAP_ID_PDU_SESSION_RES_FAILED_TO_SETUP_LIST_HO_ACK 56 +#define ASN1_NGAP_ID_PDU_SESSION_RES_FAILED_TO_SETUP_LIST_PS_REQ 57 +#define ASN1_NGAP_ID_PDU_SESSION_RES_FAILED_TO_SETUP_LIST_SU_RES 58 +#define ASN1_NGAP_ID_PDU_SESSION_RES_HO_LIST 59 +#define ASN1_NGAP_ID_PDU_SESSION_RES_LIST_CXT_REL_CPL 60 +#define ASN1_NGAP_ID_PDU_SESSION_RES_LIST_HO_RQD 61 +#define ASN1_NGAP_ID_PDU_SESSION_RES_MODIFY_LIST_MOD_CFM 62 +#define ASN1_NGAP_ID_PDU_SESSION_RES_MODIFY_LIST_MOD_IND 63 +#define ASN1_NGAP_ID_PDU_SESSION_RES_MODIFY_LIST_MOD_REQ 64 +#define ASN1_NGAP_ID_PDU_SESSION_RES_MODIFY_LIST_MOD_RES 65 +#define ASN1_NGAP_ID_PDU_SESSION_RES_NOTIFY_LIST 66 +#define ASN1_NGAP_ID_PDU_SESSION_RES_RELEASED_LIST_NOT 67 +#define ASN1_NGAP_ID_PDU_SESSION_RES_RELEASED_LIST_PS_ACK 68 +#define ASN1_NGAP_ID_PDU_SESSION_RES_RELEASED_LIST_PS_FAIL 69 +#define ASN1_NGAP_ID_PDU_SESSION_RES_RELEASED_LIST_REL_RES 70 +#define ASN1_NGAP_ID_PDU_SESSION_RES_SETUP_LIST_CXT_REQ 71 +#define ASN1_NGAP_ID_PDU_SESSION_RES_SETUP_LIST_CXT_RES 72 +#define ASN1_NGAP_ID_PDU_SESSION_RES_SETUP_LIST_HO_REQ 73 +#define ASN1_NGAP_ID_PDU_SESSION_RES_SETUP_LIST_SU_REQ 74 +#define ASN1_NGAP_ID_PDU_SESSION_RES_SETUP_LIST_SU_RES 75 +#define ASN1_NGAP_ID_PDU_SESSION_RES_TO_BE_SWITCHED_DL_LIST 76 +#define ASN1_NGAP_ID_PDU_SESSION_RES_SWITCHED_LIST 77 +#define ASN1_NGAP_ID_PDU_SESSION_RES_TO_RELEASE_LIST_HO_CMD 78 +#define ASN1_NGAP_ID_PDU_SESSION_RES_TO_RELEASE_LIST_REL_CMD 79 +#define ASN1_NGAP_ID_PLMN_SUPPORT_LIST 80 +#define ASN1_NGAP_ID_PWS_FAILED_CELL_ID_LIST 81 +#define ASN1_NGAP_ID_RAN_NODE_NAME 82 +#define ASN1_NGAP_ID_RAN_PAGING_PRIO 83 +#define ASN1_NGAP_ID_RAN_STATUS_TRANSFER_TRANSPARENT_CONTAINER 84 +#define ASN1_NGAP_ID_RAN_UE_NGAP_ID 85 +#define ASN1_NGAP_ID_RELATIVE_AMF_CAPACITY 86 +#define ASN1_NGAP_ID_REPEAT_PERIOD 87 +#define ASN1_NGAP_ID_RESET_TYPE 88 +#define ASN1_NGAP_ID_ROUTING_ID 89 +#define ASN1_NGAP_ID_RRCESTABLISHMENT_CAUSE 90 +#define ASN1_NGAP_ID_RRC_INACTIVE_TRANSITION_REPORT_REQUEST 91 +#define ASN1_NGAP_ID_RRC_STATE 92 +#define ASN1_NGAP_ID_SECURITY_CONTEXT 93 +#define ASN1_NGAP_ID_SECURITY_KEY 94 +#define ASN1_NGAP_ID_SERIAL_NUM 95 +#define ASN1_NGAP_ID_SERVED_GUAMI_LIST 96 +#define ASN1_NGAP_ID_SLICE_SUPPORT_LIST 97 +#define ASN1_NGAP_ID_SON_CFG_TRANSFER_DL 98 +#define ASN1_NGAP_ID_SON_CFG_TRANSFER_UL 99 +#define ASN1_NGAP_ID_SOURCE_AMF_UE_NGAP_ID 100 +#define ASN1_NGAP_ID_SOURCE_TO_TARGET_TRANSPARENT_CONTAINER 101 +#define ASN1_NGAP_ID_SUPPORTED_TA_LIST 102 +#define ASN1_NGAP_ID_TAI_LIST_FOR_PAGING 103 +#define ASN1_NGAP_ID_TAI_LIST_FOR_RESTART 104 +#define ASN1_NGAP_ID_TARGET_ID 105 +#define ASN1_NGAP_ID_TARGET_TO_SOURCE_TRANSPARENT_CONTAINER 106 +#define ASN1_NGAP_ID_TIME_TO_WAIT 107 +#define ASN1_NGAP_ID_TRACE_ACTIVATION 108 +#define ASN1_NGAP_ID_TRACE_COLLECTION_ENTITY_IP_ADDRESS 109 +#define ASN1_NGAP_ID_UE_AGGREGATE_MAXIMUM_BIT_RATE 110 +#define ASN1_NGAP_ID_UE_ASSOCIATED_LC_NG_CONN_LIST 111 +#define ASN1_NGAP_ID_UE_CONTEXT_REQUEST 112 +#define ASN1_NGAP_ID_UE_NGAP_IDS 114 +#define ASN1_NGAP_ID_UE_PAGING_ID 115 +#define ASN1_NGAP_ID_UE_PRESENCE_IN_AREA_OF_INTEREST_LIST 116 +#define ASN1_NGAP_ID_UE_RADIO_CAP 117 +#define ASN1_NGAP_ID_UE_RADIO_CAP_FOR_PAGING 118 +#define ASN1_NGAP_ID_UE_SECURITY_CAP 119 +#define ASN1_NGAP_ID_UNAVAILABLE_GUAMI_LIST 120 +#define ASN1_NGAP_ID_USER_LOCATION_INFO 121 +#define ASN1_NGAP_ID_WARNING_AREA_LIST 122 +#define ASN1_NGAP_ID_WARNING_MSG_CONTENTS 123 +#define ASN1_NGAP_ID_WARNING_SECURITY_INFO 124 +#define ASN1_NGAP_ID_WARNING_TYPE 125 +#define ASN1_NGAP_ID_ADD_UL_NGU_UP_TNL_INFO 126 +#define ASN1_NGAP_ID_DATA_FORWARDING_NOT_POSSIBLE 127 +#define ASN1_NGAP_ID_DL_NGU_UP_TNL_INFO 128 +#define ASN1_NGAP_ID_NETWORK_INSTANCE 129 +#define ASN1_NGAP_ID_PDU_SESSION_AGGREGATE_MAXIMUM_BIT_RATE 130 +#define ASN1_NGAP_ID_PDU_SESSION_RES_FAILED_TO_MODIFY_LIST_MOD_CFM 131 +#define ASN1_NGAP_ID_PDU_SESSION_RES_FAILED_TO_SETUP_LIST_CXT_FAIL 132 +#define ASN1_NGAP_ID_PDU_SESSION_RES_LIST_CXT_REL_REQ 133 +#define ASN1_NGAP_ID_PDU_SESSION_TYPE 134 +#define ASN1_NGAP_ID_QOS_FLOW_ADD_OR_MODIFY_REQUEST_LIST 135 +#define ASN1_NGAP_ID_QOS_FLOW_SETUP_REQUEST_LIST 136 +#define ASN1_NGAP_ID_QOS_FLOW_TO_RELEASE_LIST 137 +#define ASN1_NGAP_ID_SECURITY_IND 138 +#define ASN1_NGAP_ID_UL_NGU_UP_TNL_INFO 139 +#define ASN1_NGAP_ID_UL_NGU_UP_TNL_MODIFY_LIST 140 +#define ASN1_NGAP_ID_WARNING_AREA_COORDINATES 141 +#define ASN1_NGAP_ID_PDU_SESSION_RES_SECONDARY_RATUSAGE_LIST 142 +#define ASN1_NGAP_ID_HO_FLAG 143 +#define ASN1_NGAP_ID_SECONDARY_RATUSAGE_INFO 144 +#define ASN1_NGAP_ID_PDU_SESSION_RES_RELEASE_RESP_TRANSFER 145 +#define ASN1_NGAP_ID_REDIRECTION_VOICE_FALLBACK 146 +#define ASN1_NGAP_ID_UE_RETENTION_INFO 147 +#define ASN1_NGAP_ID_S_NSSAI 148 +#define ASN1_NGAP_ID_PS_CELL_INFO 149 +#define ASN1_NGAP_ID_LAST_EUTRAN_PLMN_ID 150 +#define ASN1_NGAP_ID_MAXIMUM_INTEGRITY_PROTECTED_DATA_RATE_DL 151 +#define ASN1_NGAP_ID_ADD_DL_FORWARDING_UPTNL_INFO 152 +#define ASN1_NGAP_ID_ADD_DLUPTNL_INFO_FOR_HO_LIST 153 +#define ASN1_NGAP_ID_ADD_NGU_UP_TNL_INFO 154 +#define ASN1_NGAP_ID_ADD_DL_QOS_FLOW_PER_TNL_INFO 155 +#define ASN1_NGAP_ID_SECURITY_RESULT 156 +#define ASN1_NGAP_ID_ENDC_SON_CFG_TRANSFER_DL 157 +#define ASN1_NGAP_ID_ENDC_SON_CFG_TRANSFER_UL 158 /******************************************************************************* * Struct Definitions @@ -14993,7 +14993,7 @@ struct target_ngran_node_to_source_ngran_node_transparent_container_s { void to_json(json_writer& j) const; }; -} // namespace ngap_nr +} // namespace ngap } // namespace asn1 -#endif // SRSASN1_NGAP_NR_H +#endif // SRSASN1_NGAP_H diff --git a/lib/include/srsran/asn1/ngap_utils.h b/lib/include/srsran/asn1/ngap_utils.h index 59d16c487..537252e63 100644 --- a/lib/include/srsran/asn1/ngap_utils.h +++ b/lib/include/srsran/asn1/ngap_utils.h @@ -20,7 +20,7 @@ ***********************/ namespace asn1 { -namespace ngap_nr { +namespace ngap { struct rrcestablishment_cause_opts; struct cause_radio_network_opts; using rrcestablishment_cause_e = enumerated; diff --git a/lib/include/srsran/interfaces/gnb_ngap_interfaces.h b/lib/include/srsran/interfaces/gnb_ngap_interfaces.h index eaec4236d..2ee862b1a 100644 --- a/lib/include/srsran/interfaces/gnb_ngap_interfaces.h +++ b/lib/include/srsran/interfaces/gnb_ngap_interfaces.h @@ -34,22 +34,22 @@ struct ngap_args_t { class ngap_interface_rrc_nr { public: - virtual void initial_ue(uint16_t rnti, - uint32_t gnb_cc_idx, - asn1::ngap_nr::rrcestablishment_cause_e cause, - srsran::const_byte_span pdu) = 0; - virtual void initial_ue(uint16_t rnti, - uint32_t gnb_cc_idx, - asn1::ngap_nr::rrcestablishment_cause_e cause, - srsran::const_byte_span pdu, - uint32_t m_tmsi) = 0; - - virtual void write_pdu(uint16_t rnti, srsran::const_byte_span pdu) = 0; - virtual bool user_exists(uint16_t rnti) = 0; - virtual void user_mod(uint16_t old_rnti, uint16_t new_rnti) = 0; - virtual void user_release_request(uint16_t rnti, asn1::ngap_nr::cause_radio_network_e cause_radio) = 0; - virtual bool is_amf_connected() = 0; - virtual void ue_notify_rrc_reconf_complete(uint16_t rnti, bool outcome) = 0; + virtual void initial_ue(uint16_t rnti, + uint32_t gnb_cc_idx, + asn1::ngap::rrcestablishment_cause_e cause, + srsran::const_byte_span pdu) = 0; + virtual void initial_ue(uint16_t rnti, + uint32_t gnb_cc_idx, + asn1::ngap::rrcestablishment_cause_e cause, + srsran::const_byte_span pdu, + uint32_t m_tmsi) = 0; + + virtual void write_pdu(uint16_t rnti, srsran::const_byte_span pdu) = 0; + virtual bool user_exists(uint16_t rnti) = 0; + virtual void user_mod(uint16_t old_rnti, uint16_t new_rnti) = 0; + virtual void user_release_request(uint16_t rnti, asn1::ngap::cause_radio_network_e cause_radio) = 0; + virtual bool is_amf_connected() = 0; + virtual void ue_notify_rrc_reconf_complete(uint16_t rnti, bool outcome) = 0; }; } // namespace srsenb diff --git a/lib/include/srsran/interfaces/gnb_rrc_nr_interfaces.h b/lib/include/srsran/interfaces/gnb_rrc_nr_interfaces.h index 54b25b538..f695cc21f 100644 --- a/lib/include/srsran/interfaces/gnb_rrc_nr_interfaces.h +++ b/lib/include/srsran/interfaces/gnb_rrc_nr_interfaces.h @@ -20,11 +20,11 @@ namespace srsenb { class rrc_interface_ngap_nr { public: - virtual int ue_set_security_cfg_key(uint16_t rnti, const asn1::fixed_bitstring<256, false, true>& key) = 0; - virtual int ue_set_bitrates(uint16_t rnti, const asn1::ngap_nr::ue_aggregate_maximum_bit_rate_s& rates) = 0; - virtual int set_aggregate_max_bitrate(uint16_t rnti, const asn1::ngap_nr::ue_aggregate_maximum_bit_rate_s& rates) = 0; - virtual int ue_set_security_cfg_capabilities(uint16_t rnti, const asn1::ngap_nr::ue_security_cap_s& caps) = 0; - virtual int start_security_mode_procedure(uint16_t rnti, srsran::unique_byte_buffer_t nas_pdu) = 0; + virtual int ue_set_security_cfg_key(uint16_t rnti, const asn1::fixed_bitstring<256, false, true>& key) = 0; + virtual int ue_set_bitrates(uint16_t rnti, const asn1::ngap::ue_aggregate_maximum_bit_rate_s& rates) = 0; + virtual int set_aggregate_max_bitrate(uint16_t rnti, const asn1::ngap::ue_aggregate_maximum_bit_rate_s& rates) = 0; + virtual int ue_set_security_cfg_capabilities(uint16_t rnti, const asn1::ngap::ue_security_cap_s& caps) = 0; + virtual int start_security_mode_procedure(uint16_t rnti, srsran::unique_byte_buffer_t nas_pdu) = 0; virtual int establish_rrc_bearer(uint16_t rnti, uint16_t pdu_session_id, srsran::const_byte_span nas_pdu, uint32_t lcid) = 0; virtual int allocate_lcid(uint16_t rnti) = 0; diff --git a/lib/src/asn1/asn1_utils.cc b/lib/src/asn1/asn1_utils.cc index 3686b9dd2..4d56e641a 100644 --- a/lib/src/asn1/asn1_utils.cc +++ b/lib/src/asn1/asn1_utils.cc @@ -196,35 +196,35 @@ SRSASN_CODE unpack_bits(T& val, Ptr& ptr, uint8_t& offset, const uint8_t* max_pt } template SRSASN_CODE -unpack_bits(bool& val, uint8_t*& ptr, uint8_t& offset, const uint8_t* max_ptr, uint32_t n_bits); + unpack_bits(bool& val, uint8_t*& ptr, uint8_t& offset, const uint8_t* max_ptr, uint32_t n_bits); template SRSASN_CODE unpack_bits(bool& val, const uint8_t*& ptr, uint8_t& offset, const uint8_t* max_ptr, uint32_t n_bits); template SRSASN_CODE -unpack_bits(uint8_t& val, uint8_t*& ptr, uint8_t& offset, const uint8_t* max_ptr, uint32_t n_bits); + unpack_bits(uint8_t& val, uint8_t*& ptr, uint8_t& offset, const uint8_t* max_ptr, uint32_t n_bits); template SRSASN_CODE unpack_bits(uint8_t& val, const uint8_t*& ptr, uint8_t& offset, const uint8_t* max_ptr, uint32_t n_bits); template SRSASN_CODE -unpack_bits(uint16_t& val, uint8_t*& ptr, uint8_t& offset, const uint8_t* max_ptr, uint32_t n_bits); + unpack_bits(uint16_t& val, uint8_t*& ptr, uint8_t& offset, const uint8_t* max_ptr, uint32_t n_bits); template SRSASN_CODE unpack_bits(uint16_t& val, const uint8_t*& ptr, uint8_t& offset, const uint8_t* max_ptr, uint32_t n_bits); template SRSASN_CODE -unpack_bits(uint32_t& val, uint8_t*& ptr, uint8_t& offset, const uint8_t* max_ptr, uint32_t n_bits); + unpack_bits(uint32_t& val, uint8_t*& ptr, uint8_t& offset, const uint8_t* max_ptr, uint32_t n_bits); template SRSASN_CODE unpack_bits(uint32_t& val, const uint8_t*& ptr, uint8_t& offset, const uint8_t* max_ptr, uint32_t n_bits); template SRSASN_CODE -unpack_bits(uint64_t& val, uint8_t*& ptr, uint8_t& offset, const uint8_t* max_ptr, uint32_t n_bits); + unpack_bits(uint64_t& val, uint8_t*& ptr, uint8_t& offset, const uint8_t* max_ptr, uint32_t n_bits); template SRSASN_CODE unpack_bits(uint64_t& val, const uint8_t*& ptr, uint8_t& offset, @@ -840,7 +840,7 @@ pack_integer(bit_ref& bref, uint16_t n, uint16_t lb, uint16_t ub, bool template SRSASN_CODE pack_integer(bit_ref& bref, uint32_t n, uint32_t lb, uint32_t ub, bool has_ext, bool aligned); template SRSASN_CODE -pack_integer(bit_ref& bref, uint64_t n, uint64_t lb, uint64_t ub, bool has_ext, bool aligned); + pack_integer(bit_ref& bref, uint64_t n, uint64_t lb, uint64_t ub, bool has_ext, bool aligned); template SRSASN_CODE pack_integer(bit_ref& bref, int8_t n, int8_t lb, int8_t ub, bool has_ext, bool aligned); template SRSASN_CODE pack_integer(bit_ref& bref, int16_t n, int16_t lb, int16_t ub, bool has_ext, bool aligned); diff --git a/lib/src/asn1/ngap.cc b/lib/src/asn1/ngap.cc index f975d4f4e..0ba963df2 100644 --- a/lib/src/asn1/ngap.cc +++ b/lib/src/asn1/ngap.cc @@ -14,7 +14,7 @@ #include using namespace asn1; -using namespace asn1::ngap_nr; +using namespace asn1::ngap; /******************************************************************************* * Struct Methods @@ -1305,7 +1305,7 @@ void protocol_ie_container_item_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; amf_cfg_upd_ies_container::amf_cfg_upd_ies_container() : amf_name(1, crit_e::reject), @@ -2207,7 +2207,7 @@ const char* amf_cfg_upd_ack_ies_o::value_c::types_opts::to_string() const return convert_enum_idx(options, 3, value, "amf_cfg_upd_ack_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; amf_cfg_upd_ack_ies_container::amf_cfg_upd_ack_ies_container() : amf_tnlassoc_setup_list(5, crit_e::ignore), @@ -2557,7 +2557,7 @@ const char* amf_cfg_upd_fail_ies_o::value_c::types_opts::to_string() const return convert_enum_idx(options, 3, value, "amf_cfg_upd_fail_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; amf_cfg_upd_fail_ies_container::amf_cfg_upd_fail_ies_container() : cause(15, crit_e::ignore), time_to_wait(107, crit_e::ignore), crit_diagnostics(19, crit_e::ignore) @@ -6936,7 +6936,7 @@ const char* cell_traffic_trace_ies_o::value_c::types_opts::to_string() const return convert_enum_idx(options, 5, value, "cell_traffic_trace_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; cell_traffic_trace_ies_container::cell_traffic_trace_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -8473,7 +8473,7 @@ const char* deactiv_trace_ies_o::value_c::types_opts::to_string() const return convert_enum_idx(options, 3, value, "deactiv_trace_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; deactiv_trace_ies_container::deactiv_trace_ies_container() : amf_ue_ngap_id(10, crit_e::reject), ran_ue_ngap_id(85, crit_e::reject), ngran_trace_id(44, crit_e::ignore) @@ -9373,7 +9373,7 @@ const char* dl_nas_transport_ies_o::value_c::types_opts::to_string() const return convert_enum_idx(options, 9, value, "dl_nas_transport_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; dl_nas_transport_ies_container::dl_nas_transport_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -9758,7 +9758,7 @@ const char* dl_non_ueassociated_nrp_pa_transport_ies_o::value_c::types_opts::to_ return convert_enum_idx(options, 2, value, "dl_non_ueassociated_nrp_pa_transport_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; dl_non_ueassociated_nrp_pa_transport_ies_container::dl_non_ueassociated_nrp_pa_transport_ies_container() : routing_id(89, crit_e::reject), nrp_pa_pdu(46, crit_e::reject) @@ -10504,7 +10504,7 @@ const char* dl_ran_cfg_transfer_ies_o::value_c::types_opts::to_string() const return convert_enum_idx(options, 2, value, "dl_ran_cfg_transfer_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; dl_ran_cfg_transfer_ies_container::dl_ran_cfg_transfer_ies_container() : son_cfg_transfer_dl(98, crit_e::ignore), endc_son_cfg_transfer_dl(157, crit_e::ignore) @@ -10864,7 +10864,7 @@ const char* dl_ran_status_transfer_ies_o::value_c::types_opts::to_string() const return convert_enum_idx(options, 3, value, "dl_ran_status_transfer_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; dl_ran_status_transfer_ies_container::dl_ran_status_transfer_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -11226,7 +11226,7 @@ const char* dl_ueassociated_nrp_pa_transport_ies_o::value_c::types_opts::to_stri return convert_enum_idx(options, 4, value, "dl_ueassociated_nrp_pa_transport_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; dl_ueassociated_nrp_pa_transport_ies_container::dl_ueassociated_nrp_pa_transport_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -11891,7 +11891,7 @@ const char* error_ind_ies_o::value_c::types_opts::to_string() const return convert_enum_idx(options, 4, value, "error_ind_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; error_ind_ies_container::error_ind_ies_container() : amf_ue_ngap_id(10, crit_e::ignore), @@ -12365,7 +12365,7 @@ const char* ho_cancel_ies_o::value_c::types_opts::to_string() const return convert_enum_idx(options, 3, value, "ho_cancel_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ho_cancel_ies_container::ho_cancel_ies_container() : amf_ue_ngap_id(10, crit_e::reject), ran_ue_ngap_id(85, crit_e::reject), cause(15, crit_e::ignore) @@ -12686,7 +12686,7 @@ const char* ho_cancel_ack_ies_o::value_c::types_opts::to_string() const return convert_enum_idx(options, 3, value, "ho_cancel_ack_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ho_cancel_ack_ies_container::ho_cancel_ack_ies_container() : amf_ue_ngap_id(10, crit_e::ignore), ran_ue_ngap_id(85, crit_e::ignore), crit_diagnostics(19, crit_e::ignore) @@ -13298,7 +13298,7 @@ const char* ho_cmd_ies_o::value_c::types_opts::to_string() const return convert_enum_idx(options, 8, value, "ho_cmd_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ho_cmd_ies_container::ho_cmd_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -13952,7 +13952,7 @@ uint8_t ho_fail_ies_o::value_c::types_opts::to_number() const return map_enum_number(options, 1, value, "ho_fail_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ho_fail_ies_container::ho_fail_ies_container() : amf_ue_ngap_id(10, crit_e::ignore), cause(15, crit_e::ignore), crit_diagnostics(19, crit_e::ignore) @@ -14620,7 +14620,7 @@ const char* ho_notify_ies_o::value_c::types_opts::to_string() const return convert_enum_idx(options, 3, value, "ho_notify_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ho_notify_ies_container::ho_notify_ies_container() : amf_ue_ngap_id(10, crit_e::reject), ran_ue_ngap_id(85, crit_e::reject), user_location_info(121, crit_e::ignore) @@ -14981,7 +14981,7 @@ const char* ho_prep_fail_ies_o::value_c::types_opts::to_string() const return convert_enum_idx(options, 4, value, "ho_prep_fail_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ho_prep_fail_ies_container::ho_prep_fail_ies_container() : amf_ue_ngap_id(10, crit_e::ignore), @@ -16289,7 +16289,7 @@ uint8_t ho_request_ies_o::value_c::types_opts::to_number() const return 0; } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ho_request_ies_container::ho_request_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -17024,7 +17024,7 @@ const char* ho_request_ack_ies_o::value_c::types_opts::to_string() const return convert_enum_idx(options, 6, value, "ho_request_ack_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ho_request_ack_ies_container::ho_request_ack_ies_container() : amf_ue_ngap_id(10, crit_e::ignore), @@ -18086,7 +18086,7 @@ const char* ho_required_ies_o::value_c::types_opts::to_string() const return convert_enum_idx(options, 8, value, "ho_required_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ho_required_ies_container::ho_required_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -18802,7 +18802,7 @@ const char* init_context_setup_fail_ies_o::value_c::types_opts::to_string() cons return convert_enum_idx(options, 5, value, "init_context_setup_fail_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; init_context_setup_fail_ies_container::init_context_setup_fail_ies_container() : amf_ue_ngap_id(10, crit_e::ignore), @@ -19938,7 +19938,7 @@ const char* init_context_setup_request_ies_o::value_c::types_opts::to_string() c return convert_enum_idx(options, 20, value, "init_context_setup_request_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; init_context_setup_request_ies_container::init_context_setup_request_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -20671,7 +20671,7 @@ const char* init_context_setup_resp_ies_o::value_c::types_opts::to_string() cons return convert_enum_idx(options, 5, value, "init_context_setup_resp_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; init_context_setup_resp_ies_container::init_context_setup_resp_ies_container() : amf_ue_ngap_id(10, crit_e::ignore), @@ -21256,7 +21256,7 @@ uint8_t init_ue_msg_ies_o::value_c::types_opts::to_number() const return map_enum_number(options, 1, value, "init_ue_msg_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; init_ue_msg_ies_container::init_ue_msg_ies_container() : ran_ue_ngap_id(85, crit_e::reject), @@ -38790,7 +38790,7 @@ const char* write_replace_warning_resp_ies_o::value_c::types_opts::to_string() c return convert_enum_idx(options, 4, value, "write_replace_warning_resp_ies_o::value_c::types"); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; location_report_ies_container::location_report_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -38924,7 +38924,7 @@ void location_report_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; location_report_ctrl_ies_container::location_report_ctrl_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -39018,7 +39018,7 @@ void location_report_ctrl_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; location_report_fail_ind_ies_container::location_report_fail_ind_ies_container() : amf_ue_ngap_id(10, crit_e::reject), ran_ue_ngap_id(85, crit_e::reject), cause(15, crit_e::ignore) @@ -39110,7 +39110,7 @@ void location_report_fail_ind_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; nas_non_delivery_ind_ies_container::nas_non_delivery_ind_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -39214,7 +39214,7 @@ void nas_non_delivery_ind_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ng_reset_ies_container::ng_reset_ies_container() : cause(15, crit_e::ignore), reset_type(88, crit_e::reject) {} SRSASN_CODE ng_reset_ies_container::pack(bit_ref& bref) const @@ -39295,7 +39295,7 @@ void ng_reset_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ng_reset_ack_ies_container::ng_reset_ack_ies_container() : ue_associated_lc_ng_conn_list(111, crit_e::ignore), crit_diagnostics(19, crit_e::ignore) @@ -39382,7 +39382,7 @@ void ng_reset_ack_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ng_setup_fail_ies_container::ng_setup_fail_ies_container() : cause(15, crit_e::ignore), time_to_wait(107, crit_e::ignore), crit_diagnostics(19, crit_e::ignore) @@ -39484,7 +39484,7 @@ void ng_setup_fail_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ng_setup_request_ies_container::ng_setup_request_ies_container() : global_ran_node_id(27, crit_e::reject), @@ -39608,7 +39608,7 @@ void ng_setup_request_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ng_setup_resp_ies_container::ng_setup_resp_ies_container() : amf_name(1, crit_e::reject), @@ -39742,7 +39742,7 @@ void ng_setup_resp_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; overload_start_ies_container::overload_start_ies_container() : amf_overload_resp(2, crit_e::reject), @@ -39890,7 +39890,7 @@ void overload_stop_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; pdu_session_res_modify_confirm_ies_container::pdu_session_res_modify_confirm_ies_container() : amf_ue_ngap_id(10, crit_e::ignore), @@ -40014,7 +40014,7 @@ void pdu_session_res_modify_confirm_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; pdu_session_res_modify_ind_ies_container::pdu_session_res_modify_ind_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -40108,7 +40108,7 @@ void pdu_session_res_modify_ind_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; pdu_session_res_modify_request_ies_container::pdu_session_res_modify_request_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -40217,7 +40217,7 @@ void pdu_session_res_modify_request_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; pdu_session_res_modify_resp_ies_container::pdu_session_res_modify_resp_ies_container() : amf_ue_ngap_id(10, crit_e::ignore), @@ -40361,7 +40361,7 @@ void pdu_session_res_modify_resp_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; pdu_session_res_notify_ies_container::pdu_session_res_notify_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -40490,7 +40490,7 @@ void pdu_session_res_notify_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; pdu_session_res_release_cmd_ies_container::pdu_session_res_release_cmd_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -40614,7 +40614,7 @@ void pdu_session_res_release_cmd_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; pdu_session_res_release_resp_ies_container::pdu_session_res_release_resp_ies_container() : amf_ue_ngap_id(10, crit_e::ignore), @@ -40738,7 +40738,7 @@ void pdu_session_res_release_resp_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; pdu_session_res_setup_request_ies_container::pdu_session_res_setup_request_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -40877,7 +40877,7 @@ void pdu_session_res_setup_request_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; pdu_session_res_setup_resp_ies_container::pdu_session_res_setup_resp_ies_container() : amf_ue_ngap_id(10, crit_e::ignore), @@ -41006,7 +41006,7 @@ void pdu_session_res_setup_resp_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; pws_cancel_request_ies_container::pws_cancel_request_ies_container() : msg_id(35, crit_e::reject), @@ -41120,7 +41120,7 @@ void pws_cancel_request_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; pws_cancel_resp_ies_container::pws_cancel_resp_ies_container() : msg_id(35, crit_e::reject), @@ -41234,7 +41234,7 @@ void pws_cancel_resp_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; pws_fail_ind_ies_container::pws_fail_ind_ies_container() : pws_failed_cell_id_list(81, crit_e::reject), global_ran_node_id(27, crit_e::reject) @@ -41317,7 +41317,7 @@ void pws_fail_ind_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; pws_restart_ind_ies_container::pws_restart_ind_ies_container() : cell_id_list_for_restart(16, crit_e::reject), @@ -41426,7 +41426,7 @@ void pws_restart_ind_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; paging_ies_container::paging_ies_container() : ue_paging_id(115, crit_e::ignore), @@ -41585,7 +41585,7 @@ void paging_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; path_switch_request_ies_container::path_switch_request_ies_container() : ran_ue_ngap_id(85, crit_e::reject), @@ -41714,7 +41714,7 @@ void path_switch_request_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; path_switch_request_ack_ies_container::path_switch_request_ack_ies_container() : amf_ue_ngap_id(10, crit_e::ignore), @@ -41933,7 +41933,7 @@ void path_switch_request_ack_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; path_switch_request_fail_ies_container::path_switch_request_fail_ies_container() : amf_ue_ngap_id(10, crit_e::ignore), @@ -42132,7 +42132,7 @@ void private_msg_s::to_json(json_writer& j) const j.end_array(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ran_cfg_upd_ies_container::ran_cfg_upd_ies_container() : ran_node_name(82, crit_e::ignore), @@ -42272,7 +42272,7 @@ void ran_cfg_upd_ack_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ran_cfg_upd_fail_ies_container::ran_cfg_upd_fail_ies_container() : cause(15, crit_e::ignore), time_to_wait(107, crit_e::ignore), crit_diagnostics(19, crit_e::ignore) @@ -42374,7 +42374,7 @@ void ran_cfg_upd_fail_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; rrc_inactive_transition_report_ies_container::rrc_inactive_transition_report_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -42478,7 +42478,7 @@ void rrc_inactive_transition_report_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; reroute_nas_request_ies_container::reroute_nas_request_ies_container() : ran_ue_ngap_id(85, crit_e::reject), @@ -42602,7 +42602,7 @@ void reroute_nas_request_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; secondary_rat_data_usage_report_ies_container::secondary_rat_data_usage_report_ies_container() : amf_ue_ngap_id(10, crit_e::ignore), @@ -42711,7 +42711,7 @@ void secondary_rat_data_usage_report_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; trace_fail_ind_ies_container::trace_fail_ind_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -42815,7 +42815,7 @@ void trace_fail_ind_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; trace_start_ies_container::trace_start_ies_container() : amf_ue_ngap_id(10, crit_e::reject), ran_ue_ngap_id(85, crit_e::reject), trace_activation(108, crit_e::ignore) @@ -42907,7 +42907,7 @@ void trace_start_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ue_context_mod_fail_ies_container::ue_context_mod_fail_ies_container() : amf_ue_ngap_id(10, crit_e::ignore), @@ -43016,7 +43016,7 @@ void ue_context_mod_fail_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ue_context_mod_request_ies_container::ue_context_mod_request_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -43235,7 +43235,7 @@ void ue_context_mod_request_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ue_context_mod_resp_ies_container::ue_context_mod_resp_ies_container() : amf_ue_ngap_id(10, crit_e::ignore), @@ -43364,7 +43364,7 @@ void ue_context_mod_resp_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ue_context_release_cmd_ies_container::ue_context_release_cmd_ies_container() : ue_ngap_ids(114, crit_e::reject), cause(15, crit_e::ignore) @@ -43447,7 +43447,7 @@ void ue_context_release_cmd_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ue_context_release_complete_ies_container::ue_context_release_complete_ies_container() : amf_ue_ngap_id(10, crit_e::ignore), @@ -43592,7 +43592,7 @@ void ue_context_release_complete_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ue_context_release_request_ies_container::ue_context_release_request_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -43701,7 +43701,7 @@ void ue_context_release_request_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ue_radio_cap_check_request_ies_container::ue_radio_cap_check_request_ies_container() : amf_ue_ngap_id(10, crit_e::reject), ran_ue_ngap_id(85, crit_e::reject), ue_radio_cap(117, crit_e::ignore) @@ -43798,7 +43798,7 @@ void ue_radio_cap_check_request_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ue_radio_cap_check_resp_ies_container::ue_radio_cap_check_resp_ies_container() : amf_ue_ngap_id(10, crit_e::ignore), @@ -43907,7 +43907,7 @@ void ue_radio_cap_check_resp_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ue_radio_cap_info_ind_ies_container::ue_radio_cap_info_ind_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -44016,7 +44016,7 @@ void ue_radio_cap_info_ind_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; uetnla_binding_release_request_ies_container::uetnla_binding_release_request_ies_container() : amf_ue_ngap_id(10, crit_e::reject), ran_ue_ngap_id(85, crit_e::reject) @@ -44099,7 +44099,7 @@ void uetnla_binding_release_request_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ul_nas_transport_ies_container::ul_nas_transport_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -44203,7 +44203,7 @@ void ul_nas_transport_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ul_non_ueassociated_nrp_pa_transport_ies_container::ul_non_ueassociated_nrp_pa_transport_ies_container() : routing_id(89, crit_e::reject), nrp_pa_pdu(46, crit_e::reject) @@ -44286,7 +44286,7 @@ void ul_non_ueassociated_nrp_pa_transport_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ul_ran_cfg_transfer_ies_container::ul_ran_cfg_transfer_ies_container() : son_cfg_transfer_ul(99, crit_e::ignore), endc_son_cfg_transfer_ul(158, crit_e::ignore) @@ -44373,7 +44373,7 @@ void ul_ran_cfg_transfer_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ul_ran_status_transfer_ies_container::ul_ran_status_transfer_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -44467,7 +44467,7 @@ void ul_ran_status_transfer_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; ul_ueassociated_nrp_pa_transport_ies_container::ul_ueassociated_nrp_pa_transport_ies_container() : amf_ue_ngap_id(10, crit_e::reject), @@ -44571,7 +44571,7 @@ void ul_ueassociated_nrp_pa_transport_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; write_replace_warning_request_ies_container::write_replace_warning_request_ies_container() : msg_id(35, crit_e::reject), @@ -44780,7 +44780,7 @@ void write_replace_warning_request_s::to_json(json_writer& j) const j.end_obj(); } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; write_replace_warning_resp_ies_container::write_replace_warning_resp_ies_container() : msg_id(35, crit_e::reject), @@ -49519,7 +49519,7 @@ const char* pdu_session_res_modify_ind_transfer_ext_ies_o::ext_c::types_opts::to return convert_enum_idx(options, 2, value, "pdu_session_res_modify_ind_transfer_ext_ies_o::ext_c::types"); } -template struct asn1::ngap_nr::protocol_ext_field_s; +template struct asn1::ngap::protocol_ext_field_s; pdu_session_res_modify_ind_transfer_ext_ies_container::pdu_session_res_modify_ind_transfer_ext_ies_container() : secondary_ratusage_info(144, crit_e::ignore), security_result(156, crit_e::ignore) @@ -50448,7 +50448,7 @@ uint8_t pdu_session_res_modify_request_transfer_ies_o::value_c::types_opts::to_n return 0; } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; pdu_session_res_modify_request_transfer_ies_container::pdu_session_res_modify_request_transfer_ies_container() : pdu_session_aggregate_maximum_bit_rate(130, crit_e::reject), @@ -51898,7 +51898,7 @@ uint8_t pdu_session_res_setup_request_transfer_ies_o::value_c::types_opts::to_nu return 0; } -template struct asn1::ngap_nr::protocol_ie_field_s; +template struct asn1::ngap::protocol_ie_field_s; pdu_session_res_setup_request_transfer_ies_container::pdu_session_res_setup_request_transfer_ies_container() : pdu_session_aggregate_maximum_bit_rate(130, crit_e::reject), diff --git a/lib/test/asn1/ngap_test.cc b/lib/test/asn1/ngap_test.cc index 33fdc610b..8114d8012 100644 --- a/lib/test/asn1/ngap_test.cc +++ b/lib/test/asn1/ngap_test.cc @@ -14,7 +14,7 @@ #include "srsran/common/test_common.h" using namespace asn1; -using namespace asn1::ngap_nr; +using namespace asn1::ngap; /* TESTS */ @@ -309,7 +309,7 @@ int test_session_res_setup_request() TESTASSERT(pdu.init_msg().value.type().value == ngap_elem_procs_o::init_msg_c::types_opts::pdu_session_res_setup_request); auto& container = pdu.init_msg().value.pdu_session_res_setup_request().protocol_ies; - TESTASSERT(container.pdu_session_res_setup_list_su_req.id == ASN1_NGAP_NR_ID_PDU_SESSION_RES_SETUP_LIST_SU_REQ); + TESTASSERT(container.pdu_session_res_setup_list_su_req.id == ASN1_NGAP_ID_PDU_SESSION_RES_SETUP_LIST_SU_REQ); TESTASSERT(container.pdu_session_res_setup_list_su_req.value.size() == 1); auto& item = container.pdu_session_res_setup_list_su_req.value[0]; TESTASSERT(item.pdu_session_id == 1); diff --git a/srsgnb/hdr/stack/common/test/dummy_nr_classes.h b/srsgnb/hdr/stack/common/test/dummy_nr_classes.h index 1fac72327..56d91d9d8 100644 --- a/srsgnb/hdr/stack/common/test/dummy_nr_classes.h +++ b/srsgnb/hdr/stack/common/test/dummy_nr_classes.h @@ -21,22 +21,22 @@ namespace srsenb { class ngap_dummy : public ngap_interface_rrc_nr { - void initial_ue(uint16_t rnti, - uint32_t gnb_cc_idx, - asn1::ngap_nr::rrcestablishment_cause_e cause, - srsran::const_byte_span pdu) + void initial_ue(uint16_t rnti, + uint32_t gnb_cc_idx, + asn1::ngap::rrcestablishment_cause_e cause, + srsran::const_byte_span pdu) {} - void initial_ue(uint16_t rnti, - uint32_t gnb_cc_idx, - asn1::ngap_nr::rrcestablishment_cause_e cause, - srsran::const_byte_span pdu, - uint32_t m_tmsi) + void initial_ue(uint16_t rnti, + uint32_t gnb_cc_idx, + asn1::ngap::rrcestablishment_cause_e cause, + srsran::const_byte_span pdu, + uint32_t m_tmsi) {} void write_pdu(uint16_t rnti, srsran::const_byte_span pdu) {} bool user_exists(uint16_t rnti) { return true; } void user_mod(uint16_t old_rnti, uint16_t new_rnti) {} - void user_release_request(uint16_t rnti, asn1::ngap_nr::cause_radio_network_e cause_radio) {} + void user_release_request(uint16_t rnti, asn1::ngap::cause_radio_network_e cause_radio) {} bool is_amf_connected() { return true; } void ue_notify_rrc_reconf_complete(uint16_t rnti, bool outcome) {} }; diff --git a/srsgnb/hdr/stack/ngap/ngap.h b/srsgnb/hdr/stack/ngap/ngap.h index 146b12203..76dd3e6a9 100644 --- a/srsgnb/hdr/stack/ngap/ngap.h +++ b/srsgnb/hdr/stack/ngap/ngap.h @@ -48,27 +48,27 @@ public: void stop(); // RRC NR interface - void initial_ue(uint16_t rnti, - uint32_t gnb_cc_idx, - asn1::ngap_nr::rrcestablishment_cause_e cause, - srsran::const_byte_span pdu) override; - void initial_ue(uint16_t rnti, - uint32_t gnb_cc_idx, - asn1::ngap_nr::rrcestablishment_cause_e cause, - srsran::const_byte_span pdu, - uint32_t s_tmsi) override; + void initial_ue(uint16_t rnti, + uint32_t gnb_cc_idx, + asn1::ngap::rrcestablishment_cause_e cause, + srsran::const_byte_span pdu) override; + void initial_ue(uint16_t rnti, + uint32_t gnb_cc_idx, + asn1::ngap::rrcestablishment_cause_e cause, + srsran::const_byte_span pdu, + uint32_t s_tmsi) override; void write_pdu(uint16_t rnti, srsran::const_byte_span pdu) override; bool user_exists(uint16_t rnti) override { return true; }; void user_mod(uint16_t old_rnti, uint16_t new_rnti) override {} // TS 38.413 - Section 8.3.2 - UE Context Release Request - void user_release_request(uint16_t rnti, asn1::ngap_nr::cause_radio_network_e cause_radio) override; + void user_release_request(uint16_t rnti, asn1::ngap::cause_radio_network_e cause_radio) override; bool is_amf_connected() override; - bool send_error_indication(const asn1::ngap_nr::cause_c& cause, - srsran::optional ran_ue_ngap_id = {}, - srsran::optional amf_ue_ngap_id = {}); + bool send_error_indication(const asn1::ngap::cause_c& cause, + srsran::optional ran_ue_ngap_id = {}, + srsran::optional amf_ue_ngap_id = {}); void ue_notify_rrc_reconf_complete(uint16_t rnti, bool outcome) override; bool send_pdu_session_resource_setup_response(); @@ -83,7 +83,7 @@ public: // Logging typedef enum { Rx = 0, Tx } direction_t; - void log_ngap_message(const asn1::ngap_nr::ngap_pdu_c& msg, const direction_t dir, srsran::const_byte_span pdu); + void log_ngap_message(const asn1::ngap::ngap_pdu_c& msg, const direction_t dir, srsran::const_byte_span pdu); private: static const int AMF_PORT = 38412; @@ -111,33 +111,33 @@ private: srsran::unique_timer amf_connect_timer, ngsetup_timeout; // Protocol IEs sent with every UL NGAP message - asn1::ngap_nr::tai_s tai; - asn1::ngap_nr::nr_cgi_s nr_cgi; + asn1::ngap::tai_s tai; + asn1::ngap::nr_cgi_s nr_cgi; - asn1::ngap_nr::ng_setup_resp_s ngsetupresponse; + asn1::ngap::ng_setup_resp_s ngsetupresponse; int build_tai_cgi(); bool connect_amf(); bool setup_ng(); - bool sctp_send_ngap_pdu(const asn1::ngap_nr::ngap_pdu_c& tx_pdu, uint32_t rnti, const char* procedure_name); + bool sctp_send_ngap_pdu(const asn1::ngap::ngap_pdu_c& tx_pdu, uint32_t rnti, const char* procedure_name); bool handle_ngap_rx_pdu(srsran::byte_buffer_t* pdu); - bool handle_successful_outcome(const asn1::ngap_nr::successful_outcome_s& msg); - bool handle_unsuccessful_outcome(const asn1::ngap_nr::unsuccessful_outcome_s& msg); - bool handle_initiating_message(const asn1::ngap_nr::init_msg_s& msg); + bool handle_successful_outcome(const asn1::ngap::successful_outcome_s& msg); + bool handle_unsuccessful_outcome(const asn1::ngap::unsuccessful_outcome_s& msg); + bool handle_initiating_message(const asn1::ngap::init_msg_s& msg); // TS 38.413 - Section 8.6.2 - Downlink NAS Transport - bool handle_dl_nas_transport(const asn1::ngap_nr::dl_nas_transport_s& msg); + bool handle_dl_nas_transport(const asn1::ngap::dl_nas_transport_s& msg); // TS 38.413 - Section 9.2.6.2 - NG Setup Response - bool handle_ng_setup_response(const asn1::ngap_nr::ng_setup_resp_s& msg); + bool handle_ng_setup_response(const asn1::ngap::ng_setup_resp_s& msg); // TS 38.413 - Section 9.2.6.3 - NG Setup Failure - bool handle_ng_setup_failure(const asn1::ngap_nr::ng_setup_fail_s& msg); + bool handle_ng_setup_failure(const asn1::ngap::ng_setup_fail_s& msg); // TS 38.413 - Section 9.2.2.5 - UE Context Release Command - bool handle_ue_context_release_cmd(const asn1::ngap_nr::ue_context_release_cmd_s& msg); + bool handle_ue_context_release_cmd(const asn1::ngap::ue_context_release_cmd_s& msg); // TS 38.413 - Section 9.2.2.1 - Initial Context Setup Request - bool handle_initial_ctxt_setup_request(const asn1::ngap_nr::init_context_setup_request_s& msg); + bool handle_initial_ctxt_setup_request(const asn1::ngap::init_context_setup_request_s& msg); // TS 38.413 - Section 9.2.1.1 - PDU Session Resource Setup Request - bool handle_ue_pdu_session_res_setup_request(const asn1::ngap_nr::pdu_session_res_setup_request_s& msg); + bool handle_ue_pdu_session_res_setup_request(const asn1::ngap::pdu_session_res_setup_request_s& msg); // PCAP srsran::ngap_pcap* pcap = nullptr; @@ -192,8 +192,8 @@ private: srsran::proc_t ngsetup_proc; - std::string get_cause(const asn1::ngap_nr::cause_c& c); - void log_ngap_msg(const asn1::ngap_nr::ngap_pdu_c& msg, srsran::const_span sdu, bool is_rx); + std::string get_cause(const asn1::ngap::cause_c& c); + void log_ngap_msg(const asn1::ngap::ngap_pdu_c& msg, srsran::const_span sdu, bool is_rx); }; } // namespace srsenb diff --git a/srsgnb/hdr/stack/ngap/ngap_ue.h b/srsgnb/hdr/stack/ngap/ngap_ue.h index c33b5094f..a163ea24d 100644 --- a/srsgnb/hdr/stack/ngap/ngap_ue.h +++ b/srsgnb/hdr/stack/ngap/ngap_ue.h @@ -30,16 +30,16 @@ public: srslog::basic_logger& logger_); virtual ~ue(); // TS 38.413 - Section 9.2.5.1 - Initial UE Message - bool send_initial_ue_message(asn1::ngap_nr::rrcestablishment_cause_e cause, - srsran::const_byte_span pdu, - bool has_tmsi, - uint32_t s_tmsi = 0); + bool send_initial_ue_message(asn1::ngap::rrcestablishment_cause_e cause, + srsran::const_byte_span pdu, + bool has_tmsi, + uint32_t s_tmsi = 0); // TS 38.413 - Section 9.2.5.3 - Uplink NAS Transport bool send_ul_nas_transport(srsran::const_byte_span pdu); // TS 38.413 - Section 9.2.2.2 - Initial Context Setup Response bool send_initial_ctxt_setup_response(); // TS 38.413 - Section 9.2.2.3 - Initial Context Setup Failure - bool send_initial_ctxt_setup_failure(asn1::ngap_nr::cause_c cause); + bool send_initial_ctxt_setup_failure(asn1::ngap::cause_c cause); // TS 38.413 - Section 9.2.1.2 - PDU Session Resource Setup Response bool send_pdu_session_resource_setup_response(uint16_t pdu_session_id, uint32_t teid_in, @@ -47,13 +47,13 @@ public: // TS 38.413 - Section 9.2.1.2 - UE Context Release Complete bool send_ue_ctxt_release_complete(); // TS 38.413 - Section 9.2.2.1 - Initial Context Setup Request - bool handle_initial_ctxt_setup_request(const asn1::ngap_nr::init_context_setup_request_s& msg); + bool handle_initial_ctxt_setup_request(const asn1::ngap::init_context_setup_request_s& msg); // TS 38.413 - Section 9.2.2.4 - UE Context Release Request - bool send_ue_context_release_request(asn1::ngap_nr::cause_c cause); + bool send_ue_context_release_request(asn1::ngap::cause_c cause); // TS 38.413 - Section 9.2.2.5 - UE Context Release Command - bool handle_ue_context_release_cmd(const asn1::ngap_nr::ue_context_release_cmd_s& msg); + bool handle_ue_context_release_cmd(const asn1::ngap::ue_context_release_cmd_s& msg); // TS 38.413 - Section 9.2.1.1 - PDU Session Resource Setup Request - bool handle_pdu_session_res_setup_request(const asn1::ngap_nr::pdu_session_res_setup_request_s& msg); + bool handle_pdu_session_res_setup_request(const asn1::ngap::pdu_session_res_setup_request_s& msg); /// Checks if a UE Context Release Request was already sent bool was_ue_context_release_requested() const { return release_requested; } diff --git a/srsgnb/hdr/stack/ngap/ngap_ue_bearer_manager.h b/srsgnb/hdr/stack/ngap/ngap_ue_bearer_manager.h index 0f896f04a..31ceaac77 100644 --- a/srsgnb/hdr/stack/ngap/ngap_ue_bearer_manager.h +++ b/srsgnb/hdr/stack/ngap/ngap_ue_bearer_manager.h @@ -35,10 +35,10 @@ public: asn1::bounded_bitstring<1, 160, true, true> address_out; asn1::bounded_bitstring<1, 160, true, true> address_in; }; - uint8_t id = 0; - uint8_t lcid = 0; - asn1::ngap_nr::qos_flow_level_qos_params_s qos_params; - std::vector tunnels; + uint8_t id = 0; + uint8_t lcid = 0; + asn1::ngap::qos_flow_level_qos_params_s qos_params; + std::vector tunnels; }; ngap_ue_bearer_manager(gtpu_interface_rrc* gtpu_, srslog::basic_logger& logger_); @@ -46,13 +46,13 @@ public: int add_pdu_session(uint16_t rnti, uint8_t pdu_session_id, - const asn1::ngap_nr::qos_flow_level_qos_params_s& qos, + const asn1::ngap::qos_flow_level_qos_params_s& qos, const asn1::bounded_bitstring<1, 160, true, true>& addr, uint32_t teid_out, uint16_t& lcid, asn1::bounded_bitstring<1, 160, true, true>& addr_in, uint32_t& teid_in, - asn1::ngap_nr::cause_c& cause); + asn1::ngap::cause_c& cause); int reset_pdu_sessions(uint16_t rnti); diff --git a/srsgnb/hdr/stack/ngap/ngap_ue_proc.h b/srsgnb/hdr/stack/ngap/ngap_ue_proc.h index 36f2e57fc..fa58d7b7c 100644 --- a/srsgnb/hdr/stack/ngap/ngap_ue_proc.h +++ b/srsgnb/hdr/stack/ngap/ngap_ue_proc.h @@ -38,7 +38,7 @@ public: rrc_interface_ngap_nr* rrc_, ngap_ue_ctxt_t* ue_ctxt, srslog::basic_logger& logger_); - srsran::proc_outcome_t init(const asn1::ngap_nr::init_context_setup_request_s& msg); + srsran::proc_outcome_t init(const asn1::ngap::init_context_setup_request_s& msg); srsran::proc_outcome_t react(const bool rrc_reconf_outcome); srsran::proc_outcome_t step(); static const char* name() { return "Initial Context Setup"; } @@ -59,7 +59,7 @@ public: ngap_ue_ctxt_t* ue_ctxt, ngap_ue_bearer_manager* bearer_manager, srslog::basic_logger& logger_); - srsran::proc_outcome_t init(const asn1::ngap_nr::ue_context_release_cmd_s& msg); + srsran::proc_outcome_t init(const asn1::ngap::ue_context_release_cmd_s& msg); srsran::proc_outcome_t step(); static const char* name() { return "UE Context Release"; } @@ -92,7 +92,7 @@ public: ngap_ue_ctxt_t* ue_ctxt, ngap_ue_bearer_manager* bearer_manager, srslog::basic_logger& logger_); - srsran::proc_outcome_t init(const asn1::ngap_nr::pdu_session_res_setup_request_s& msg); + srsran::proc_outcome_t init(const asn1::ngap::pdu_session_res_setup_request_s& msg); srsran::proc_outcome_t step(); static const char* name() { return "UE PDU Session Resource Setup"; } diff --git a/srsgnb/hdr/stack/rrc/rrc_nr.h b/srsgnb/hdr/stack/rrc/rrc_nr.h index 7ba5cf6e1..413dadf83 100644 --- a/srsgnb/hdr/stack/rrc/rrc_nr.h +++ b/srsgnb/hdr/stack/rrc/rrc_nr.h @@ -94,8 +94,8 @@ public: // Interfaces for NGAP int ue_set_security_cfg_key(uint16_t rnti, const asn1::fixed_bitstring<256, false, true>& key) final; - int ue_set_bitrates(uint16_t rnti, const asn1::ngap_nr::ue_aggregate_maximum_bit_rate_s& rates) final; - int ue_set_security_cfg_capabilities(uint16_t rnti, const asn1::ngap_nr::ue_security_cap_s& caps) final; + int ue_set_bitrates(uint16_t rnti, const asn1::ngap::ue_aggregate_maximum_bit_rate_s& rates) final; + int ue_set_security_cfg_capabilities(uint16_t rnti, const asn1::ngap::ue_security_cap_s& caps) final; int start_security_mode_procedure(uint16_t rnti, srsran::unique_byte_buffer_t nas_pdu) final; int establish_rrc_bearer(uint16_t rnti, uint16_t pdu_session_id, @@ -104,7 +104,7 @@ public: int release_bearers(uint16_t rnti) final; void release_user(uint16_t rnti) final; void write_dl_info(uint16_t rnti, srsran::unique_byte_buffer_t sdu) final; - int set_aggregate_max_bitrate(uint16_t rnti, const asn1::ngap_nr::ue_aggregate_maximum_bit_rate_s& rates) final; + int set_aggregate_max_bitrate(uint16_t rnti, const asn1::ngap::ue_aggregate_maximum_bit_rate_s& rates) final; int allocate_lcid(uint16_t rnti) final; // logging diff --git a/srsgnb/hdr/stack/rrc/rrc_nr_security_context.h b/srsgnb/hdr/stack/rrc/rrc_nr_security_context.h index e8bb1d379..3d241283b 100644 --- a/srsgnb/hdr/stack/rrc/rrc_nr_security_context.h +++ b/srsgnb/hdr/stack/rrc/rrc_nr_security_context.h @@ -46,7 +46,7 @@ public: return *this; } - bool set_security_capabilities(const asn1::ngap_nr::ue_security_cap_s& caps); + bool set_security_capabilities(const asn1::ngap::ue_security_cap_s& caps); void set_security_key(const asn1::fixed_bitstring<256, false, true>& key); void set_ncc(uint8_t ncc_) { ncc = ncc_; } @@ -60,13 +60,13 @@ public: private: void generate_as_keys(); - srslog::basic_logger& logger; - const srsenb::rrc_nr_cfg_t& cfg; - bool k_gnb_present = false; - asn1::ngap_nr::ue_security_cap_s security_capabilities = {}; - uint8_t k_gnb[32] = {}; // Provided by MME - srsran::nr_as_security_config_t sec_cfg = {}; - uint8_t ncc = 0; + srslog::basic_logger& logger; + const srsenb::rrc_nr_cfg_t& cfg; + bool k_gnb_present = false; + asn1::ngap::ue_security_cap_s security_capabilities = {}; + uint8_t k_gnb[32] = {}; // Provided by MME + srsran::nr_as_security_config_t sec_cfg = {}; + uint8_t ncc = 0; }; } // namespace srsgnb #endif diff --git a/srsgnb/hdr/stack/rrc/rrc_nr_ue.h b/srsgnb/hdr/stack/rrc/rrc_nr_ue.h index 8fc4947ce..99ca94f07 100644 --- a/srsgnb/hdr/stack/rrc/rrc_nr_ue.h +++ b/srsgnb/hdr/stack/rrc/rrc_nr_ue.h @@ -45,10 +45,7 @@ public: // setters void set_security_key(const asn1::fixed_bitstring<256, false, true>& key) { sec_ctx.set_security_key(key); } - void set_security_capabilities(const asn1::ngap_nr::ue_security_cap_s& caps) - { - sec_ctx.set_security_capabilities(caps); - } + void set_security_capabilities(const asn1::ngap::ue_security_cap_s& caps) { sec_ctx.set_security_capabilities(caps); } void deactivate_bearers(); diff --git a/srsgnb/src/stack/ngap/ngap.cc b/srsgnb/src/stack/ngap/ngap.cc index 51b620cc2..681e68ace 100644 --- a/srsgnb/src/stack/ngap/ngap.cc +++ b/srsgnb/src/stack/ngap/ngap.cc @@ -28,7 +28,7 @@ using srsran::uint32_to_uint8; } \ } while (0) -using namespace asn1::ngap_nr; +using namespace asn1::ngap; namespace srsenb { /********************************************************* @@ -211,10 +211,10 @@ int ngap::build_tai_cgi() /******************************************************************************* /* RRC interface ********************************************************************************/ -void ngap::initial_ue(uint16_t rnti, - uint32_t gnb_cc_idx, - asn1::ngap_nr::rrcestablishment_cause_e cause, - srsran::const_byte_span pdu) +void ngap::initial_ue(uint16_t rnti, + uint32_t gnb_cc_idx, + asn1::ngap::rrcestablishment_cause_e cause, + srsran::const_byte_span pdu) { std::unique_ptr ue_ptr{new ue{this, rrc, gtpu, logger}}; ue_ptr->ctxt.rnti = rnti; @@ -227,11 +227,11 @@ void ngap::initial_ue(uint16_t rnti, u->send_initial_ue_message(cause, pdu, false); } -void ngap::initial_ue(uint16_t rnti, - uint32_t gnb_cc_idx, - asn1::ngap_nr::rrcestablishment_cause_e cause, - srsran::const_byte_span pdu, - uint32_t s_tmsi) +void ngap::initial_ue(uint16_t rnti, + uint32_t gnb_cc_idx, + asn1::ngap::rrcestablishment_cause_e cause, + srsran::const_byte_span pdu, + uint32_t s_tmsi) { std::unique_ptr ue_ptr{new ue{this, rrc, gtpu, logger}}; ue_ptr->ctxt.rnti = rnti; @@ -265,7 +265,7 @@ void ngap::write_pdu(uint16_t rnti, srsran::const_byte_span pdu) u->send_ul_nas_transport(pdu); } -void ngap::user_release_request(uint16_t rnti, asn1::ngap_nr::cause_radio_network_e cause_radio) +void ngap::user_release_request(uint16_t rnti, asn1::ngap::cause_radio_network_e cause_radio) { ue* u = users.find_ue_rnti(rnti); if (u == nullptr) { @@ -424,7 +424,7 @@ bool ngap::handle_ngap_rx_pdu(srsran::byte_buffer_t* pdu) return true; } -bool ngap::handle_initiating_message(const asn1::ngap_nr::init_msg_s& msg) +bool ngap::handle_initiating_message(const asn1::ngap::init_msg_s& msg) { switch (msg.value.type().value) { case ngap_elem_procs_o::init_msg_c::types_opts::dl_nas_transport: @@ -452,7 +452,7 @@ bool ngap::handle_successful_outcome(const successful_outcome_s& msg) return true; } -bool ngap::handle_unsuccessful_outcome(const asn1::ngap_nr::unsuccessful_outcome_s& msg) +bool ngap::handle_unsuccessful_outcome(const asn1::ngap::unsuccessful_outcome_s& msg) { switch (msg.value.type().value) { case ngap_elem_procs_o::unsuccessful_outcome_c::types_opts::ng_setup_fail: @@ -463,7 +463,7 @@ bool ngap::handle_unsuccessful_outcome(const asn1::ngap_nr::unsuccessful_outcome return true; } -bool ngap::handle_ng_setup_response(const asn1::ngap_nr::ng_setup_resp_s& msg) +bool ngap::handle_ng_setup_response(const asn1::ngap::ng_setup_resp_s& msg) { ngsetupresponse = msg; amf_connected = true; @@ -475,7 +475,7 @@ bool ngap::handle_ng_setup_response(const asn1::ngap_nr::ng_setup_resp_s& msg) return true; } -bool ngap::handle_ng_setup_failure(const asn1::ngap_nr::ng_setup_fail_s& msg) +bool ngap::handle_ng_setup_failure(const asn1::ngap::ng_setup_fail_s& msg) { std::string cause = get_cause(msg.protocol_ies.cause.value); logger.error("NG Setup Failure. Cause: %s", cause.c_str()); @@ -483,7 +483,7 @@ bool ngap::handle_ng_setup_failure(const asn1::ngap_nr::ng_setup_fail_s& msg) return true; } -bool ngap::handle_dl_nas_transport(const asn1::ngap_nr::dl_nas_transport_s& msg) +bool ngap::handle_dl_nas_transport(const asn1::ngap::dl_nas_transport_s& msg) { if (msg.ext) { logger.warning("Not handling NGAP message extension"); @@ -533,7 +533,7 @@ bool ngap::handle_dl_nas_transport(const asn1::ngap_nr::dl_nas_transport_s& msg) return true; } -bool ngap::handle_initial_ctxt_setup_request(const asn1::ngap_nr::init_context_setup_request_s& msg) +bool ngap::handle_initial_ctxt_setup_request(const asn1::ngap::init_context_setup_request_s& msg) { ue* u = handle_ngapmsg_ue_id(msg.protocol_ies.ran_ue_ngap_id.value.value, msg.protocol_ies.amf_ue_ngap_id.value.value); @@ -547,9 +547,9 @@ bool ngap::handle_initial_ctxt_setup_request(const asn1::ngap_nr::init_context_s return true; } -bool ngap::handle_ue_context_release_cmd(const asn1::ngap_nr::ue_context_release_cmd_s& msg) +bool ngap::handle_ue_context_release_cmd(const asn1::ngap::ue_context_release_cmd_s& msg) { - const asn1::ngap_nr::ue_ngap_id_pair_s& ue_ngap_id_pair = msg.protocol_ies.ue_ngap_ids.value.ue_ngap_id_pair(); + const asn1::ngap::ue_ngap_id_pair_s& ue_ngap_id_pair = msg.protocol_ies.ue_ngap_ids.value.ue_ngap_id_pair(); ue* u = handle_ngapmsg_ue_id(ue_ngap_id_pair.ran_ue_ngap_id, ue_ngap_id_pair.amf_ue_ngap_id); if (u == nullptr) { @@ -560,7 +560,7 @@ bool ngap::handle_ue_context_release_cmd(const asn1::ngap_nr::ue_context_release return u->handle_ue_context_release_cmd(msg); } -bool ngap::handle_ue_pdu_session_res_setup_request(const asn1::ngap_nr::pdu_session_res_setup_request_s& msg) +bool ngap::handle_ue_pdu_session_res_setup_request(const asn1::ngap::pdu_session_res_setup_request_s& msg) { ue* u = handle_ngapmsg_ue_id(msg.protocol_ies.ran_ue_ngap_id.value.value, msg.protocol_ies.amf_ue_ngap_id.value.value); @@ -581,9 +581,9 @@ bool ngap::handle_ue_pdu_session_res_setup_request(const asn1::ngap_nr::pdu_sess /* NGAP message senders ********************************************************************************/ -bool ngap::send_error_indication(const asn1::ngap_nr::cause_c& cause, - srsran::optional ran_ue_ngap_id, - srsran::optional amf_ue_ngap_id) +bool ngap::send_error_indication(const asn1::ngap::cause_c& cause, + srsran::optional ran_ue_ngap_id, + srsran::optional amf_ue_ngap_id) { if (amf_connected == false) { logger.warning("AMF not connected."); @@ -591,7 +591,7 @@ bool ngap::send_error_indication(const asn1::ngap_nr::cause_c& cause, } ngap_pdu_c tx_pdu; - tx_pdu.set_init_msg().load_info_obj(ASN1_NGAP_NR_ID_ERROR_IND); + tx_pdu.set_init_msg().load_info_obj(ASN1_NGAP_ID_ERROR_IND); auto& container = tx_pdu.init_msg().value.error_ind().protocol_ies; uint16_t rnti = SRSRAN_INVALID_RNTI; @@ -655,7 +655,7 @@ bool ngap::setup_ng() plmn = htonl(plmn); ngap_pdu_c pdu; - pdu.set_init_msg().load_info_obj(ASN1_NGAP_NR_ID_NG_SETUP); + pdu.set_init_msg().load_info_obj(ASN1_NGAP_ID_NG_SETUP); ng_setup_request_ies_container& container = pdu.init_msg().value.ng_setup_request().protocol_ies; global_gnb_id_s& global_gnb_id = container.global_ran_node_id.value.set_global_gnb_id(); global_gnb_id.plmn_id = tai.plmn_id; @@ -687,7 +687,7 @@ bool ngap::setup_ng() container.supported_ta_list.value[0].broadcast_plmn_list[0].tai_slice_support_list.resize(1); container.supported_ta_list.value[0].broadcast_plmn_list[0].tai_slice_support_list[0].s_nssai.sst.from_number(1); - container.default_paging_drx.value.value = asn1::ngap_nr::paging_drx_opts::v256; // Todo: add to args, config file + container.default_paging_drx.value.value = asn1::ngap::paging_drx_opts::v256; // Todo: add to args, config file return sctp_send_ngap_pdu(pdu, 0, "ngSetupRequest"); } @@ -696,7 +696,7 @@ bool ngap::setup_ng() /* General helpers ********************************************************************************/ -bool ngap::sctp_send_ngap_pdu(const asn1::ngap_nr::ngap_pdu_c& tx_pdu, uint32_t rnti, const char* procedure_name) +bool ngap::sctp_send_ngap_pdu(const asn1::ngap::ngap_pdu_c& tx_pdu, uint32_t rnti, const char* procedure_name) { if (not amf_connected and rnti != SRSRAN_INVALID_RNTI) { logger.error("Aborting %s for rnti=0x%x. Cause: AMF is not connected.", procedure_name, rnti); diff --git a/srsgnb/src/stack/ngap/ngap_ue.cc b/srsgnb/src/stack/ngap/ngap_ue.cc index 1d420877c..15d7a42bc 100644 --- a/srsgnb/src/stack/ngap/ngap_ue.cc +++ b/srsgnb/src/stack/ngap/ngap_ue.cc @@ -15,7 +15,7 @@ #include "srsgnb/hdr/stack/ngap/ngap_ue_proc.h" #include "srsran/common/int_helpers.h" -using namespace asn1::ngap_nr; +using namespace asn1::ngap; namespace srsenb { @@ -45,10 +45,10 @@ ngap::ue::~ue() {} /* NGAP message senders ********************************************************************************/ -bool ngap::ue::send_initial_ue_message(asn1::ngap_nr::rrcestablishment_cause_e cause, - srsran::const_byte_span pdu, - bool has_tmsi, - uint32_t s_tmsi) +bool ngap::ue::send_initial_ue_message(asn1::ngap::rrcestablishment_cause_e cause, + srsran::const_byte_span pdu, + bool has_tmsi, + uint32_t s_tmsi) { if (not ngap_ptr->amf_connected) { logger.warning("AMF not connected"); @@ -56,7 +56,7 @@ bool ngap::ue::send_initial_ue_message(asn1::ngap_nr::rrcestablishment_cause_e c } ngap_pdu_c tx_pdu; - tx_pdu.set_init_msg().load_info_obj(ASN1_NGAP_NR_ID_INIT_UE_MSG); + tx_pdu.set_init_msg().load_info_obj(ASN1_NGAP_ID_INIT_UE_MSG); init_ue_msg_ies_container& container = tx_pdu.init_msg().value.init_ue_msg().protocol_ies; // 5G-S-TMSI @@ -88,7 +88,7 @@ bool ngap::ue::send_initial_ue_message(asn1::ngap_nr::rrcestablishment_cause_e c // UE context request for setup in the NAS registration request container.ue_context_request_present = true; - container.ue_context_request.value = asn1::ngap_nr::ue_context_request_opts::options::requested; + container.ue_context_request.value = asn1::ngap::ue_context_request_opts::options::requested; return ngap_ptr->sctp_send_ngap_pdu(tx_pdu, ctxt.rnti, "InitialUEMessage"); } @@ -101,8 +101,8 @@ bool ngap::ue::send_ul_nas_transport(srsran::const_byte_span pdu) } ngap_pdu_c tx_pdu; - tx_pdu.set_init_msg().load_info_obj(ASN1_NGAP_NR_ID_UL_NAS_TRANSPORT); - asn1::ngap_nr::ul_nas_transport_ies_container& container = tx_pdu.init_msg().value.ul_nas_transport().protocol_ies; + tx_pdu.set_init_msg().load_info_obj(ASN1_NGAP_ID_UL_NAS_TRANSPORT); + asn1::ngap::ul_nas_transport_ies_container& container = tx_pdu.init_msg().value.ul_nas_transport().protocol_ies; // AMF UE NGAP ID if (ctxt.amf_ue_ngap_id.has_value()) { @@ -143,7 +143,7 @@ bool ngap::ue::send_initial_ctxt_setup_response() } ngap_pdu_c tx_pdu; - tx_pdu.set_successful_outcome().load_info_obj(ASN1_NGAP_NR_ID_INIT_CONTEXT_SETUP); + tx_pdu.set_successful_outcome().load_info_obj(ASN1_NGAP_ID_INIT_CONTEXT_SETUP); init_context_setup_resp_s& container = tx_pdu.successful_outcome().value.init_context_setup_resp(); // AMF UE NGAP ID @@ -163,7 +163,7 @@ bool ngap::ue::send_initial_ctxt_setup_failure(cause_c cause) } ngap_pdu_c tx_pdu; - tx_pdu.set_init_msg().load_info_obj(ASN1_NGAP_NR_ID_INIT_CONTEXT_SETUP); + tx_pdu.set_init_msg().load_info_obj(ASN1_NGAP_ID_INIT_CONTEXT_SETUP); init_context_setup_fail_s& container = tx_pdu.unsuccessful_outcome().value.init_context_setup_fail(); // AMF UE NGAP ID @@ -191,7 +191,7 @@ bool ngap::ue::send_pdu_session_resource_setup_response(uint16_t } // TODO: QOS Params ngap_pdu_c tx_pdu; - tx_pdu.set_successful_outcome().load_info_obj(ASN1_NGAP_NR_ID_PDU_SESSION_RES_SETUP); + tx_pdu.set_successful_outcome().load_info_obj(ASN1_NGAP_ID_PDU_SESSION_RES_SETUP); pdu_session_res_setup_resp_s& container = tx_pdu.successful_outcome().value.pdu_session_res_setup_resp(); container.protocol_ies.amf_ue_ngap_id.value = ctxt.amf_ue_ngap_id.value(); container.protocol_ies.ran_ue_ngap_id.value = ctxt.ran_ue_ngap_id; @@ -205,8 +205,8 @@ bool ngap::ue::send_pdu_session_resource_setup_response(uint16_t gtp_tunnel.gtp_teid.from_number(teid_in); gtp_tunnel.transport_layer_address = addr_in; - asn1::ngap_nr::associated_qos_flow_list_l qos_flow_list; - asn1::ngap_nr::associated_qos_flow_item_s qos_flow_item; + asn1::ngap::associated_qos_flow_list_l qos_flow_list; + asn1::ngap::associated_qos_flow_item_s qos_flow_item; qos_flow_item.qos_flow_id = 1; qos_flow_list.push_back(qos_flow_item); resp_transfer.dlqos_flow_per_tnl_info.associated_qos_flow_list = qos_flow_list; @@ -228,7 +228,7 @@ bool ngap::ue::send_ue_ctxt_release_complete() } ngap_pdu_c tx_pdu; - tx_pdu.set_successful_outcome().load_info_obj(ASN1_NGAP_NR_ID_UE_CONTEXT_RELEASE); + tx_pdu.set_successful_outcome().load_info_obj(ASN1_NGAP_ID_UE_CONTEXT_RELEASE); ue_context_release_complete_s& container = tx_pdu.successful_outcome().value.ue_context_release_complete(); // userLocationInformationNR @@ -244,7 +244,7 @@ bool ngap::ue::send_ue_ctxt_release_complete() return ngap_ptr->sctp_send_ngap_pdu(tx_pdu, ctxt.rnti, "UEContextReleaseComplete"); } -bool ngap::ue::send_ue_context_release_request(asn1::ngap_nr::cause_c cause) +bool ngap::ue::send_ue_context_release_request(asn1::ngap::cause_c cause) { if (not ngap_ptr->amf_connected) { logger.warning("AMF not connected"); @@ -258,7 +258,7 @@ bool ngap::ue::send_ue_context_release_request(asn1::ngap_nr::cause_c cause) release_requested = true; ngap_pdu_c tx_pdu; - tx_pdu.set_init_msg().load_info_obj(ASN1_NGAP_NR_ID_UE_CONTEXT_RELEASE_REQUEST); + tx_pdu.set_init_msg().load_info_obj(ASN1_NGAP_ID_UE_CONTEXT_RELEASE_REQUEST); ue_context_release_request_s& container = tx_pdu.init_msg().value.ue_context_release_request(); container.protocol_ies.cause.value = cause; @@ -285,7 +285,7 @@ bool ngap::ue::send_ue_context_release_request(asn1::ngap_nr::cause_c cause) /* NGAP message handler ********************************************************************************/ -bool ngap::ue::handle_initial_ctxt_setup_request(const asn1::ngap_nr::init_context_setup_request_s& msg) +bool ngap::ue::handle_initial_ctxt_setup_request(const asn1::ngap::init_context_setup_request_s& msg) { if (not initial_context_setup_proc.launch(msg)) { logger.error("Failed to start Initial Context Setup Procedure"); @@ -294,7 +294,7 @@ bool ngap::ue::handle_initial_ctxt_setup_request(const asn1::ngap_nr::init_conte return true; } -bool ngap::ue::handle_ue_context_release_cmd(const asn1::ngap_nr::ue_context_release_cmd_s& msg) +bool ngap::ue::handle_ue_context_release_cmd(const asn1::ngap::ue_context_release_cmd_s& msg) { // TODO: Release UE context if (not ue_context_release_proc.launch(msg)) { @@ -304,7 +304,7 @@ bool ngap::ue::handle_ue_context_release_cmd(const asn1::ngap_nr::ue_context_rel return true; } -bool ngap::ue::handle_pdu_session_res_setup_request(const asn1::ngap_nr::pdu_session_res_setup_request_s& msg) +bool ngap::ue::handle_pdu_session_res_setup_request(const asn1::ngap::pdu_session_res_setup_request_s& msg) { if (not ue_pdu_session_res_setup_proc.launch(msg)) { logger.error("Failed to start UE PDU Session Resource Setup Procedure"); diff --git a/srsgnb/src/stack/ngap/ngap_ue_bearer_manager.cc b/srsgnb/src/stack/ngap/ngap_ue_bearer_manager.cc index 0f1c0ac4d..3ccf297ef 100644 --- a/srsgnb/src/stack/ngap/ngap_ue_bearer_manager.cc +++ b/srsgnb/src/stack/ngap/ngap_ue_bearer_manager.cc @@ -20,20 +20,20 @@ ngap_ue_bearer_manager::~ngap_ue_bearer_manager(){}; int ngap_ue_bearer_manager::add_pdu_session(uint16_t rnti, uint8_t pdu_session_id, - const asn1::ngap_nr::qos_flow_level_qos_params_s& qos, + const asn1::ngap::qos_flow_level_qos_params_s& qos, const asn1::bounded_bitstring<1, 160, true, true>& addr_out, uint32_t teid_out, uint16_t& lcid, asn1::bounded_bitstring<1, 160, true, true>& addr_in, uint32_t& teid_in, - asn1::ngap_nr::cause_c& cause) + asn1::ngap::cause_c& cause) { // Only add session if gtpu was successful pdu_session_t::gtpu_tunnel tunnel; if (addr_out.length() > 32) { logger.error("Only addresses with length <= 32 (IPv4) are supported"); - cause.set_radio_network().value = asn1::ngap_nr::cause_radio_network_opts::invalid_qos_combination; + cause.set_radio_network().value = asn1::ngap::cause_radio_network_opts::invalid_qos_combination; return SRSRAN_ERROR; } diff --git a/srsgnb/src/stack/ngap/ngap_ue_proc.cc b/srsgnb/src/stack/ngap/ngap_ue_proc.cc index 9ad9fb3d4..b385b048b 100644 --- a/srsgnb/src/stack/ngap/ngap_ue_proc.cc +++ b/srsgnb/src/stack/ngap/ngap_ue_proc.cc @@ -22,7 +22,7 @@ ngap_ue_initial_context_setup_proc::ngap_ue_initial_context_setup_proc(ngap_inte srslog::basic_logger& logger_) : logger(logger_), parent(parent_), rrc(rrc_), ue_ctxt(ue_ctxt_){}; -proc_outcome_t ngap_ue_initial_context_setup_proc::init(const asn1::ngap_nr::init_context_setup_request_s& msg) +proc_outcome_t ngap_ue_initial_context_setup_proc::init(const asn1::ngap::init_context_setup_request_s& msg) { ue_ctxt->amf_pointer = msg.protocol_ies.guami.value.amf_pointer.to_number(); ue_ctxt->amf_set_id = msg.protocol_ies.guami.value.amf_set_id.to_number(); @@ -78,7 +78,7 @@ ngap_ue_ue_context_release_proc::ngap_ue_ue_context_release_proc(ngap_interface_ bearer_manager = bearer_manager_; }; -proc_outcome_t ngap_ue_ue_context_release_proc::init(const asn1::ngap_nr::ue_context_release_cmd_s& msg) +proc_outcome_t ngap_ue_ue_context_release_proc::init(const asn1::ngap::ue_context_release_cmd_s& msg) { logger.info("Started %s", name()); bearer_manager->reset_pdu_sessions(ue_ctxt->rnti); @@ -100,20 +100,19 @@ ngap_ue_pdu_session_res_setup_proc::ngap_ue_pdu_session_res_setup_proc(ngap_inte parent(parent_), rrc(rrc_), ue_ctxt(ue_ctxt_), bearer_manager(bearer_manager_), logger(logger_) {} -proc_outcome_t ngap_ue_pdu_session_res_setup_proc::init(const asn1::ngap_nr::pdu_session_res_setup_request_s& msg) +proc_outcome_t ngap_ue_pdu_session_res_setup_proc::init(const asn1::ngap::pdu_session_res_setup_request_s& msg) { if (msg.protocol_ies.pdu_session_res_setup_list_su_req.value.size() != 1) { logger.error("Not handling zero or multiple su requests"); return proc_outcome_t::error; } - asn1::ngap_nr::pdu_session_res_setup_item_su_req_s su_req = - msg.protocol_ies.pdu_session_res_setup_list_su_req.value[0]; + asn1::ngap::pdu_session_res_setup_item_su_req_s su_req = msg.protocol_ies.pdu_session_res_setup_list_su_req.value[0]; asn1::cbit_ref pdu_session_bref(su_req.pdu_session_res_setup_request_transfer.data(), su_req.pdu_session_res_setup_request_transfer.size()); - asn1::ngap_nr::pdu_session_res_setup_request_transfer_s pdu_ses_res_setup_req_trans; + asn1::ngap::pdu_session_res_setup_request_transfer_s pdu_ses_res_setup_req_trans; if (pdu_ses_res_setup_req_trans.unpack(pdu_session_bref) != SRSRAN_SUCCESS) { logger.error("Unable to unpack PDU session response setup request"); @@ -126,11 +125,11 @@ proc_outcome_t ngap_ue_pdu_session_res_setup_proc::init(const asn1::ngap_nr::pdu } if (pdu_ses_res_setup_req_trans.protocol_ies.ul_ngu_up_tnl_info.value.type() != - asn1::ngap_nr::up_transport_layer_info_c::types::gtp_tunnel) { + asn1::ngap::up_transport_layer_info_c::types::gtp_tunnel) { logger.error("Expected GTP Tunnel"); return proc_outcome_t::error; } - asn1::ngap_nr::qos_flow_setup_request_item_s qos_flow_setup = + asn1::ngap::qos_flow_setup_request_item_s qos_flow_setup = pdu_ses_res_setup_req_trans.protocol_ies.qos_flow_setup_request_list.value[0]; srsran::const_span nas_pdu_dummy; uint32_t teid_out = 0; @@ -141,7 +140,7 @@ proc_outcome_t ngap_ue_pdu_session_res_setup_proc::init(const asn1::ngap_nr::pdu teid_out |= pdu_ses_res_setup_req_trans.protocol_ies.ul_ngu_up_tnl_info.value.gtp_tunnel().gtp_teid[3]; // TODO: Check cause - asn1::ngap_nr::cause_c cause; + asn1::ngap::cause_c cause; uint32_t teid_in = {}; uint16_t lcid = {}; asn1::bounded_bitstring<1, 160, true, true> addr_in; diff --git a/srsgnb/src/stack/ngap/test/ngap_test.cc b/srsgnb/src/stack/ngap/test/ngap_test.cc index 6e637d7b8..321fc1b3e 100644 --- a/srsgnb/src/stack/ngap/test/ngap_test.cc +++ b/srsgnb/src/stack/ngap/test/ngap_test.cc @@ -74,17 +74,17 @@ public: rrc_logger.info(sec_key, 32, "Security key"); return SRSRAN_SUCCESS; } - int ue_set_bitrates(uint16_t rnti, const asn1::ngap_nr::ue_aggregate_maximum_bit_rate_s& rates) + int ue_set_bitrates(uint16_t rnti, const asn1::ngap::ue_aggregate_maximum_bit_rate_s& rates) { rrc_logger.info("Setting aggregate max bitrate. RNTI 0x%x", rnti); return SRSRAN_SUCCESS; } - int set_aggregate_max_bitrate(uint16_t rnti, const asn1::ngap_nr::ue_aggregate_maximum_bit_rate_s& rates) + int set_aggregate_max_bitrate(uint16_t rnti, const asn1::ngap::ue_aggregate_maximum_bit_rate_s& rates) { rrc_logger.info("Setting aggregate max bitrate"); return SRSRAN_SUCCESS; } - int ue_set_security_cfg_capabilities(uint16_t rnti, const asn1::ngap_nr::ue_security_cap_s& caps) + int ue_set_security_cfg_capabilities(uint16_t rnti, const asn1::ngap::ue_security_cap_s& caps) { rrc_logger.info("Setting security capabilities"); for (uint8_t i = 0; i < 8; i++) { @@ -119,10 +119,10 @@ public: int allocate_lcid(uint16_t rnti) { return SRSRAN_SUCCESS; } void write_dl_info(uint16_t rnti, srsran::unique_byte_buffer_t sdu) {} - bool sec_mod_proc_started = false; - uint8_t sec_key[32] = {}; - asn1::ngap_nr::ue_security_cap_s sec_caps = {}; - srslog::basic_logger& rrc_logger; + bool sec_mod_proc_started = false; + uint8_t sec_key[32] = {}; + asn1::ngap::ue_security_cap_s sec_caps = {}; + srslog::basic_logger& rrc_logger; }; struct dummy_socket_manager : public srsran::socket_manager_itf { dummy_socket_manager() : srsran::socket_manager_itf(srslog::fetch_basic_logger("TEST")) {} @@ -154,15 +154,15 @@ struct dummy_socket_manager : public srsran::socket_manager_itf { void run_ng_setup(ngap& ngap_obj, amf_dummy& amf) { - asn1::ngap_nr::ngap_pdu_c ngap_pdu; + asn1::ngap::ngap_pdu_c ngap_pdu; // gNB -> AMF: NG Setup Request srsran::unique_byte_buffer_t sdu = amf.read_msg(); TESTASSERT(sdu->N_bytes > 0); asn1::cbit_ref cbref(sdu->msg, sdu->N_bytes); TESTASSERT(ngap_pdu.unpack(cbref) == asn1::SRSASN_SUCCESS); - TESTASSERT(ngap_pdu.type().value == asn1::ngap_nr::ngap_pdu_c::types_opts::init_msg); - TESTASSERT(ngap_pdu.init_msg().proc_code == ASN1_NGAP_NR_ID_NG_SETUP); + TESTASSERT(ngap_pdu.type().value == asn1::ngap::ngap_pdu_c::types_opts::init_msg); + TESTASSERT(ngap_pdu.init_msg().proc_code == ASN1_NGAP_ID_NG_SETUP); // AMF -> gNB: ng Setup Response sockaddr_in amf_addr = {}; @@ -191,24 +191,24 @@ void run_ng_initial_ue(ngap& ngap_obj, amf_dummy& amf, rrc_nr_dummy& rrc) nas_pdu->N_bytes = sizeof(nas_reg_req); uint32_t rnti = 0xf0f0; - ngap_obj.initial_ue(rnti, 0, asn1::ngap_nr::rrcestablishment_cause_opts::mo_sig, srsran::make_span(nas_pdu)); + ngap_obj.initial_ue(rnti, 0, asn1::ngap::rrcestablishment_cause_opts::mo_sig, srsran::make_span(nas_pdu)); // gNB -> AMF: Inital UE message - asn1::ngap_nr::ngap_pdu_c ngap_initial_ue_pdu; + asn1::ngap::ngap_pdu_c ngap_initial_ue_pdu; srsran::unique_byte_buffer_t sdu = amf.read_msg(); TESTASSERT(sdu->N_bytes > 0); asn1::cbit_ref cbref(sdu->msg, sdu->N_bytes); TESTASSERT_EQ(ngap_initial_ue_pdu.unpack(cbref), asn1::SRSASN_SUCCESS); - TESTASSERT_EQ(ngap_initial_ue_pdu.type().value, asn1::ngap_nr::ngap_pdu_c::types_opts::init_msg); - TESTASSERT_EQ(ngap_initial_ue_pdu.init_msg().proc_code, ASN1_NGAP_NR_ID_INIT_UE_MSG); + TESTASSERT_EQ(ngap_initial_ue_pdu.type().value, asn1::ngap::ngap_pdu_c::types_opts::init_msg); + TESTASSERT_EQ(ngap_initial_ue_pdu.init_msg().proc_code, ASN1_NGAP_ID_INIT_UE_MSG); // AMF -> gNB: Initial Context Setup Request sockaddr_in amf_addr = {}; sctp_sndrcvinfo rcvinfo = {}; int flags = 0; - asn1::ngap_nr::ngap_pdu_c ngap_initial_ctx_req_pdu; - ngap_initial_ctx_req_pdu.set_init_msg().load_info_obj(ASN1_NGAP_NR_ID_INIT_CONTEXT_SETUP); + asn1::ngap::ngap_pdu_c ngap_initial_ctx_req_pdu; + ngap_initial_ctx_req_pdu.set_init_msg().load_info_obj(ASN1_NGAP_ID_INIT_CONTEXT_SETUP); auto& container = ngap_initial_ctx_req_pdu.init_msg().value.init_context_setup_request().protocol_ies; container.amf_ue_ngap_id.value = 0x1; diff --git a/srsgnb/src/stack/rrc/rrc_nr.cc b/srsgnb/src/stack/rrc/rrc_nr.cc index d365fcbda..1b3df68f6 100644 --- a/srsgnb/src/stack/rrc/rrc_nr.cc +++ b/srsgnb/src/stack/rrc/rrc_nr.cc @@ -579,15 +579,15 @@ int rrc_nr::ue_set_security_cfg_key(uint16_t rnti, const asn1::fixed_bitstring<2 u.set_security_key(key); return SRSRAN_SUCCESS; } -int rrc_nr::ue_set_bitrates(uint16_t rnti, const asn1::ngap_nr::ue_aggregate_maximum_bit_rate_s& rates) +int rrc_nr::ue_set_bitrates(uint16_t rnti, const asn1::ngap::ue_aggregate_maximum_bit_rate_s& rates) { return SRSRAN_SUCCESS; } -int rrc_nr::set_aggregate_max_bitrate(uint16_t rnti, const asn1::ngap_nr::ue_aggregate_maximum_bit_rate_s& rates) +int rrc_nr::set_aggregate_max_bitrate(uint16_t rnti, const asn1::ngap::ue_aggregate_maximum_bit_rate_s& rates) { return SRSRAN_SUCCESS; } -int rrc_nr::ue_set_security_cfg_capabilities(uint16_t rnti, const asn1::ngap_nr::ue_security_cap_s& caps) +int rrc_nr::ue_set_security_cfg_capabilities(uint16_t rnti, const asn1::ngap::ue_security_cap_s& caps) { logger.debug("Setting securtiy capabilites for rnti=0x%x", rnti); auto ue_it = users.find(rnti); diff --git a/srsgnb/src/stack/rrc/rrc_nr_security_context.cc b/srsgnb/src/stack/rrc/rrc_nr_security_context.cc index b6f84e20a..e4b1c0144 100644 --- a/srsgnb/src/stack/rrc/rrc_nr_security_context.cc +++ b/srsgnb/src/stack/rrc/rrc_nr_security_context.cc @@ -26,7 +26,7 @@ asn1::rrc_nr::security_algorithm_cfg_s nr_security_context::get_security_algorit return ret; } -bool nr_security_context::set_security_capabilities(const asn1::ngap_nr::ue_security_cap_s& caps) +bool nr_security_context::set_security_capabilities(const asn1::ngap::ue_security_cap_s& caps) { security_capabilities = caps; diff --git a/srsgnb/src/stack/rrc/rrc_nr_ue.cc b/srsgnb/src/stack/rrc/rrc_nr_ue.cc index 3790cf8a3..5194867a1 100644 --- a/srsgnb/src/stack/rrc/rrc_nr_ue.cc +++ b/srsgnb/src/stack/rrc/rrc_nr_ue.cc @@ -97,7 +97,7 @@ void rrc_nr::ue::activity_timer_expired(const activity_timeout_type_t type) state = rrc_nr_state_t::RRC_INACTIVE; if (parent->cfg.is_standalone) { // Start NGAP Release UE context - parent->ngap->user_release_request(rnti, asn1::ngap_nr::cause_radio_network_opts::user_inactivity); + parent->ngap->user_release_request(rnti, asn1::ngap::cause_radio_network_opts::user_inactivity); } else { parent->rrc_eutra->sgnb_inactivity_timeout(eutra_rnti); } @@ -981,7 +981,7 @@ void rrc_nr::ue::handle_rrc_setup_complete(const asn1::rrc_nr::rrc_setup_complet cell_group_cfg = next_cell_group_cfg; // Create UE context in NGAP - using ngap_cause_t = asn1::ngap_nr::rrcestablishment_cause_opts::options; + using ngap_cause_t = asn1::ngap::rrcestablishment_cause_opts::options; auto ngap_cause = (ngap_cause_t)ctxt.connection_cause.value; // NGAP and RRC causes seem to have a 1-1 mapping parent->ngap->initial_ue( rnti, uecfg.carriers[0].cc, ngap_cause, msg.crit_exts.rrc_setup_complete().ded_nas_msg, ctxt.setup_ue_id); @@ -1017,7 +1017,7 @@ void rrc_nr::ue::send_security_mode_command(srsran::unique_byte_buffer_t nas_pdu ies.security_cfg_smc.security_algorithm_cfg = sec_ctx.get_security_algorithm_cfg(); if (send_dl_dcch(srsran::nr_srb::srb1, dl_dcch_msg) != SRSRAN_SUCCESS) { - parent->ngap->user_release_request(rnti, asn1::ngap_nr::cause_radio_network_opts::radio_res_not_available); + parent->ngap->user_release_request(rnti, asn1::ngap::cause_radio_network_opts::radio_res_not_available); } } @@ -1061,7 +1061,7 @@ void rrc_nr::ue::send_rrc_reconfiguration() // Pack masterCellGroup into container srsran::unique_byte_buffer_t pdu = parent->pack_into_pdu(master_cell_group, __FUNCTION__); if (pdu == nullptr) { - parent->ngap->user_release_request(rnti, asn1::ngap_nr::cause_radio_network_opts::radio_res_not_available); + parent->ngap->user_release_request(rnti, asn1::ngap::cause_radio_network_opts::radio_res_not_available); return; } ies.non_crit_ext.master_cell_group.resize(pdu->N_bytes); @@ -1097,7 +1097,7 @@ void rrc_nr::ue::send_rrc_reconfiguration() ies.non_crit_ext_present = ies.non_crit_ext.master_cell_group_present or ies.non_crit_ext.ded_nas_msg_list_present; if (send_dl_dcch(srsran::nr_srb::srb1, dl_dcch_msg) != SRSRAN_SUCCESS) { - parent->ngap->user_release_request(rnti, asn1::ngap_nr::cause_radio_network_opts::radio_res_not_available); + parent->ngap->user_release_request(rnti, asn1::ngap::cause_radio_network_opts::radio_res_not_available); } } @@ -1140,7 +1140,7 @@ void rrc_nr::ue::send_dl_information_transfer(srsran::unique_byte_buffer_t sdu) memcpy(ies.ded_nas_msg.data(), sdu->data(), ies.ded_nas_msg.size()); if (send_dl_dcch(srsran::nr_srb::srb1, dl_dcch_msg) != SRSRAN_SUCCESS) { - parent->ngap->user_release_request(rnti, asn1::ngap_nr::cause_radio_network_opts::radio_res_not_available); + parent->ngap->user_release_request(rnti, asn1::ngap::cause_radio_network_opts::radio_res_not_available); } } diff --git a/srsgnb/src/stack/rrc/test/rrc_nr_test_helpers.h b/srsgnb/src/stack/rrc/test/rrc_nr_test_helpers.h index 3d83f7b23..e1032ac09 100644 --- a/srsgnb/src/stack/rrc/test/rrc_nr_test_helpers.h +++ b/srsgnb/src/stack/rrc/test/rrc_nr_test_helpers.h @@ -52,11 +52,11 @@ public: class ngap_rrc_tester : public ngap_dummy { public: - void initial_ue(uint16_t rnti, - uint32_t gnb_cc_idx, - asn1::ngap_nr::rrcestablishment_cause_e cause, - srsran::const_byte_span pdu, - uint32_t s_tmsi) + void initial_ue(uint16_t rnti, + uint32_t gnb_cc_idx, + asn1::ngap::rrcestablishment_cause_e cause, + srsran::const_byte_span pdu, + uint32_t s_tmsi) { last_sdu_rnti = rnti; last_pdu.resize(pdu.size()); From a7255cfac679b1f8f8b4f3e3c39e3e73f527714f Mon Sep 17 00:00:00 2001 From: Carlo Galiotto Date: Thu, 9 Dec 2021 15:51:51 +0100 Subject: [PATCH 03/15] sched: add fnc to map CQI to MCS Signed-off-by: Carlo Galiotto --- lib/include/srsran/common/phy_cfg_nr.h | 2 + lib/include/srsran/phy/phch/ra_nr.h | 6 +++ lib/src/common/phy_cfg_nr.cc | 5 ++ lib/src/phy/phch/ra_nr.c | 71 ++++++++++++++++++++++++++ 4 files changed, 84 insertions(+) diff --git a/lib/include/srsran/common/phy_cfg_nr.h b/lib/include/srsran/common/phy_cfg_nr.h index d555b2e69..5f938c4fd 100644 --- a/lib/include/srsran/common/phy_cfg_nr.h +++ b/lib/include/srsran/common/phy_cfg_nr.h @@ -160,6 +160,8 @@ struct phy_cfg_nr_t { * @return valid SSB configuration */ srsran_ssb_cfg_t get_ssb_cfg() const; + + srsran_mcs_table_t get_mcs_table() const; }; } // namespace srsran diff --git a/lib/include/srsran/phy/phch/ra_nr.h b/lib/include/srsran/phy/phch/ra_nr.h index 4944a42e3..a15973488 100644 --- a/lib/include/srsran/phy/phch/ra_nr.h +++ b/lib/include/srsran/phy/phch/ra_nr.h @@ -150,4 +150,10 @@ SRSRAN_API int srsran_ra_ul_set_grant_uci_nr(const srsran_carrier_nr_t* carri */ SRSRAN_API uint32_t srsran_ra_nr_type1_riv(uint32_t N_rb, uint32_t start_rb, uint32_t length_rb); +SRSRAN_API int srsran_ra_nr_cqi_to_mcs(uint8_t cqi, + srsran_csi_cqi_table_t cqi_table_idx, + srsran_mcs_table_t mcs_table, + srsran_dci_format_nr_t dci_format, + srsran_search_space_type_t search_space_type, + srsran_rnti_type_t rnti_type); #endif // SRSRAN_RA_NR_H diff --git a/lib/src/common/phy_cfg_nr.cc b/lib/src/common/phy_cfg_nr.cc index 98433d21f..335b10778 100644 --- a/lib/src/common/phy_cfg_nr.cc +++ b/lib/src/common/phy_cfg_nr.cc @@ -367,4 +367,9 @@ srsran_ssb_cfg_t phy_cfg_nr_t::get_ssb_cfg() const return ssb_cfg; } +srsran_mcs_table_t phy_cfg_nr_t::get_mcs_table() const +{ + return pdsch.mcs_table; +} + } // namespace srsran diff --git a/lib/src/phy/phch/ra_nr.c b/lib/src/phy/phch/ra_nr.c index a94f65949..aab583d03 100644 --- a/lib/src/phy/phch/ra_nr.c +++ b/lib/src/phy/phch/ra_nr.c @@ -30,6 +30,7 @@ typedef struct { #define RA_NR_MCS_SIZE_TABLE2 28 #define RA_NR_MCS_SIZE_TABLE3 29 #define RA_NR_TBS_SIZE_TABLE 93 +#define RA_NR_CQI_SIZE_TABLE 16 #define RA_NR_BETA_OFFSET_HARQACK_SIZE 32 #define RA_NR_BETA_OFFSET_CSI_SIZE 32 @@ -133,6 +134,46 @@ static const float ra_nr_beta_offset_csi_table[RA_NR_BETA_OFFSET_CSI_SIZE] = { typedef enum { ra_nr_table_1 = 0, ra_nr_table_2, ra_nr_table_3 } ra_nr_table_t; +/** + * These tables map the CQI into the MCS, based on the spectral efficiency. + * The mapping works as follows: + * - select spectral efficiency from the CQI from tables Table 5.2.2.1-2, Table 5.2.2.1-3, Table 5.2.2.1-4, + * TS 38.214 V15.14.0 + * - select MCS corresponding to same spectral efficiency from Table 5.1.3.1-1, Table 5.1.3.1-2, Table 5.1.3.1-3, + * TS 38.214 V15.14.0 + * The indices C_M (e.g, 1_1, 1_3, 3_2, etc.) refer to the CQI and MCS table, respectively. + * C = 1 -> Table 5.2.2.1-2; C = 2 -> Table 5.2.2.1-3, C = 2 -> Table 5.2.2.1-4 + * M = 1 -> Table 5.1.3.1-1; M = 2 -> Table 5.1.3.1-2; M = 3 -> Table 5.1.3.1-3 + */ + +#if 0 +typedef const int nr_cqi_to_mcs_table[RA_NR_CQI_SIZE_TABLE]; + +static nr_cqi_to_mcs_table ra_nr_cqi_to_mcs_table_1_1 = {-1, 0, 0, 2, 4, 6, 8, 11, 13, 15, 18, 20, 22, 24, 26, 28}; +static nr_cqi_to_mcs_table ra_nr_cqi_to_mcs_table_2_1 = {-1, 0, 2, 6, 11, 13, 15, 18, 20, 22, 24, 26, 28, 28, 28, 28}; +static nr_cqi_to_mcs_table ra_nr_cqi_to_mcs_table_3_1 = {-1, 0, 0, 0, 0, 2, 4, 6, 8, 11, 13, 15, 18, 20, 22, 24}; +static nr_cqi_to_mcs_table ra_nr_cqi_to_mcs_table_1_2 = {-1, 0, 0, 1, 2, 3, 4, 5, 7, 9, 11, 13, 15, 17, 19, 21}; +static nr_cqi_to_mcs_table ra_nr_cqi_to_mcs_table_2_2 = {-1, 0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27}; +static nr_cqi_to_mcs_table ra_nr_cqi_to_mcs_table_3_2 = {-1, 0, 0, 0, 0, 1, 2, 3, 4, 5, 7, 9, 11, 13, 15, 17}; +static nr_cqi_to_mcs_table ra_nr_cqi_to_mcs_table_1_3 = {-1, 4, 8, 12, 16, 18, 20, 22, 24, 26, 28, 28, 28, 28, 28, 28}; +static nr_cqi_to_mcs_table ra_nr_cqi_to_mcs_table_2_3 = {-1, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28}; +static nr_cqi_to_mcs_table ra_nr_cqi_to_mcs_table_3_3 = {-1, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28}; +#endif + +static int ra_nr_cqi_to_mcs_table[3][3][RA_NR_CQI_SIZE_TABLE] = { + /* ROW 1 - CQI Table 1 */ + {/* MCS Table 1 */ {-1, 0, 0, 2, 4, 6, 8, 11, 13, 15, 18, 20, 22, 24, 26, 28}, + /* MCS Table 2 */ {-1, 0, 0, 1, 2, 3, 4, 5, 7, 9, 11, 13, 15, 17, 19, 21}, + /* MCS Table 3 */ {-1, 4, 8, 12, 16, 18, 20, 22, 24, 26, 28, 28, 28, 28, 28, 28}}, + /* ROW 2 - CQI Table 2 */ + {/* MCS Table 1 */ {-1, 0, 2, 6, 11, 13, 15, 18, 20, 22, 24, 26, 28, 28, 28, 28}, + /* MCS Table 2 */ {-1, 0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27}, + /* MCS Table 3 */ {-1, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28}}, + /* ROW 1 - CQI Table 3 */ + {/* MCS Table 1 */ {-1, 0, 0, 0, 0, 2, 4, 6, 8, 11, 13, 15, 18, 20, 22, 24}, + /* MCS Table 2 */ {-1, 0, 0, 0, 0, 1, 2, 3, 4, 5, 7, 9, 11, 13, 15, 17}, + /* MCS Table 3 */ {-1, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28}}}; + static ra_nr_table_t ra_nr_select_table_pusch_noprecoding(srsran_mcs_table_t mcs_table, srsran_dci_format_nr_t dci_format, srsran_search_space_type_t search_space_type, @@ -1084,3 +1125,33 @@ int srsran_ra_ul_set_grant_uci_nr(const srsran_carrier_nr_t* carrier, return SRSRAN_SUCCESS; } + +int srsran_ra_nr_cqi_to_mcs(uint8_t cqi, + srsran_csi_cqi_table_t cqi_table_idx, + srsran_mcs_table_t mcs_table, + srsran_dci_format_nr_t dci_format, + srsran_search_space_type_t search_space_type, + srsran_rnti_type_t rnti_type) +{ + if (cqi >= RA_NR_CQI_SIZE_TABLE) { + ERROR("Invalid CQI (%u)", cqi); + return -1; + } + + typedef enum { table_1 = 0, table_2, table_3, table_N } mcs_table_t; + + // The following logic to select the MCS table is the same as in the function ra_nr_select_table_pdsch() in this same + // file + mcs_table_t mcs_table_idx; + if (mcs_table == srsran_mcs_table_256qam && dci_format == srsran_dci_format_nr_1_1 && + rnti_type == srsran_rnti_type_c) { + mcs_table_idx = table_2; + } else if (mcs_table == srsran_mcs_table_qam64LowSE && search_space_type == srsran_search_space_type_ue && + rnti_type == srsran_rnti_type_c) { + mcs_table_idx = table_3; + } else { + mcs_table_idx = table_1; + } + + return ra_nr_cqi_to_mcs_table[cqi_table_idx][mcs_table_idx][cqi]; +} From 3a7739fba5c55a71fdf85aa41d64b31776045d55 Mon Sep 17 00:00:00 2001 From: Carlo Galiotto Date: Thu, 9 Dec 2021 15:52:42 +0100 Subject: [PATCH 04/15] sched: add CQI->MCS mapping to PDSCH allocator Signed-off-by: Carlo Galiotto --- srsgnb/src/stack/mac/sched_nr_grant_allocator.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/srsgnb/src/stack/mac/sched_nr_grant_allocator.cc b/srsgnb/src/stack/mac/sched_nr_grant_allocator.cc index 0bea82f28..ea2e75e5a 100644 --- a/srsgnb/src/stack/mac/sched_nr_grant_allocator.cc +++ b/srsgnb/src/stack/mac/sched_nr_grant_allocator.cc @@ -326,8 +326,20 @@ alloc_result bwp_slot_allocator::alloc_pdsch(slot_ue& ue, uint32_t ss_id, const // Allocate PDSCH pdsch_t& pdsch = bwp_pdcch_slot.pdschs.alloc_ue_pdsch_unchecked(ss_id, dci_fmt, dl_grant, ue.cfg(), pdcch.dci); + // Initialize MCS based on CQI + int mcs = srsran_ra_nr_cqi_to_mcs(/* cqi */ 10, + /* cqi_table_idx */ SRSRAN_CSI_CQI_TABLE_1, + /* mcs_table */ ue->phy().get_mcs_table(), + /* dci_format */ pdcch->dci.ctx.format, + /* search_space_type*/ ss.type, + /* rnti_type */ rnti_type); + + // This is only to handle the case that the MCS return is -1. It should not happen unless CQI is 0 ir invalid + if (mcs == -1) { + mcs = ue->fixed_pdsch_mcs(); + } + // Allocate HARQ - int mcs = ue->fixed_pdsch_mcs(); if (ue.h_dl->empty()) { bool success = ue.h_dl->new_tx(ue.pdsch_slot, ue.uci_slot, dl_grant, mcs, 4, pdcch.dci); srsran_assert(success, "Failed to allocate DL HARQ"); From db983175a8f5a10e1eb7b08e158ad1900ac2da0d Mon Sep 17 00:00:00 2001 From: Carlo Galiotto Date: Thu, 9 Dec 2021 18:38:29 +0100 Subject: [PATCH 05/15] sched: remove CQI->MCS mapping from PDSCH allocator Signed-off-by: Carlo Galiotto --- srsgnb/src/stack/mac/sched_nr_grant_allocator.cc | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/srsgnb/src/stack/mac/sched_nr_grant_allocator.cc b/srsgnb/src/stack/mac/sched_nr_grant_allocator.cc index ea2e75e5a..0bea82f28 100644 --- a/srsgnb/src/stack/mac/sched_nr_grant_allocator.cc +++ b/srsgnb/src/stack/mac/sched_nr_grant_allocator.cc @@ -326,20 +326,8 @@ alloc_result bwp_slot_allocator::alloc_pdsch(slot_ue& ue, uint32_t ss_id, const // Allocate PDSCH pdsch_t& pdsch = bwp_pdcch_slot.pdschs.alloc_ue_pdsch_unchecked(ss_id, dci_fmt, dl_grant, ue.cfg(), pdcch.dci); - // Initialize MCS based on CQI - int mcs = srsran_ra_nr_cqi_to_mcs(/* cqi */ 10, - /* cqi_table_idx */ SRSRAN_CSI_CQI_TABLE_1, - /* mcs_table */ ue->phy().get_mcs_table(), - /* dci_format */ pdcch->dci.ctx.format, - /* search_space_type*/ ss.type, - /* rnti_type */ rnti_type); - - // This is only to handle the case that the MCS return is -1. It should not happen unless CQI is 0 ir invalid - if (mcs == -1) { - mcs = ue->fixed_pdsch_mcs(); - } - // Allocate HARQ + int mcs = ue->fixed_pdsch_mcs(); if (ue.h_dl->empty()) { bool success = ue.h_dl->new_tx(ue.pdsch_slot, ue.uci_slot, dl_grant, mcs, 4, pdcch.dci); srsran_assert(success, "Failed to allocate DL HARQ"); From cd32f1385abd0e64333f4cc746b8ed6b7b7441b1 Mon Sep 17 00:00:00 2001 From: Carlo Galiotto Date: Fri, 10 Dec 2021 11:02:16 +0100 Subject: [PATCH 06/15] sched,test: add test for CQI->MCS mapping fnc Signed-off-by: Carlo Galiotto --- lib/include/srsran/phy/phch/ra_nr.h | 12 + lib/src/phy/phch/ra_nr.c | 34 +-- srsgnb/src/stack/mac/test/CMakeLists.txt | 4 + .../mac/test/sched_nr_utilities_tests.cc | 220 ++++++++++++++++++ 4 files changed, 247 insertions(+), 23 deletions(-) create mode 100644 srsgnb/src/stack/mac/test/sched_nr_utilities_tests.cc diff --git a/lib/include/srsran/phy/phch/ra_nr.h b/lib/include/srsran/phy/phch/ra_nr.h index a15973488..155e6b7d2 100644 --- a/lib/include/srsran/phy/phch/ra_nr.h +++ b/lib/include/srsran/phy/phch/ra_nr.h @@ -150,6 +150,18 @@ SRSRAN_API int srsran_ra_ul_set_grant_uci_nr(const srsran_carrier_nr_t* carri */ SRSRAN_API uint32_t srsran_ra_nr_type1_riv(uint32_t N_rb, uint32_t start_rb, uint32_t length_rb); +/** + * @brief Returns the MCS corresponding to CQI + * + * Mapping is performed as: return the MCS that has the closest spectral efficiency to that of the CQI + * @param cqi CQI value + * @param srsran_csi_cqi_table_t CQI table index + * @param mcs_table MCS table parameter + * @param dci_format DCI format + * @param search_space_type Seach Space type + * @param rnti_type RNTI type + * @return The MCS index + */ SRSRAN_API int srsran_ra_nr_cqi_to_mcs(uint8_t cqi, srsran_csi_cqi_table_t cqi_table_idx, srsran_mcs_table_t mcs_table, diff --git a/lib/src/phy/phch/ra_nr.c b/lib/src/phy/phch/ra_nr.c index aab583d03..81a9f3c66 100644 --- a/lib/src/phy/phch/ra_nr.c +++ b/lib/src/phy/phch/ra_nr.c @@ -135,41 +135,29 @@ static const float ra_nr_beta_offset_csi_table[RA_NR_BETA_OFFSET_CSI_SIZE] = { typedef enum { ra_nr_table_1 = 0, ra_nr_table_2, ra_nr_table_3 } ra_nr_table_t; /** - * These tables map the CQI into the MCS, based on the spectral efficiency. + * The table below performs the mapping of the CQI into the closest MCS, based on the corresponding spectral efficiency. * The mapping works as follows: - * - select spectral efficiency from the CQI from tables Table 5.2.2.1-2, Table 5.2.2.1-3, Table 5.2.2.1-4, + * - select spectral efficiency from the CQI from tables Table 5.2.2.1-2, Table 5.2.2.1-3, or Table 5.2.2.1-4, * TS 38.214 V15.14.0 - * - select MCS corresponding to same spectral efficiency from Table 5.1.3.1-1, Table 5.1.3.1-2, Table 5.1.3.1-3, + * - select MCS corresponding to same spectral efficiency from Table 5.1.3.1-1, Table 5.1.3.1-2, or Table 5.1.3.1-3, * TS 38.214 V15.14.0 - * The indices C_M (e.g, 1_1, 1_3, 3_2, etc.) refer to the CQI and MCS table, respectively. - * C = 1 -> Table 5.2.2.1-2; C = 2 -> Table 5.2.2.1-3, C = 2 -> Table 5.2.2.1-4 - * M = 1 -> Table 5.1.3.1-1; M = 2 -> Table 5.1.3.1-2; M = 3 -> Table 5.1.3.1-3 + * + * The array ra_nr_cqi_to_mcs_table[CQI_table_idx][MCS_table_idx][CQI] contains the MCS corresponding to CQI, based on + * the given CQI_table_idx and MCS_table_idx tables + * CQI_table_idx: 1 -> Table 5.2.2.1-2; 2 -> Table 5.2.2.1-3, 3 -> Table 5.2.2.1-4 + * CQI_table_idx: 1 -> Table 5.1.3.1-1; 2 -> Table 5.1.3.1-2; 3 -> Table 5.1.3.1-3 */ -#if 0 -typedef const int nr_cqi_to_mcs_table[RA_NR_CQI_SIZE_TABLE]; - -static nr_cqi_to_mcs_table ra_nr_cqi_to_mcs_table_1_1 = {-1, 0, 0, 2, 4, 6, 8, 11, 13, 15, 18, 20, 22, 24, 26, 28}; -static nr_cqi_to_mcs_table ra_nr_cqi_to_mcs_table_2_1 = {-1, 0, 2, 6, 11, 13, 15, 18, 20, 22, 24, 26, 28, 28, 28, 28}; -static nr_cqi_to_mcs_table ra_nr_cqi_to_mcs_table_3_1 = {-1, 0, 0, 0, 0, 2, 4, 6, 8, 11, 13, 15, 18, 20, 22, 24}; -static nr_cqi_to_mcs_table ra_nr_cqi_to_mcs_table_1_2 = {-1, 0, 0, 1, 2, 3, 4, 5, 7, 9, 11, 13, 15, 17, 19, 21}; -static nr_cqi_to_mcs_table ra_nr_cqi_to_mcs_table_2_2 = {-1, 0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27}; -static nr_cqi_to_mcs_table ra_nr_cqi_to_mcs_table_3_2 = {-1, 0, 0, 0, 0, 1, 2, 3, 4, 5, 7, 9, 11, 13, 15, 17}; -static nr_cqi_to_mcs_table ra_nr_cqi_to_mcs_table_1_3 = {-1, 4, 8, 12, 16, 18, 20, 22, 24, 26, 28, 28, 28, 28, 28, 28}; -static nr_cqi_to_mcs_table ra_nr_cqi_to_mcs_table_2_3 = {-1, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28}; -static nr_cqi_to_mcs_table ra_nr_cqi_to_mcs_table_3_3 = {-1, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28}; -#endif - static int ra_nr_cqi_to_mcs_table[3][3][RA_NR_CQI_SIZE_TABLE] = { /* ROW 1 - CQI Table 1 */ {/* MCS Table 1 */ {-1, 0, 0, 2, 4, 6, 8, 11, 13, 15, 18, 20, 22, 24, 26, 28}, /* MCS Table 2 */ {-1, 0, 0, 1, 2, 3, 4, 5, 7, 9, 11, 13, 15, 17, 19, 21}, - /* MCS Table 3 */ {-1, 4, 8, 12, 16, 18, 20, 22, 24, 26, 28, 28, 28, 28, 28, 28}}, + /* MCS Table 3 */ {-1, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 28, 28}}, /* ROW 2 - CQI Table 2 */ {/* MCS Table 1 */ {-1, 0, 2, 6, 11, 13, 15, 18, 20, 22, 24, 26, 28, 28, 28, 28}, /* MCS Table 2 */ {-1, 0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27}, - /* MCS Table 3 */ {-1, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28}}, - /* ROW 1 - CQI Table 3 */ + /* MCS Table 3 */ {-1, 4, 8, 12, 16, 18, 20, 22, 24, 26, 28, 28, 28, 28, 28, 28}}, + /* ROW 3 - CQI Table 3 */ {/* MCS Table 1 */ {-1, 0, 0, 0, 0, 2, 4, 6, 8, 11, 13, 15, 18, 20, 22, 24}, /* MCS Table 2 */ {-1, 0, 0, 0, 0, 1, 2, 3, 4, 5, 7, 9, 11, 13, 15, 17}, /* MCS Table 3 */ {-1, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28}}}; diff --git a/srsgnb/src/stack/mac/test/CMakeLists.txt b/srsgnb/src/stack/mac/test/CMakeLists.txt index 782c0879b..042c8f2b0 100644 --- a/srsgnb/src/stack/mac/test/CMakeLists.txt +++ b/srsgnb/src/stack/mac/test/CMakeLists.txt @@ -40,6 +40,10 @@ add_executable(sched_nr_rar_test sched_nr_rar_test.cc) target_link_libraries(sched_nr_rar_test srsgnb_mac sched_nr_test_suite srsran_common) add_nr_test(sched_nr_rar_test sched_nr_rar_test) +add_executable(sched_nr_utilities_tests sched_nr_utilities_tests.cc) +target_link_libraries(sched_nr_utilities_tests srsgnb_mac srsran_common srsran_phch) +add_nr_test(sched_nr_utilities_tests sched_nr_utilities_tests) + add_executable(sched_nr_test sched_nr_test.cc) target_link_libraries(sched_nr_test srsgnb_mac diff --git a/srsgnb/src/stack/mac/test/sched_nr_utilities_tests.cc b/srsgnb/src/stack/mac/test/sched_nr_utilities_tests.cc new file mode 100644 index 000000000..5b9efe731 --- /dev/null +++ b/srsgnb/src/stack/mac/test/sched_nr_utilities_tests.cc @@ -0,0 +1,220 @@ +// +// Created by carlo on 9/12/21. +// + +#include "srsran/common/test_common.h" +extern "C" { +#include "srsran/phy/phch/ra_nr.h" +} + +void test_cqi_to_mcs() +{ + // Sample random CQI values and test the returned MCS, for different combinations of CQI and MCS tables + // Set the parameters so that to select a given MCS table (1, 2, or 3) + + // TEST CQI Table 1 - MCS table 1 + int mcs = srsran_ra_nr_cqi_to_mcs(/* cqi */ 3, + /* cqi_table_idx */ SRSRAN_CSI_CQI_TABLE_1, + /* mcs_table */ srsran_mcs_table_64qam, + /* dci_format */ srsran_dci_format_nr_1_0, + /* search_space_type*/ srsran_search_space_type_ue, + /* rnti_type */ srsran_rnti_type_c); + TESTASSERT_EQ(2, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(5, + SRSRAN_CSI_CQI_TABLE_1, + srsran_mcs_table_64qam, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(6, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(9, + SRSRAN_CSI_CQI_TABLE_1, + srsran_mcs_table_64qam, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(15, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(12, + SRSRAN_CSI_CQI_TABLE_1, + srsran_mcs_table_64qam, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(22, mcs); + + // TEST CQI Table 2 - MCS table 2 + mcs = srsran_ra_nr_cqi_to_mcs(1, + SRSRAN_CSI_CQI_TABLE_2, + srsran_mcs_table_256qam, + srsran_dci_format_nr_1_1, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(0, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(4, + SRSRAN_CSI_CQI_TABLE_2, + srsran_mcs_table_256qam, + srsran_dci_format_nr_1_1, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(5, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(7, + SRSRAN_CSI_CQI_TABLE_2, + srsran_mcs_table_256qam, + srsran_dci_format_nr_1_1, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(11, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(11, + SRSRAN_CSI_CQI_TABLE_2, + srsran_mcs_table_256qam, + srsran_dci_format_nr_1_1, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(19, mcs); + + // TEST CQI Table 3 - MCS table 3 + mcs = srsran_ra_nr_cqi_to_mcs(2, + SRSRAN_CSI_CQI_TABLE_3, + srsran_mcs_table_qam64LowSE, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(2, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(8, + SRSRAN_CSI_CQI_TABLE_3, + srsran_mcs_table_qam64LowSE, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(14, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(13, + SRSRAN_CSI_CQI_TABLE_3, + srsran_mcs_table_qam64LowSE, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(24, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(15, + SRSRAN_CSI_CQI_TABLE_3, + srsran_mcs_table_qam64LowSE, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(28, mcs); + + // TEST CQI Table 1 - MCS table 2 + mcs = srsran_ra_nr_cqi_to_mcs(6, + SRSRAN_CSI_CQI_TABLE_1, + srsran_mcs_table_256qam, + srsran_dci_format_nr_1_1, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(4, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(14, + SRSRAN_CSI_CQI_TABLE_1, + srsran_mcs_table_256qam, + srsran_dci_format_nr_1_1, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(19, mcs); + + // TEST CQI Table 1 - MCS table 3 + mcs = srsran_ra_nr_cqi_to_mcs(7, + SRSRAN_CSI_CQI_TABLE_1, + srsran_mcs_table_qam64LowSE, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(16, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(10, + SRSRAN_CSI_CQI_TABLE_1, + srsran_mcs_table_qam64LowSE, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(22, mcs); + + // TEST CQI Table 2 - MCS table 1 + mcs = srsran_ra_nr_cqi_to_mcs(3, + SRSRAN_CSI_CQI_TABLE_2, + srsran_mcs_table_64qam, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(6, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(11, + SRSRAN_CSI_CQI_TABLE_2, + srsran_mcs_table_64qam, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(26, mcs); + + // TEST CQI Table 2 - MCS table 3 + mcs = srsran_ra_nr_cqi_to_mcs(7, + SRSRAN_CSI_CQI_TABLE_2, + srsran_mcs_table_qam64LowSE, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(22, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(10, + SRSRAN_CSI_CQI_TABLE_2, + srsran_mcs_table_qam64LowSE, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(28, mcs); + + // TEST CQI Table 3 - MCS table 1 + mcs = srsran_ra_nr_cqi_to_mcs(2, + SRSRAN_CSI_CQI_TABLE_3, + srsran_mcs_table_64qam, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(0, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(13, + SRSRAN_CSI_CQI_TABLE_3, + srsran_mcs_table_64qam, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(20, mcs); + + // TEST CQI Table 3 - MCS table 2 + mcs = srsran_ra_nr_cqi_to_mcs(5, + SRSRAN_CSI_CQI_TABLE_3, + srsran_mcs_table_256qam, + srsran_dci_format_nr_1_1, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(1, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(14, + SRSRAN_CSI_CQI_TABLE_3, + srsran_mcs_table_256qam, + srsran_dci_format_nr_1_1, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(15, mcs); +} + +int main() +{ + test_cqi_to_mcs(); +} \ No newline at end of file From 2040a88bf92ac374a94512451e4edf80b5f35491 Mon Sep 17 00:00:00 2001 From: Carlo Galiotto Date: Fri, 10 Dec 2021 11:20:44 +0100 Subject: [PATCH 07/15] sched: add comments + rename variable Signed-off-by: Carlo Galiotto --- lib/include/srsran/phy/phch/ra_nr.h | 2 +- lib/src/phy/phch/ra_nr.c | 6 +++--- srsgnb/src/stack/mac/sched_nr_grant_allocator.cc | 2 ++ .../src/stack/mac/test/sched_nr_utilities_tests.cc | 14 +++++++++++--- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/lib/include/srsran/phy/phch/ra_nr.h b/lib/include/srsran/phy/phch/ra_nr.h index 155e6b7d2..99fc624ec 100644 --- a/lib/include/srsran/phy/phch/ra_nr.h +++ b/lib/include/srsran/phy/phch/ra_nr.h @@ -155,7 +155,7 @@ SRSRAN_API uint32_t srsran_ra_nr_type1_riv(uint32_t N_rb, uint32_t start_rb, uin * * Mapping is performed as: return the MCS that has the closest spectral efficiency to that of the CQI * @param cqi CQI value - * @param srsran_csi_cqi_table_t CQI table index + * @param cqi_table_idx CQI table index * @param mcs_table MCS table parameter * @param dci_format DCI format * @param search_space_type Seach Space type diff --git a/lib/src/phy/phch/ra_nr.c b/lib/src/phy/phch/ra_nr.c index 81a9f3c66..f853aa7df 100644 --- a/lib/src/phy/phch/ra_nr.c +++ b/lib/src/phy/phch/ra_nr.c @@ -30,7 +30,7 @@ typedef struct { #define RA_NR_MCS_SIZE_TABLE2 28 #define RA_NR_MCS_SIZE_TABLE3 29 #define RA_NR_TBS_SIZE_TABLE 93 -#define RA_NR_CQI_SIZE_TABLE 16 +#define RA_NR_CQI_TABLE_SIZE 16 #define RA_NR_BETA_OFFSET_HARQACK_SIZE 32 #define RA_NR_BETA_OFFSET_CSI_SIZE 32 @@ -148,7 +148,7 @@ typedef enum { ra_nr_table_1 = 0, ra_nr_table_2, ra_nr_table_3 } ra_nr_table_t; * CQI_table_idx: 1 -> Table 5.1.3.1-1; 2 -> Table 5.1.3.1-2; 3 -> Table 5.1.3.1-3 */ -static int ra_nr_cqi_to_mcs_table[3][3][RA_NR_CQI_SIZE_TABLE] = { +static int ra_nr_cqi_to_mcs_table[3][3][RA_NR_CQI_TABLE_SIZE] = { /* ROW 1 - CQI Table 1 */ {/* MCS Table 1 */ {-1, 0, 0, 2, 4, 6, 8, 11, 13, 15, 18, 20, 22, 24, 26, 28}, /* MCS Table 2 */ {-1, 0, 0, 1, 2, 3, 4, 5, 7, 9, 11, 13, 15, 17, 19, 21}, @@ -1121,7 +1121,7 @@ int srsran_ra_nr_cqi_to_mcs(uint8_t cqi, srsran_search_space_type_t search_space_type, srsran_rnti_type_t rnti_type) { - if (cqi >= RA_NR_CQI_SIZE_TABLE) { + if (cqi >= RA_NR_CQI_TABLE_SIZE) { ERROR("Invalid CQI (%u)", cqi); return -1; } diff --git a/srsgnb/src/stack/mac/sched_nr_grant_allocator.cc b/srsgnb/src/stack/mac/sched_nr_grant_allocator.cc index 0bea82f28..b02978281 100644 --- a/srsgnb/src/stack/mac/sched_nr_grant_allocator.cc +++ b/srsgnb/src/stack/mac/sched_nr_grant_allocator.cc @@ -337,8 +337,10 @@ alloc_result bwp_slot_allocator::alloc_pdsch(slot_ue& ue, uint32_t ss_id, const srsran_assert(success, "Failed to allocate DL HARQ retx"); } + srsran_slot_cfg_t slot_cfg; slot_cfg.idx = ue.pdsch_slot.to_uint(); + // Value 0.95 is from TS 38.214 v15.14.00, Section 5.1.3, page 17 const static float max_R = 0.95; while (true) { // Generate PDSCH diff --git a/srsgnb/src/stack/mac/test/sched_nr_utilities_tests.cc b/srsgnb/src/stack/mac/test/sched_nr_utilities_tests.cc index 5b9efe731..fa6aef467 100644 --- a/srsgnb/src/stack/mac/test/sched_nr_utilities_tests.cc +++ b/srsgnb/src/stack/mac/test/sched_nr_utilities_tests.cc @@ -1,6 +1,14 @@ -// -// Created by carlo on 9/12/21. -// +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2021 Software Radio Systems Limited + * + * By using this file, you agree to the terms and conditions set + * forth in the LICENSE file which can be found at the top level of + * the distribution. + * + */ #include "srsran/common/test_common.h" extern "C" { From 9be9bd659e5844805f4502f70bda210c132db9f4 Mon Sep 17 00:00:00 2001 From: Carlo Galiotto Date: Fri, 17 Dec 2021 19:16:25 +0100 Subject: [PATCH 08/15] sched,nr: add CQI to SE and SE to MCS mapping ... for scheduler + add CQi reporting from PHY to scheduler Signed-off-by: Carlo Galiotto --- lib/include/srsran/phy/phch/ra_nr.h | 28 ++ lib/src/phy/phch/ra_nr.c | 204 +++++++- srsgnb/hdr/stack/mac/sched_nr.h | 1 + srsgnb/src/stack/mac/mac_nr.cc | 12 +- srsgnb/src/stack/mac/sched_nr.cc | 9 + srsgnb/src/stack/mac/test/CMakeLists.txt | 6 +- .../mac/test/sched_nr_dci_utilities_tests.cc | 469 ++++++++++++++++++ .../mac/test/sched_nr_utilities_tests.cc | 228 --------- 8 files changed, 711 insertions(+), 246 deletions(-) create mode 100644 srsgnb/src/stack/mac/test/sched_nr_dci_utilities_tests.cc delete mode 100644 srsgnb/src/stack/mac/test/sched_nr_utilities_tests.cc diff --git a/lib/include/srsran/phy/phch/ra_nr.h b/lib/include/srsran/phy/phch/ra_nr.h index 99fc624ec..6227a92b7 100644 --- a/lib/include/srsran/phy/phch/ra_nr.h +++ b/lib/include/srsran/phy/phch/ra_nr.h @@ -168,4 +168,32 @@ SRSRAN_API int srsran_ra_nr_cqi_to_mcs(uint8_t cqi, srsran_dci_format_nr_t dci_format, srsran_search_space_type_t search_space_type, srsran_rnti_type_t rnti_type); + +/** + * @brief Returns the Spectral Efficiency corresponding to CQI + * + * Mapping is performed as: return the MCS that has the closest spectral efficiency to that of the CQI + * @param cqi CQI value + * @param cqi_table_idx CQI table index + * @return The Spectral Efficiency + */ +SRSRAN_API double srsran_ra_nr_cqi_to_se(uint8_t cqi, srsran_csi_cqi_table_t cqi_table_idx); + +/** + * @brief Returns the MCS corresponding to Spectral Efficiency + * + * Mapping is performed as: return the greatest MCS with an SE lower than or equal to target SE + * @param se_target Target Spectral efficiency to be mapped into MCS + * @param mcs_table MCS table parameter + * @param dci_format DCI format + * @param search_space_type Seach Space type + * @param rnti_type RNTI type + * @return The MCS index + */ +SRSRAN_API int srsran_ra_nr_se_to_mcs(double se_target, + srsran_mcs_table_t mcs_table, + srsran_dci_format_nr_t dci_format, + srsran_search_space_type_t search_space_type, + srsran_rnti_type_t rnti_type); + #endif // SRSRAN_RA_NR_H diff --git a/lib/src/phy/phch/ra_nr.c b/lib/src/phy/phch/ra_nr.c index f853aa7df..f5e4e9b45 100644 --- a/lib/src/phy/phch/ra_nr.c +++ b/lib/src/phy/phch/ra_nr.c @@ -19,6 +19,7 @@ #include "srsran/phy/phch/ra_ul_nr.h" #include "srsran/phy/phch/uci_nr.h" #include "srsran/phy/utils/debug.h" +#include /* floor */ typedef struct { srsran_mod_t modulation; @@ -145,7 +146,7 @@ typedef enum { ra_nr_table_1 = 0, ra_nr_table_2, ra_nr_table_3 } ra_nr_table_t; * The array ra_nr_cqi_to_mcs_table[CQI_table_idx][MCS_table_idx][CQI] contains the MCS corresponding to CQI, based on * the given CQI_table_idx and MCS_table_idx tables * CQI_table_idx: 1 -> Table 5.2.2.1-2; 2 -> Table 5.2.2.1-3, 3 -> Table 5.2.2.1-4 - * CQI_table_idx: 1 -> Table 5.1.3.1-1; 2 -> Table 5.1.3.1-2; 3 -> Table 5.1.3.1-3 + * MCS_table_idx: 1 -> Table 5.1.3.1-1; 2 -> Table 5.1.3.1-2; 3 -> Table 5.1.3.1-3 */ static int ra_nr_cqi_to_mcs_table[3][3][RA_NR_CQI_TABLE_SIZE] = { @@ -162,6 +163,65 @@ static int ra_nr_cqi_to_mcs_table[3][3][RA_NR_CQI_TABLE_SIZE] = { /* MCS Table 2 */ {-1, 0, 0, 0, 0, 1, 2, 3, 4, 5, 7, 9, 11, 13, 15, 17}, /* MCS Table 3 */ {-1, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28}}}; +/** + * The CQI to Spectral efficiency table. + * The array ra_nr_cqi_to_se_table[CQI_table_idx][CQI] contains the Spectracl Efficiency corresponding to CQI, based on + * the given CQI_table_idx: + * CQI_table_idx: 1 -> Table 5.2.2.1-2; 2 -> Table 5.2.2.1-3, 3 -> Table 5.2.2.1-4 + */ +static const double ra_nr_cqi_to_se_table[3][RA_NR_CQI_TABLE_SIZE] = { + /* ROW 1 - CQI Table 1 */ + {-1, + 0.1523, + 0.2344, + 0.3770, + 0.6016, + 0.8770, + 1.1758, + 1.4766, + 1.9141, + 2.4063, + 2.7305, + 3.3223, + 3.9023, + 4.5234, + 5.1152, + 5.5547}, + /* ROW 2 - CQI Table 2 */ + {-1, + 0.1523, + 0.3770, + 0.8770, + 1.4766, + 1.9141, + 2.4063, + 2.7305, + 3.3223, + 3.9023, + 4.5234, + 5.1152, + 5.5547, + 6.2266, + 6.9141, + 7.4063}, + /* ROW 3 - CQI Table 3 */ + {-1, + 0.0586, + 0.0977, + 0.1523, + 0.2344, + 0.3770, + 0.6016, + 0.8770, + 1.1758, + 1.4766, + 1.9141, + 2.4063, + 2.7305, + 3.3223, + 3.9023, + 4.5234}}; + static ra_nr_table_t ra_nr_select_table_pusch_noprecoding(srsran_mcs_table_t mcs_table, srsran_dci_format_nr_t dci_format, srsran_search_space_type_t search_space_type, @@ -1126,20 +1186,136 @@ int srsran_ra_nr_cqi_to_mcs(uint8_t cqi, return -1; } - typedef enum { table_1 = 0, table_2, table_3, table_N } mcs_table_t; + ra_nr_table_t mcs_table_idx = ra_nr_select_table_pdsch(mcs_table, dci_format, search_space_type, rnti_type); - // The following logic to select the MCS table is the same as in the function ra_nr_select_table_pdsch() in this same - // file - mcs_table_t mcs_table_idx; - if (mcs_table == srsran_mcs_table_256qam && dci_format == srsran_dci_format_nr_1_1 && - rnti_type == srsran_rnti_type_c) { - mcs_table_idx = table_2; - } else if (mcs_table == srsran_mcs_table_qam64LowSE && search_space_type == srsran_search_space_type_ue && - rnti_type == srsran_rnti_type_c) { - mcs_table_idx = table_3; - } else { - mcs_table_idx = table_1; + return ra_nr_cqi_to_mcs_table[cqi_table_idx][mcs_table_idx][cqi]; +} + +double srsran_ra_nr_cqi_to_se(uint8_t cqi, srsran_csi_cqi_table_t cqi_table_idx) +{ + if (cqi >= RA_NR_CQI_TABLE_SIZE) { + ERROR("Invalid CQI (%u)", cqi); + return -1; } - return ra_nr_cqi_to_mcs_table[cqi_table_idx][mcs_table_idx][cqi]; + return ra_nr_cqi_to_se_table[cqi_table_idx][cqi]; +} + +static inline int srsran_ra_nr_mcs_bin_search(double se, size_t mcs_table_size, const mcs_entry_t* mcs_se_table) +{ + if (mcs_se_table == NULL) { + ERROR("Missing MCS table pointer"); + return -1; + } + + if (se < mcs_se_table[0].S) { + return 0; + } else if (se > mcs_se_table[mcs_table_size - 1].S) { + return mcs_table_size - 1; + } + + size_t lb = 0; + size_t ub = mcs_table_size - 1; + while (ub > lb + 1) { + size_t mid_point = (size_t)floor(((double)(lb + ub)) / 2); + // break out of loop is there is an exact match + if (mcs_se_table[mid_point].S == se) { + ub = mid_point; + break; + } + // restrict the search to the left half of the vector + else if (se < mcs_se_table[mid_point].S) { + ub = mid_point; + } + // restrict the search to the right half of the vector + else { /* se > mcs_se_table[mid_point].S ) */ + lb = mid_point; + } + } + + return (int)ub; +} + +int srsran_ra_nr_se_to_mcs(double se_target, + srsran_mcs_table_t mcs_table, + srsran_dci_format_nr_t dci_format, + srsran_search_space_type_t search_space_type, + srsran_rnti_type_t rnti_type) +{ + // Get MCS table index to be used + ra_nr_table_t mcs_table_idx = ra_nr_select_table_pdsch(mcs_table, dci_format, search_space_type, rnti_type); + + // Get MCS table and size based on mcs_table_idx + const mcs_entry_t* mcs_se_table; + size_t mcs_table_size; + switch (mcs_table_idx) { + case ra_nr_table_1: + mcs_se_table = ra_nr_table1; + mcs_table_size = RA_NR_MCS_SIZE_TABLE1; + break; + case ra_nr_table_2: + mcs_se_table = ra_nr_table2; + mcs_table_size = RA_NR_MCS_SIZE_TABLE2; + break; + case ra_nr_table_3: + mcs_se_table = ra_nr_table3; + mcs_table_size = RA_NR_MCS_SIZE_TABLE3; + break; + default: + ERROR("Invalid MCS table index (%u)", mcs_table_idx); + return -1; + } + + // if SE is lower than min possible value, return min MCS + if (se_target <= mcs_se_table[0].S) { + return 0; + } + // if SE is greater than max possible value, return max MCS + else if (se_target >= mcs_se_table[mcs_table_size - 1].S) { + return mcs_table_size - 1; + } + + // handle monotonicity oddity between MCS 16 and 17 for MCS table 1 + if (mcs_table_idx == ra_nr_table_1) { + if (se_target == mcs_se_table[17].S) { + return 17; + } else if (se_target <= mcs_se_table[16].S && se_target > mcs_se_table[17].S) { + return 16; + } + } + + /* In the following, we search for the greatest MCS value such that MCS(SE) <= target SE, where the target SE is the + * value provided as an input argument. The MCS is the vector index, the content of the vector is the SE. + * The search is performed by means of a binary-search like algorithm. At each iteration, we look for the SE in the + * left or right half of the vector, depending on the target SE. + * We stop when the lower-bound (lb) and upper-bound (ub) are two consecutive MCS values and we return the + * lower-bound, which approximates the greatest MCS value such that MCS(SE) <= target SE + * */ + size_t lb = 0; // lower-bound of MCS-to-SE vector where to perform binary search + size_t ub = mcs_table_size - 1; // upper-bound of MCS-to-SE vector where to perform binary search + while (ub > lb + 1) { + size_t mid_point = (size_t)floor(((double)(lb + ub)) / 2); + // break out of loop is there is an exact match + if (mcs_se_table[mid_point].S == se_target) { + return (int)mid_point; + } + // restrict the search to the left half of the vector + else if (se_target < mcs_se_table[mid_point].S) { + ub = mid_point; + // handle monotonicity oddity between MCS 16 and 17 for MCS table 1 + if (mcs_table_idx == ra_nr_table_1 && ub == 17) { + ub = 16; + } + } + // restrict the search to the right half of the vector + else { /* se_target > mcs_se_table[mid_point].S ) */ + lb = mid_point; + // handle monotonicity oddity between MCS 16 and 17 for MCS table 1 + if (mcs_table_idx == ra_nr_table_1 && lb == 16) { + lb = 17; + } + } + } + + return (int)lb; } diff --git a/srsgnb/hdr/stack/mac/sched_nr.h b/srsgnb/hdr/stack/mac/sched_nr.h index cda4de6bb..36ea03c54 100644 --- a/srsgnb/hdr/stack/mac/sched_nr.h +++ b/srsgnb/hdr/stack/mac/sched_nr.h @@ -49,6 +49,7 @@ public: void ul_sr_info(uint16_t rnti) override; void ul_bsr(uint16_t rnti, uint32_t lcg_id, uint32_t bsr) override; void dl_buffer_state(uint16_t rnti, uint32_t lcid, uint32_t newtx, uint32_t retx); + void dl_cqi_info(uint16_t rnti, uint32_t cc, uint32_t cqi_value); /// Called once per slot in a non-concurrent fashion void slot_indication(slot_point slot_tx) override; diff --git a/srsgnb/src/stack/mac/mac_nr.cc b/srsgnb/src/stack/mac/mac_nr.cc index ecf41ec7c..38c768742 100644 --- a/srsgnb/src/stack/mac/mac_nr.cc +++ b/srsgnb/src/stack/mac/mac_nr.cc @@ -584,7 +584,17 @@ bool mac_nr::handle_uci_data(uint16_t rnti, const srsran_uci_cfg_nr_t& cfg_, con } // Process CQI - { + for (uint32_t i = 0; i < cfg_.nof_csi; i++) { + // Skip if invalid or not supported CSI report + if (not value.valid or cfg_.csi[i].cfg.quantity != SRSRAN_CSI_REPORT_QUANTITY_CRI_RI_PMI_CQI or + cfg_.csi[i].cfg.freq_cfg != SRSRAN_CSI_REPORT_FREQ_WIDEBAND or value.csi[i].wideband_cri_ri_pmi_cqi.cqi == 0) { + continue; + } + + // 1. Pass CQI report to scheduler + sched->dl_cqi_info(rnti, 0, value.csi->wideband_cri_ri_pmi_cqi.cqi); + + // 2. Save CQI report for metrics stats srsran::rwlock_read_guard rw_lock(rwmutex); if (ue_db.contains(rnti) && value.valid) { ue_db[rnti]->metrics_dl_cqi(cfg_, value.csi->wideband_cri_ri_pmi_cqi.cqi); diff --git a/srsgnb/src/stack/mac/sched_nr.cc b/srsgnb/src/stack/mac/sched_nr.cc index c2f13d360..d631e2fa5 100644 --- a/srsgnb/src/stack/mac/sched_nr.cc +++ b/srsgnb/src/stack/mac/sched_nr.cc @@ -480,6 +480,15 @@ void sched_nr::dl_buffer_state(uint16_t rnti, uint32_t lcid, uint32_t newtx, uin }); } +void sched_nr::dl_cqi_info(uint16_t rnti, uint32_t cc, uint32_t cqi_value) +{ + auto callback = [cqi_value](ue_carrier& ue_cc, event_manager::logger& ev_logger) { + ue_cc.dl_cqi = cqi_value; + ev_logger.push("0x{:x}: dl_cqi_info(cqi={})", ue_cc.rnti, ue_cc.dl_cqi); + }; + pending_events->enqueue_ue_cc_feedback("dl_cqi_info", rnti, cc, callback); +} + #define VERIFY_INPUT(cond, msg, ...) \ do { \ if (not(cond)) { \ diff --git a/srsgnb/src/stack/mac/test/CMakeLists.txt b/srsgnb/src/stack/mac/test/CMakeLists.txt index 042c8f2b0..c8bdba6d9 100644 --- a/srsgnb/src/stack/mac/test/CMakeLists.txt +++ b/srsgnb/src/stack/mac/test/CMakeLists.txt @@ -40,9 +40,9 @@ add_executable(sched_nr_rar_test sched_nr_rar_test.cc) target_link_libraries(sched_nr_rar_test srsgnb_mac sched_nr_test_suite srsran_common) add_nr_test(sched_nr_rar_test sched_nr_rar_test) -add_executable(sched_nr_utilities_tests sched_nr_utilities_tests.cc) -target_link_libraries(sched_nr_utilities_tests srsgnb_mac srsran_common srsran_phch) -add_nr_test(sched_nr_utilities_tests sched_nr_utilities_tests) +add_executable(sched_nr_dci_utilities_tests sched_nr_dci_utilities_tests.cc) +target_link_libraries(sched_nr_dci_utilities_tests srsgnb_mac srsran_common srsran_phch) +add_nr_test(sched_nr_dci_utilities_tests sched_nr_dci_utilities_tests) add_executable(sched_nr_test sched_nr_test.cc) target_link_libraries(sched_nr_test diff --git a/srsgnb/src/stack/mac/test/sched_nr_dci_utilities_tests.cc b/srsgnb/src/stack/mac/test/sched_nr_dci_utilities_tests.cc new file mode 100644 index 000000000..41487294a --- /dev/null +++ b/srsgnb/src/stack/mac/test/sched_nr_dci_utilities_tests.cc @@ -0,0 +1,469 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2021 Software Radio Systems Limited + * + * By using this file, you agree to the terms and conditions set + * forth in the LICENSE file which can be found at the top level of + * the distribution. + * + */ + +#include "srsran/common/test_common.h" +extern "C" { +#include "srsran/phy/phch/ra_nr.h" +} + +void test_cqi_to_mcs() +{ + // Sample random CQI values and test the returned MCS, for different combinations of CQI and MCS tables + // Set the parameters so that to select a given MCS table (1, 2, or 3) + + // TEST CQI Table 1 - MCS table 1 + int mcs = srsran_ra_nr_cqi_to_mcs(/* cqi */ 3, + /* cqi_table_idx */ SRSRAN_CSI_CQI_TABLE_1, + /* mcs_table */ srsran_mcs_table_64qam, + /* dci_format */ srsran_dci_format_nr_1_0, + /* search_space_type*/ srsran_search_space_type_ue, + /* rnti_type */ srsran_rnti_type_c); + TESTASSERT_EQ(2, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(5, + SRSRAN_CSI_CQI_TABLE_1, + srsran_mcs_table_64qam, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(6, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(9, + SRSRAN_CSI_CQI_TABLE_1, + srsran_mcs_table_64qam, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(15, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(12, + SRSRAN_CSI_CQI_TABLE_1, + srsran_mcs_table_64qam, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(22, mcs); + + // TEST CQI Table 2 - MCS table 2 + mcs = srsran_ra_nr_cqi_to_mcs(1, + SRSRAN_CSI_CQI_TABLE_2, + srsran_mcs_table_256qam, + srsran_dci_format_nr_1_1, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(0, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(4, + SRSRAN_CSI_CQI_TABLE_2, + srsran_mcs_table_256qam, + srsran_dci_format_nr_1_1, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(5, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(7, + SRSRAN_CSI_CQI_TABLE_2, + srsran_mcs_table_256qam, + srsran_dci_format_nr_1_1, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(11, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(11, + SRSRAN_CSI_CQI_TABLE_2, + srsran_mcs_table_256qam, + srsran_dci_format_nr_1_1, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(19, mcs); + + // TEST CQI Table 3 - MCS table 3 + mcs = srsran_ra_nr_cqi_to_mcs(2, + SRSRAN_CSI_CQI_TABLE_3, + srsran_mcs_table_qam64LowSE, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(2, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(8, + SRSRAN_CSI_CQI_TABLE_3, + srsran_mcs_table_qam64LowSE, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(14, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(13, + SRSRAN_CSI_CQI_TABLE_3, + srsran_mcs_table_qam64LowSE, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(24, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(15, + SRSRAN_CSI_CQI_TABLE_3, + srsran_mcs_table_qam64LowSE, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(28, mcs); + + // TEST CQI Table 1 - MCS table 2 + mcs = srsran_ra_nr_cqi_to_mcs(6, + SRSRAN_CSI_CQI_TABLE_1, + srsran_mcs_table_256qam, + srsran_dci_format_nr_1_1, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(4, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(14, + SRSRAN_CSI_CQI_TABLE_1, + srsran_mcs_table_256qam, + srsran_dci_format_nr_1_1, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(19, mcs); + + // TEST CQI Table 1 - MCS table 3 + mcs = srsran_ra_nr_cqi_to_mcs(7, + SRSRAN_CSI_CQI_TABLE_1, + srsran_mcs_table_qam64LowSE, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(16, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(10, + SRSRAN_CSI_CQI_TABLE_1, + srsran_mcs_table_qam64LowSE, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(22, mcs); + + // TEST CQI Table 2 - MCS table 1 + mcs = srsran_ra_nr_cqi_to_mcs(3, + SRSRAN_CSI_CQI_TABLE_2, + srsran_mcs_table_64qam, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(6, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(11, + SRSRAN_CSI_CQI_TABLE_2, + srsran_mcs_table_64qam, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(26, mcs); + + // TEST CQI Table 2 - MCS table 3 + mcs = srsran_ra_nr_cqi_to_mcs(7, + SRSRAN_CSI_CQI_TABLE_2, + srsran_mcs_table_qam64LowSE, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(22, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(10, + SRSRAN_CSI_CQI_TABLE_2, + srsran_mcs_table_qam64LowSE, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(28, mcs); + + // TEST CQI Table 3 - MCS table 1 + mcs = srsran_ra_nr_cqi_to_mcs(2, + SRSRAN_CSI_CQI_TABLE_3, + srsran_mcs_table_64qam, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(0, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(13, + SRSRAN_CSI_CQI_TABLE_3, + srsran_mcs_table_64qam, + srsran_dci_format_nr_1_0, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(20, mcs); + + // TEST CQI Table 3 - MCS table 2 + mcs = srsran_ra_nr_cqi_to_mcs(5, + SRSRAN_CSI_CQI_TABLE_3, + srsran_mcs_table_256qam, + srsran_dci_format_nr_1_1, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(1, mcs); + + mcs = srsran_ra_nr_cqi_to_mcs(14, + SRSRAN_CSI_CQI_TABLE_3, + srsran_mcs_table_256qam, + srsran_dci_format_nr_1_1, + srsran_search_space_type_ue, + srsran_rnti_type_c); + TESTASSERT_EQ(15, mcs); +} + +void test_cqi_to_se() +{ + // TEST CQI Table 1 + double se = srsran_ra_nr_cqi_to_se(2, SRSRAN_CSI_CQI_TABLE_1); + TESTASSERT_EQ(0.2344, se); + + se = srsran_ra_nr_cqi_to_se(5, SRSRAN_CSI_CQI_TABLE_1); + TESTASSERT_EQ(0.8770, se); + + se = srsran_ra_nr_cqi_to_se(8, SRSRAN_CSI_CQI_TABLE_1); + TESTASSERT_EQ(1.9141, se); + + se = srsran_ra_nr_cqi_to_se(11, SRSRAN_CSI_CQI_TABLE_1); + TESTASSERT_EQ(3.3223, se); + + se = srsran_ra_nr_cqi_to_se(13, SRSRAN_CSI_CQI_TABLE_1); + TESTASSERT_EQ(4.5234, se); + + se = srsran_ra_nr_cqi_to_se(15, SRSRAN_CSI_CQI_TABLE_1); + TESTASSERT_EQ(5.5547, se); + + // TEST CQI Table 2 + se = srsran_ra_nr_cqi_to_se(1, SRSRAN_CSI_CQI_TABLE_2); + TESTASSERT_EQ(0.1523, se); + + se = srsran_ra_nr_cqi_to_se(4, SRSRAN_CSI_CQI_TABLE_2); + TESTASSERT_EQ(1.4766, se); + + se = srsran_ra_nr_cqi_to_se(7, SRSRAN_CSI_CQI_TABLE_2); + TESTASSERT_EQ(2.7305, se); + + se = srsran_ra_nr_cqi_to_se(10, SRSRAN_CSI_CQI_TABLE_2); + TESTASSERT_EQ(4.5234, se); + + se = srsran_ra_nr_cqi_to_se(12, SRSRAN_CSI_CQI_TABLE_2); + TESTASSERT_EQ(5.5547, se); + + se = srsran_ra_nr_cqi_to_se(14, SRSRAN_CSI_CQI_TABLE_2); + TESTASSERT_EQ(6.9141, se); + + // TEST CQI Table 3 + se = srsran_ra_nr_cqi_to_se(1, SRSRAN_CSI_CQI_TABLE_3); + TESTASSERT_EQ(0.0586, se); + + se = srsran_ra_nr_cqi_to_se(3, SRSRAN_CSI_CQI_TABLE_3); + TESTASSERT_EQ(0.1523, se); + + se = srsran_ra_nr_cqi_to_se(7, SRSRAN_CSI_CQI_TABLE_3); + TESTASSERT_EQ(0.8770, se); + + se = srsran_ra_nr_cqi_to_se(9, SRSRAN_CSI_CQI_TABLE_3); + TESTASSERT_EQ(1.4766, se); + + se = srsran_ra_nr_cqi_to_se(12, SRSRAN_CSI_CQI_TABLE_3); + TESTASSERT_EQ(2.7305, se); + + se = srsran_ra_nr_cqi_to_se(15, SRSRAN_CSI_CQI_TABLE_3); + TESTASSERT_EQ(4.5234, se); +} + +void test_se_to_mcs() +{ + // MCS table 1 + int mcs = srsran_ra_nr_se_to_mcs(/* se */ .1, + /* mcs_table */ srsran_mcs_table_64qam, + /* dci_format */ srsran_dci_format_nr_1_0, + /* search_space_type*/ srsran_search_space_type_ue, + /* rnti_type */ srsran_rnti_type_c); + TESTASSERT_EQ(0, mcs); + + mcs = srsran_ra_nr_se_to_mcs(/* se */ .2344, + /* mcs_table */ srsran_mcs_table_64qam, + /* dci_format */ srsran_dci_format_nr_1_0, + /* search_space_type*/ srsran_search_space_type_ue, + /* rnti_type */ srsran_rnti_type_c); + TESTASSERT_EQ(0, mcs); + + mcs = srsran_ra_nr_se_to_mcs(/* se */ 1, + /* mcs_table */ srsran_mcs_table_64qam, + /* dci_format */ srsran_dci_format_nr_1_0, + /* search_space_type*/ srsran_search_space_type_ue, + /* rnti_type */ srsran_rnti_type_c); + TESTASSERT_EQ(6, mcs); + + mcs = srsran_ra_nr_se_to_mcs(/* se */ 1.0273, + /* mcs_table */ srsran_mcs_table_64qam, + /* dci_format */ srsran_dci_format_nr_1_0, + /* search_space_type*/ srsran_search_space_type_ue, + /* rnti_type */ srsran_rnti_type_c); + TESTASSERT_EQ(7, mcs); + + mcs = srsran_ra_nr_se_to_mcs(/* se */ 2.5, + /* mcs_table */ srsran_mcs_table_64qam, + /* dci_format */ srsran_dci_format_nr_1_0, + /* search_space_type*/ srsran_search_space_type_ue, + /* rnti_type */ srsran_rnti_type_c); + TESTASSERT_EQ(15, mcs); + + mcs = srsran_ra_nr_se_to_mcs(/* se */ 2.5703, + /* mcs_table */ srsran_mcs_table_64qam, + /* dci_format */ srsran_dci_format_nr_1_0, + /* search_space_type*/ srsran_search_space_type_ue, + /* rnti_type */ srsran_rnti_type_c); + TESTASSERT_EQ(16, mcs); + + mcs = srsran_ra_nr_se_to_mcs(/* se */ 2.57, + /* mcs_table */ srsran_mcs_table_64qam, + /* dci_format */ srsran_dci_format_nr_1_0, + /* search_space_type*/ srsran_search_space_type_ue, + /* rnti_type */ srsran_rnti_type_c); + TESTASSERT_EQ(16, mcs); + + mcs = srsran_ra_nr_se_to_mcs(/* se */ 2.5664, + /* mcs_table */ srsran_mcs_table_64qam, + /* dci_format */ srsran_dci_format_nr_1_0, + /* search_space_type*/ srsran_search_space_type_ue, + /* rnti_type */ srsran_rnti_type_c); + TESTASSERT_EQ(17, mcs); + + mcs = srsran_ra_nr_se_to_mcs(/* se */ 5.5, + /* mcs_table */ srsran_mcs_table_64qam, + /* dci_format */ srsran_dci_format_nr_1_0, + /* search_space_type*/ srsran_search_space_type_ue, + /* rnti_type */ srsran_rnti_type_c); + TESTASSERT_EQ(27, mcs); + + mcs = srsran_ra_nr_se_to_mcs(/* se */ 5.5574, + /* mcs_table */ srsran_mcs_table_64qam, + /* dci_format */ srsran_dci_format_nr_1_0, + /* search_space_type*/ srsran_search_space_type_ue, + /* rnti_type */ srsran_rnti_type_c); + TESTASSERT_EQ(28, mcs); + + mcs = srsran_ra_nr_se_to_mcs(/* se */ 6, + /* mcs_table */ srsran_mcs_table_64qam, + /* dci_format */ srsran_dci_format_nr_1_0, + /* search_space_type*/ srsran_search_space_type_ue, + /* rnti_type */ srsran_rnti_type_c); + TESTASSERT_EQ(28, mcs); + + // MCS table 2 + mcs = srsran_ra_nr_se_to_mcs( + 0.1, srsran_mcs_table_256qam, srsran_dci_format_nr_1_1, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(0, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 0.2344, srsran_mcs_table_256qam, srsran_dci_format_nr_1_1, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(0, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 0.24, srsran_mcs_table_256qam, srsran_dci_format_nr_1_1, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(0, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 1.47, srsran_mcs_table_256qam, srsran_dci_format_nr_1_1, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(4, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 1.4766, srsran_mcs_table_256qam, srsran_dci_format_nr_1_1, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(5, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 3.5, srsran_mcs_table_256qam, srsran_dci_format_nr_1_1, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(13, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 3.6094, srsran_mcs_table_256qam, srsran_dci_format_nr_1_1, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(14, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 5.2, srsran_mcs_table_256qam, srsran_dci_format_nr_1_1, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(19, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 5.3320, srsran_mcs_table_256qam, srsran_dci_format_nr_1_1, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(20, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 5.4, srsran_mcs_table_256qam, srsran_dci_format_nr_1_1, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(20, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 7.4063, srsran_mcs_table_256qam, srsran_dci_format_nr_1_1, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(27, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 7.5, srsran_mcs_table_256qam, srsran_dci_format_nr_1_1, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(27, mcs); + + // MCS table 3 + mcs = srsran_ra_nr_se_to_mcs( + 0.05, srsran_mcs_table_qam64LowSE, srsran_dci_format_nr_1_0, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(0, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 0.0586, srsran_mcs_table_qam64LowSE, srsran_dci_format_nr_1_0, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(0, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 0.056, srsran_mcs_table_qam64LowSE, srsran_dci_format_nr_1_0, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(0, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 0.15, srsran_mcs_table_qam64LowSE, srsran_dci_format_nr_1_0, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(3, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 0.1523, srsran_mcs_table_qam64LowSE, srsran_dci_format_nr_1_0, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(4, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 0.49, srsran_mcs_table_qam64LowSE, srsran_dci_format_nr_1_0, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(8, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 0.4902, srsran_mcs_table_qam64LowSE, srsran_dci_format_nr_1_0, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(9, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 1.69, srsran_mcs_table_qam64LowSE, srsran_dci_format_nr_1_0, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(16, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 1.6953, srsran_mcs_table_qam64LowSE, srsran_dci_format_nr_1_0, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(17, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 4.52, srsran_mcs_table_qam64LowSE, srsran_dci_format_nr_1_0, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(27, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 4.5234, srsran_mcs_table_qam64LowSE, srsran_dci_format_nr_1_0, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(28, mcs); + + mcs = srsran_ra_nr_se_to_mcs( + 4.6, srsran_mcs_table_qam64LowSE, srsran_dci_format_nr_1_0, srsran_search_space_type_ue, srsran_rnti_type_c); + TESTASSERT_EQ(28, mcs); +}; + +int main() +{ + test_cqi_to_mcs(); + test_cqi_to_se(); + test_se_to_mcs(); +} \ No newline at end of file diff --git a/srsgnb/src/stack/mac/test/sched_nr_utilities_tests.cc b/srsgnb/src/stack/mac/test/sched_nr_utilities_tests.cc deleted file mode 100644 index fa6aef467..000000000 --- a/srsgnb/src/stack/mac/test/sched_nr_utilities_tests.cc +++ /dev/null @@ -1,228 +0,0 @@ -/** - * - * \section COPYRIGHT - * - * Copyright 2013-2021 Software Radio Systems Limited - * - * By using this file, you agree to the terms and conditions set - * forth in the LICENSE file which can be found at the top level of - * the distribution. - * - */ - -#include "srsran/common/test_common.h" -extern "C" { -#include "srsran/phy/phch/ra_nr.h" -} - -void test_cqi_to_mcs() -{ - // Sample random CQI values and test the returned MCS, for different combinations of CQI and MCS tables - // Set the parameters so that to select a given MCS table (1, 2, or 3) - - // TEST CQI Table 1 - MCS table 1 - int mcs = srsran_ra_nr_cqi_to_mcs(/* cqi */ 3, - /* cqi_table_idx */ SRSRAN_CSI_CQI_TABLE_1, - /* mcs_table */ srsran_mcs_table_64qam, - /* dci_format */ srsran_dci_format_nr_1_0, - /* search_space_type*/ srsran_search_space_type_ue, - /* rnti_type */ srsran_rnti_type_c); - TESTASSERT_EQ(2, mcs); - - mcs = srsran_ra_nr_cqi_to_mcs(5, - SRSRAN_CSI_CQI_TABLE_1, - srsran_mcs_table_64qam, - srsran_dci_format_nr_1_0, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(6, mcs); - - mcs = srsran_ra_nr_cqi_to_mcs(9, - SRSRAN_CSI_CQI_TABLE_1, - srsran_mcs_table_64qam, - srsran_dci_format_nr_1_0, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(15, mcs); - - mcs = srsran_ra_nr_cqi_to_mcs(12, - SRSRAN_CSI_CQI_TABLE_1, - srsran_mcs_table_64qam, - srsran_dci_format_nr_1_0, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(22, mcs); - - // TEST CQI Table 2 - MCS table 2 - mcs = srsran_ra_nr_cqi_to_mcs(1, - SRSRAN_CSI_CQI_TABLE_2, - srsran_mcs_table_256qam, - srsran_dci_format_nr_1_1, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(0, mcs); - - mcs = srsran_ra_nr_cqi_to_mcs(4, - SRSRAN_CSI_CQI_TABLE_2, - srsran_mcs_table_256qam, - srsran_dci_format_nr_1_1, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(5, mcs); - - mcs = srsran_ra_nr_cqi_to_mcs(7, - SRSRAN_CSI_CQI_TABLE_2, - srsran_mcs_table_256qam, - srsran_dci_format_nr_1_1, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(11, mcs); - - mcs = srsran_ra_nr_cqi_to_mcs(11, - SRSRAN_CSI_CQI_TABLE_2, - srsran_mcs_table_256qam, - srsran_dci_format_nr_1_1, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(19, mcs); - - // TEST CQI Table 3 - MCS table 3 - mcs = srsran_ra_nr_cqi_to_mcs(2, - SRSRAN_CSI_CQI_TABLE_3, - srsran_mcs_table_qam64LowSE, - srsran_dci_format_nr_1_0, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(2, mcs); - - mcs = srsran_ra_nr_cqi_to_mcs(8, - SRSRAN_CSI_CQI_TABLE_3, - srsran_mcs_table_qam64LowSE, - srsran_dci_format_nr_1_0, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(14, mcs); - - mcs = srsran_ra_nr_cqi_to_mcs(13, - SRSRAN_CSI_CQI_TABLE_3, - srsran_mcs_table_qam64LowSE, - srsran_dci_format_nr_1_0, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(24, mcs); - - mcs = srsran_ra_nr_cqi_to_mcs(15, - SRSRAN_CSI_CQI_TABLE_3, - srsran_mcs_table_qam64LowSE, - srsran_dci_format_nr_1_0, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(28, mcs); - - // TEST CQI Table 1 - MCS table 2 - mcs = srsran_ra_nr_cqi_to_mcs(6, - SRSRAN_CSI_CQI_TABLE_1, - srsran_mcs_table_256qam, - srsran_dci_format_nr_1_1, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(4, mcs); - - mcs = srsran_ra_nr_cqi_to_mcs(14, - SRSRAN_CSI_CQI_TABLE_1, - srsran_mcs_table_256qam, - srsran_dci_format_nr_1_1, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(19, mcs); - - // TEST CQI Table 1 - MCS table 3 - mcs = srsran_ra_nr_cqi_to_mcs(7, - SRSRAN_CSI_CQI_TABLE_1, - srsran_mcs_table_qam64LowSE, - srsran_dci_format_nr_1_0, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(16, mcs); - - mcs = srsran_ra_nr_cqi_to_mcs(10, - SRSRAN_CSI_CQI_TABLE_1, - srsran_mcs_table_qam64LowSE, - srsran_dci_format_nr_1_0, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(22, mcs); - - // TEST CQI Table 2 - MCS table 1 - mcs = srsran_ra_nr_cqi_to_mcs(3, - SRSRAN_CSI_CQI_TABLE_2, - srsran_mcs_table_64qam, - srsran_dci_format_nr_1_0, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(6, mcs); - - mcs = srsran_ra_nr_cqi_to_mcs(11, - SRSRAN_CSI_CQI_TABLE_2, - srsran_mcs_table_64qam, - srsran_dci_format_nr_1_0, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(26, mcs); - - // TEST CQI Table 2 - MCS table 3 - mcs = srsran_ra_nr_cqi_to_mcs(7, - SRSRAN_CSI_CQI_TABLE_2, - srsran_mcs_table_qam64LowSE, - srsran_dci_format_nr_1_0, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(22, mcs); - - mcs = srsran_ra_nr_cqi_to_mcs(10, - SRSRAN_CSI_CQI_TABLE_2, - srsran_mcs_table_qam64LowSE, - srsran_dci_format_nr_1_0, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(28, mcs); - - // TEST CQI Table 3 - MCS table 1 - mcs = srsran_ra_nr_cqi_to_mcs(2, - SRSRAN_CSI_CQI_TABLE_3, - srsran_mcs_table_64qam, - srsran_dci_format_nr_1_0, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(0, mcs); - - mcs = srsran_ra_nr_cqi_to_mcs(13, - SRSRAN_CSI_CQI_TABLE_3, - srsran_mcs_table_64qam, - srsran_dci_format_nr_1_0, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(20, mcs); - - // TEST CQI Table 3 - MCS table 2 - mcs = srsran_ra_nr_cqi_to_mcs(5, - SRSRAN_CSI_CQI_TABLE_3, - srsran_mcs_table_256qam, - srsran_dci_format_nr_1_1, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(1, mcs); - - mcs = srsran_ra_nr_cqi_to_mcs(14, - SRSRAN_CSI_CQI_TABLE_3, - srsran_mcs_table_256qam, - srsran_dci_format_nr_1_1, - srsran_search_space_type_ue, - srsran_rnti_type_c); - TESTASSERT_EQ(15, mcs); -} - -int main() -{ - test_cqi_to_mcs(); -} \ No newline at end of file From 0f92869156516bd9db4c009febdfb0e5e2bb1c29 Mon Sep 17 00:00:00 2001 From: Carlo Galiotto Date: Wed, 22 Dec 2021 11:54:48 +0100 Subject: [PATCH 09/15] rrc,sched: add csi-MeasConfig setup in RRC Signed-off-by: Carlo Galiotto --- lib/include/srsran/common/phy_cfg_nr.h | 2 - lib/src/common/phy_cfg_nr.cc | 5 -- srsgnb/src/stack/rrc/cell_asn1_config.cc | 95 ++++++++++++++++++------ srsgnb/src/stack/rrc/rrc_nr_ue.cc | 3 + 4 files changed, 75 insertions(+), 30 deletions(-) diff --git a/lib/include/srsran/common/phy_cfg_nr.h b/lib/include/srsran/common/phy_cfg_nr.h index 5f938c4fd..d555b2e69 100644 --- a/lib/include/srsran/common/phy_cfg_nr.h +++ b/lib/include/srsran/common/phy_cfg_nr.h @@ -160,8 +160,6 @@ struct phy_cfg_nr_t { * @return valid SSB configuration */ srsran_ssb_cfg_t get_ssb_cfg() const; - - srsran_mcs_table_t get_mcs_table() const; }; } // namespace srsran diff --git a/lib/src/common/phy_cfg_nr.cc b/lib/src/common/phy_cfg_nr.cc index 335b10778..98433d21f 100644 --- a/lib/src/common/phy_cfg_nr.cc +++ b/lib/src/common/phy_cfg_nr.cc @@ -367,9 +367,4 @@ srsran_ssb_cfg_t phy_cfg_nr_t::get_ssb_cfg() const return ssb_cfg; } -srsran_mcs_table_t phy_cfg_nr_t::get_mcs_table() const -{ - return pdsch.mcs_table; -} - } // namespace srsran diff --git a/srsgnb/src/stack/rrc/cell_asn1_config.cc b/srsgnb/src/stack/rrc/cell_asn1_config.cc index a1f98f3bd..5acd6d346 100644 --- a/srsgnb/src/stack/rrc/cell_asn1_config.cc +++ b/srsgnb/src/stack/rrc/cell_asn1_config.cc @@ -137,15 +137,27 @@ int fill_csi_report_from_enb_cfg(const rrc_nr_cfg_t& cfg, csi_meas_cfg_s& csi_me csi_report.report_cfg_type.periodic().report_slot_cfg.set_slots80(); csi_report.report_cfg_type.periodic().pucch_csi_res_list.resize(1); csi_report.report_cfg_type.periodic().pucch_csi_res_list[0].ul_bw_part_id = 0; - csi_report.report_cfg_type.periodic().pucch_csi_res_list[0].pucch_res = 1; // was 17 in orig PCAP + csi_report.report_cfg_type.periodic().pucch_csi_res_list[0].pucch_res = + 17; // was 17 in orig PCAP, but code for NSA it was set to 1 csi_report.report_quant.set_cri_ri_pmi_cqi(); // Report freq config (optional) csi_report.report_freq_cfg_present = true; csi_report.report_freq_cfg.cqi_format_ind_present = true; - csi_report.report_freq_cfg.cqi_format_ind = csi_report_cfg_s::report_freq_cfg_s_::cqi_format_ind_opts::wideband_cqi; - csi_report.time_restrict_for_ch_meass = csi_report_cfg_s::time_restrict_for_ch_meass_opts::not_cfgured; - csi_report.time_restrict_for_interference_meass = + csi_report.report_freq_cfg.cqi_format_ind.value = + csi_report_cfg_s::report_freq_cfg_s_::cqi_format_ind_opts::wideband_cqi; + csi_report.report_freq_cfg.pmi_format_ind_present = true; + csi_report.report_freq_cfg.pmi_format_ind.value = + csi_report_cfg_s::report_freq_cfg_s_::pmi_format_ind_opts::wideband_pmi; + csi_report.time_restrict_for_ch_meass.value = csi_report_cfg_s::time_restrict_for_ch_meass_opts::not_cfgured; + csi_report.time_restrict_for_interference_meass.value = asn1::rrc_nr::csi_report_cfg_s::time_restrict_for_interference_meass_opts::not_cfgured; + csi_report.codebook_cfg_present = true; + auto& type1 = csi_report.codebook_cfg.codebook_type.set_type1(); + type1.sub_type.set_type_i_single_panel(); + type1.sub_type.type_i_single_panel().nr_of_ant_ports.set_two(); + type1.sub_type.type_i_single_panel().nr_of_ant_ports.two().two_tx_codebook_subset_restrict.from_number(0b111111); + type1.sub_type.type_i_single_panel().type_i_single_panel_ri_restrict.from_number(0x03); + type1.codebook_mode = 1; csi_report.group_based_beam_report.set_disabled(); // Skip CQI table (optional) csi_report.cqi_table_present = true; @@ -153,7 +165,7 @@ int fill_csi_report_from_enb_cfg(const rrc_nr_cfg_t& cfg, csi_meas_cfg_s& csi_me csi_report.subband_size = asn1::rrc_nr::csi_report_cfg_s::subband_size_opts::value1; if (cfg.cell_list[0].duplex_mode == SRSRAN_DUPLEX_MODE_FDD) { - csi_report.report_cfg_type.periodic().report_slot_cfg.slots80() = 5; + csi_report.report_cfg_type.periodic().report_slot_cfg.slots80() = 9; } else { csi_report.report_cfg_type.periodic().report_slot_cfg.slots80() = 7; } @@ -170,16 +182,17 @@ void fill_nzp_csi_rs_from_enb_cfg(const rrc_nr_cfg_t& cfg, csi_meas_cfg_s& csi_m auto& nzp_csi_res = csi_meas_cfg.nzp_csi_rs_res_to_add_mod_list; // item 0 nzp_csi_res[0].nzp_csi_rs_res_id = 0; - nzp_csi_res[0].res_map.freq_domain_alloc.set_row2(); - nzp_csi_res[0].res_map.freq_domain_alloc.row2().from_number(0b100000000000); - nzp_csi_res[0].res_map.nrof_ports = asn1::rrc_nr::csi_rs_res_map_s::nrof_ports_opts::p1; + nzp_csi_res[0].res_map.freq_domain_alloc.set_other(); + nzp_csi_res[0].res_map.freq_domain_alloc.other().from_number(0b100000); + nzp_csi_res[0].res_map.nrof_ports.value = asn1::rrc_nr::csi_rs_res_map_s::nrof_ports_opts::p2; nzp_csi_res[0].res_map.first_ofdm_symbol_in_time_domain = 4; - nzp_csi_res[0].res_map.cdm_type = asn1::rrc_nr::csi_rs_res_map_s::cdm_type_opts::no_cdm; + nzp_csi_res[0].res_map.cdm_type.value = asn1::rrc_nr::csi_rs_res_map_s::cdm_type_opts::fd_cdm2; nzp_csi_res[0].res_map.density.set_one(); - nzp_csi_res[0].res_map.freq_band.start_rb = 0; - nzp_csi_res[0].res_map.freq_band.nrof_rbs = 52; - nzp_csi_res[0].pwr_ctrl_offset = 0; - // Skip pwr_ctrl_offset_ss_present + nzp_csi_res[0].res_map.freq_band.start_rb = 0; + nzp_csi_res[0].res_map.freq_band.nrof_rbs = 52; + nzp_csi_res[0].pwr_ctrl_offset = 0; + nzp_csi_res[0].pwr_ctrl_offset_ss_present = true; + nzp_csi_res[0].pwr_ctrl_offset_ss.value = asn1::rrc_nr::nzp_csi_rs_res_s::pwr_ctrl_offset_ss_opts::db0; nzp_csi_res[0].scrambling_id = cfg.cell_list[0].phy_cell.cell_id; nzp_csi_res[0].periodicity_and_offset_present = true; nzp_csi_res[0].periodicity_and_offset.set_slots80(); @@ -192,7 +205,8 @@ void fill_nzp_csi_rs_from_enb_cfg(const rrc_nr_cfg_t& cfg, csi_meas_cfg_s& csi_m nzp_csi_res[1].nzp_csi_rs_res_id = 1; nzp_csi_res[1].res_map.freq_domain_alloc.set_row1(); nzp_csi_res[1].res_map.freq_domain_alloc.row1().from_number(0b0001); - nzp_csi_res[1].res_map.first_ofdm_symbol_in_time_domain = 4; + nzp_csi_res[1].res_map.nrof_ports.value = asn1::rrc_nr::csi_rs_res_map_s::nrof_ports_opts::p1; + nzp_csi_res[1].res_map.cdm_type.value = asn1::rrc_nr::csi_rs_res_map_s::cdm_type_opts::no_cdm; nzp_csi_res[1].res_map.density.set_three(); nzp_csi_res[1].periodicity_and_offset.set_slots40(); nzp_csi_res[1].periodicity_and_offset.slots40() = 11; @@ -200,8 +214,6 @@ void fill_nzp_csi_rs_from_enb_cfg(const rrc_nr_cfg_t& cfg, csi_meas_cfg_s& csi_m nzp_csi_res[2] = nzp_csi_res[1]; nzp_csi_res[2].nzp_csi_rs_res_id = 2; nzp_csi_res[2].res_map.first_ofdm_symbol_in_time_domain = 8; - nzp_csi_res[2].periodicity_and_offset.set_slots40(); - nzp_csi_res[2].periodicity_and_offset.slots40() = 11; // item 3 nzp_csi_res[3] = nzp_csi_res[1]; nzp_csi_res[3].nzp_csi_rs_res_id = 3; @@ -220,9 +232,9 @@ void fill_nzp_csi_rs_from_enb_cfg(const rrc_nr_cfg_t& cfg, csi_meas_cfg_s& csi_m nzp_csi_res[0].nzp_csi_rs_res_id = 0; nzp_csi_res[0].res_map.freq_domain_alloc.set_row2(); nzp_csi_res[0].res_map.freq_domain_alloc.row2().from_number(0b100000000000); - nzp_csi_res[0].res_map.nrof_ports = asn1::rrc_nr::csi_rs_res_map_s::nrof_ports_opts::p1; + nzp_csi_res[0].res_map.nrof_ports.value = asn1::rrc_nr::csi_rs_res_map_s::nrof_ports_opts::p1; nzp_csi_res[0].res_map.first_ofdm_symbol_in_time_domain = 4; - nzp_csi_res[0].res_map.cdm_type = asn1::rrc_nr::csi_rs_res_map_s::cdm_type_opts::no_cdm; + nzp_csi_res[0].res_map.cdm_type.value = asn1::rrc_nr::csi_rs_res_map_s::cdm_type_opts::no_cdm; nzp_csi_res[0].res_map.density.set_one(); nzp_csi_res[0].res_map.freq_band.start_rb = 0; nzp_csi_res[0].res_map.freq_band.nrof_rbs = 52; @@ -251,6 +263,7 @@ void fill_nzp_csi_rs_from_enb_cfg(const rrc_nr_cfg_t& cfg, csi_meas_cfg_s& csi_m nzp_csi_res_set[1].nzp_csi_rs_res[1] = 2; nzp_csi_res_set[1].nzp_csi_rs_res[2] = 3; nzp_csi_res_set[1].nzp_csi_rs_res[3] = 4; + nzp_csi_res_set[1].trs_info_present = true; // // Skip TRS info } else { csi_meas_cfg.nzp_csi_rs_res_set_to_add_mod_list.resize(1); @@ -291,6 +304,40 @@ void fill_csi_resource_cfg_to_add(const rrc_nr_cfg_t& cfg, csi_meas_cfg_s& csi_m } } +void fill_csi_im_resource_cfg_to_add(const rrc_nr_cfg_t& cfg, csi_meas_cfg_s& csi_meas_cfg) +{ + if (cfg.cell_list[0].duplex_mode == SRSRAN_DUPLEX_MODE_FDD) { + // csi-IM-ResourceToAddModList + csi_meas_cfg.csi_im_res_to_add_mod_list_present = true; + csi_meas_cfg.csi_im_res_to_add_mod_list.resize(1); + + auto& csi_im_res = csi_meas_cfg.csi_im_res_to_add_mod_list[0]; + csi_im_res.csi_im_res_id = 0; + csi_im_res.csi_im_res_elem_pattern_present = true; + // csi-im-resource pattern1 + auto& csi_res_pattern1 = csi_im_res.csi_im_res_elem_pattern.set_pattern1(); + csi_res_pattern1.subcarrier_location_p1.value = + csi_im_res_s::csi_im_res_elem_pattern_c_::pattern1_s_::subcarrier_location_p1_opts::s8; + csi_res_pattern1.symbol_location_p1 = 8; + // csi-im-resource freqBand + csi_im_res.freq_band_present = true; + csi_im_res.freq_band.start_rb = 0; + csi_im_res.freq_band.nrof_rbs = 52; + // csi-im-resource periodicity_and_offset + csi_im_res.periodicity_and_offset_present = true; + csi_im_res.periodicity_and_offset.set_slots80(); + csi_im_res.periodicity_and_offset.slots80() = 1; + + // csi-IM-ResourceSetToAddModList + csi_meas_cfg.csi_im_res_set_to_add_mod_list_present = true; + csi_meas_cfg.csi_im_res_set_to_add_mod_list.resize(1); + + auto& csi_im_res_set = csi_meas_cfg.csi_im_res_set_to_add_mod_list[0]; + csi_im_res_set.csi_im_res_set_id = 0; + csi_im_res_set.csi_im_res.push_back(0); + } +} + /// Fill CSI-MeasConfig with gNB config int fill_csi_meas_from_enb_cfg(const rrc_nr_cfg_t& cfg, csi_meas_cfg_s& csi_meas_cfg) { @@ -307,10 +354,10 @@ int fill_csi_meas_from_enb_cfg(const rrc_nr_cfg_t& cfg, csi_meas_cfg_s& csi_meas fill_nzp_csi_rs_from_enb_cfg(cfg, csi_meas_cfg); // CSI IM config - // TODO: add csi im config + fill_csi_im_resource_cfg_to_add(cfg, csi_meas_cfg); - // CSI resource config - // TODO: add csi resource config + // CSI report config + fill_csi_report_from_enb_cfg(cfg, csi_meas_cfg); return SRSRAN_SUCCESS; } @@ -887,8 +934,10 @@ int fill_master_cell_cfg_from_enb_cfg(const rrc_nr_cfg_t& cfg, uint32_t cc, asn1 // spCellConfig -- Need M out.sp_cell_cfg_present = true; fill_sp_cell_cfg_from_enb_cfg(cfg, cc, out.sp_cell_cfg); - out.sp_cell_cfg.recfg_with_sync_present = false; - out.sp_cell_cfg.sp_cell_cfg_ded.csi_meas_cfg_present = false; // Note: not supported + out.sp_cell_cfg.recfg_with_sync_present = false; + + /* Check if setting true is enough */ + out.sp_cell_cfg.sp_cell_cfg_ded.csi_meas_cfg_present = true; // Note: not supported return SRSRAN_SUCCESS; } diff --git a/srsgnb/src/stack/rrc/rrc_nr_ue.cc b/srsgnb/src/stack/rrc/rrc_nr_ue.cc index 5194867a1..b6c0716a8 100644 --- a/srsgnb/src/stack/rrc/rrc_nr_ue.cc +++ b/srsgnb/src/stack/rrc/rrc_nr_ue.cc @@ -1311,6 +1311,9 @@ int rrc_nr::ue::update_mac(const cell_group_cfg_s& cell_group_config, bool is_co } parent->mac->ue_cfg(rnti, uecfg); + + srsran::make_csi_cfg_from_serv_cell(cell_group_config.sp_cell_cfg.sp_cell_cfg_ded, &uecfg.phy_cfg.csi); + return SRSRAN_SUCCESS; } From b359c7b728b6cffa0a1ade4fb668f746f3b2cc69 Mon Sep 17 00:00:00 2001 From: Carlo Galiotto Date: Wed, 5 Jan 2022 12:36:15 +0100 Subject: [PATCH 10/15] sched,nr: add comments and rename variables Signed-off-by: Carlo Galiotto --- lib/include/srsran/phy/phch/ra_nr.h | 7 +++ lib/src/phy/phch/ra_nr.c | 84 ++++++++++++++--------------- 2 files changed, 49 insertions(+), 42 deletions(-) diff --git a/lib/include/srsran/phy/phch/ra_nr.h b/lib/include/srsran/phy/phch/ra_nr.h index 6227a92b7..8ea70b5b8 100644 --- a/lib/include/srsran/phy/phch/ra_nr.h +++ b/lib/include/srsran/phy/phch/ra_nr.h @@ -154,6 +154,9 @@ SRSRAN_API uint32_t srsran_ra_nr_type1_riv(uint32_t N_rb, uint32_t start_rb, uin * @brief Returns the MCS corresponding to CQI * * Mapping is performed as: return the MCS that has the closest spectral efficiency to that of the CQI + * + * @remark Implements mapping based on TS 38.214, MCS Tables 5.1.3.1-1, 5.1.3.1-2, 5.1.3.1-3 and CQI Tables 5.2.2.1-2, + * Table 5.2.2.1-3, 5.2.2.1-4 * @param cqi CQI value * @param cqi_table_idx CQI table index * @param mcs_table MCS table parameter @@ -173,6 +176,8 @@ SRSRAN_API int srsran_ra_nr_cqi_to_mcs(uint8_t cqi, * @brief Returns the Spectral Efficiency corresponding to CQI * * Mapping is performed as: return the MCS that has the closest spectral efficiency to that of the CQI + * + * @remark Implements mapping based on TS 38.214, CQI Tables 5.2.2.1-2, Table 5.2.2.1-3, 5.2.2.1-4 * @param cqi CQI value * @param cqi_table_idx CQI table index * @return The Spectral Efficiency @@ -183,6 +188,8 @@ SRSRAN_API double srsran_ra_nr_cqi_to_se(uint8_t cqi, srsran_csi_cqi_table_t cqi * @brief Returns the MCS corresponding to Spectral Efficiency * * Mapping is performed as: return the greatest MCS with an SE lower than or equal to target SE + * + * @remark Implements mapping based on TS 38.214, MCS Tables 5.1.3.1-1, 5.1.3.1-2, 5.1.3.1-3 * @param se_target Target Spectral efficiency to be mapped into MCS * @param mcs_table MCS table parameter * @param dci_format DCI format diff --git a/lib/src/phy/phch/ra_nr.c b/lib/src/phy/phch/ra_nr.c index f5e4e9b45..e0a8bec01 100644 --- a/lib/src/phy/phch/ra_nr.c +++ b/lib/src/phy/phch/ra_nr.c @@ -133,7 +133,7 @@ static const float ra_nr_beta_offset_csi_table[RA_NR_BETA_OFFSET_CSI_SIZE] = { 4.000f, 5.000f, 6.250f, 8.000f, 10.000f, 12.625f, 15.875f, 20.000f, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN}; -typedef enum { ra_nr_table_1 = 0, ra_nr_table_2, ra_nr_table_3 } ra_nr_table_t; +typedef enum { ra_nr_table_idx_1 = 0, ra_nr_table_idx_2, ra_nr_table_idx_3 } ra_nr_table_idx_t; /** * The table below performs the mapping of the CQI into the closest MCS, based on the corresponding spectral efficiency. @@ -149,7 +149,7 @@ typedef enum { ra_nr_table_1 = 0, ra_nr_table_2, ra_nr_table_3 } ra_nr_table_t; * MCS_table_idx: 1 -> Table 5.1.3.1-1; 2 -> Table 5.1.3.1-2; 3 -> Table 5.1.3.1-3 */ -static int ra_nr_cqi_to_mcs_table[3][3][RA_NR_CQI_TABLE_SIZE] = { +static const int ra_nr_cqi_to_mcs_table[3][3][RA_NR_CQI_TABLE_SIZE] = { /* ROW 1 - CQI Table 1 */ {/* MCS Table 1 */ {-1, 0, 0, 2, 4, 6, 8, 11, 13, 15, 18, 20, 22, 24, 26, 28}, /* MCS Table 2 */ {-1, 0, 0, 1, 2, 3, 4, 5, 7, 9, 11, 13, 15, 17, 19, 21}, @@ -165,7 +165,7 @@ static int ra_nr_cqi_to_mcs_table[3][3][RA_NR_CQI_TABLE_SIZE] = { /** * The CQI to Spectral efficiency table. - * The array ra_nr_cqi_to_se_table[CQI_table_idx][CQI] contains the Spectracl Efficiency corresponding to CQI, based on + * The array ra_nr_cqi_to_se_table[CQI_table_idx][CQI] contains the Spectral Efficiency corresponding to CQI, based on * the given CQI_table_idx: * CQI_table_idx: 1 -> Table 5.2.2.1-2; 2 -> Table 5.2.2.1-3, 3 -> Table 5.2.2.1-4 */ @@ -222,10 +222,10 @@ static const double ra_nr_cqi_to_se_table[3][RA_NR_CQI_TABLE_SIZE] = { 3.9023, 4.5234}}; -static ra_nr_table_t ra_nr_select_table_pusch_noprecoding(srsran_mcs_table_t mcs_table, - srsran_dci_format_nr_t dci_format, - srsran_search_space_type_t search_space_type, - srsran_rnti_type_t rnti_type) +static ra_nr_table_idx_t ra_nr_select_table_pusch_noprecoding(srsran_mcs_table_t mcs_table, + srsran_dci_format_nr_t dci_format, + srsran_search_space_type_t search_space_type, + srsran_rnti_type_t rnti_type) { // Non-implemented parameters bool mcs_c_rnti = false; @@ -235,7 +235,7 @@ static ra_nr_table_t ra_nr_select_table_pusch_noprecoding(srsran_mcs_table_t // - CRC scrambled by C-RNTI or SP-CSI-RNTI, if (mcs_table == srsran_mcs_table_256qam && dci_format == srsran_dci_format_nr_0_1 && (rnti_type == srsran_rnti_type_c || rnti_type == srsran_rnti_type_sp_csi)) { - return ra_nr_table_2; + return ra_nr_table_idx_2; } // - the UE is not configured with MCS-C-RNTI, @@ -245,14 +245,14 @@ static ra_nr_table_t ra_nr_select_table_pusch_noprecoding(srsran_mcs_table_t if (!mcs_c_rnti && mcs_table == srsran_mcs_table_qam64LowSE && dci_format != srsran_dci_format_nr_rar && search_space_type == srsran_search_space_type_ue && (rnti_type == srsran_rnti_type_c || rnti_type == srsran_rnti_type_sp_csi)) { - return ra_nr_table_3; + return ra_nr_table_idx_3; } // - the UE is configured with MCS-C-RNTI, and // - the PUSCH is scheduled by a PDCCH with // - CRC scrambled by MCS-C-RNTI, // if (mcs_c_rnti && dci_format != srsran_dci_format_nr_rar && rnti_type == srsran_rnti_type_mcs_c) { - // return ra_nr_table_3; + // return ra_nr_table_idx_3; // } // - mcs-Table in configuredGrantConfig is set to 'qam256', @@ -260,7 +260,7 @@ static ra_nr_table_t ra_nr_select_table_pusch_noprecoding(srsran_mcs_table_t // - if PUSCH is transmitted with configured grant // if (configured_grant_table == srsran_mcs_table_256qam && // (rnti_type == srsran_rnti_type_cs || dci_format == srsran_dci_format_nr_cg)) { - // return ra_nr_table_2; + // return ra_nr_table_idx_2; // } // - mcs-Table in configuredGrantConfig is set to 'qam64LowSE' @@ -268,23 +268,23 @@ static ra_nr_table_t ra_nr_select_table_pusch_noprecoding(srsran_mcs_table_t // - if PUSCH is transmitted with configured grant, // if (configured_grant_table == srsran_mcs_table_qam64LowSE && // (rnti_type == srsran_rnti_type_cs || dci_format == srsran_dci_format_nr_cg)) { - // return ra_nr_table_3; + // return ra_nr_table_idx_3; // } - return ra_nr_table_1; + return ra_nr_table_idx_1; } -static ra_nr_table_t ra_nr_select_table_pdsch(srsran_mcs_table_t mcs_table, - srsran_dci_format_nr_t dci_format, - srsran_search_space_type_t search_space_type, - srsran_rnti_type_t rnti_type) +static ra_nr_table_idx_t ra_nr_select_table_pdsch(srsran_mcs_table_t mcs_table, + srsran_dci_format_nr_t dci_format, + srsran_search_space_type_t search_space_type, + srsran_rnti_type_t rnti_type) { // - the higher layer parameter mcs-Table given by PDSCH-Config is set to 'qam256', and // - the PDSCH is scheduled by a PDCCH with DCI format 1_1 with // - CRC scrambled by C-RNTI if (mcs_table == srsran_mcs_table_256qam && dci_format == srsran_dci_format_nr_1_1 && rnti_type == srsran_rnti_type_c) { - return ra_nr_table_2; + return ra_nr_table_idx_2; } // the UE is not configured with MCS-C-RNTI, @@ -293,7 +293,7 @@ static ra_nr_table_t ra_nr_select_table_pdsch(srsran_mcs_table_t mcs_tab // CRC scrambled by C - RNTI if (mcs_table == srsran_mcs_table_qam64LowSE && search_space_type == srsran_search_space_type_ue && rnti_type == srsran_rnti_type_c) { - return ra_nr_table_3; + return ra_nr_table_idx_3; } // - the UE is not configured with the higher layer parameter mcs-Table given by SPS-Config, @@ -302,7 +302,7 @@ static ra_nr_table_t ra_nr_select_table_pdsch(srsran_mcs_table_t mcs_tab // - if the PDSCH is scheduled without corresponding PDCCH transmission using SPS-Config, // if (!sps_config_mcs_table_present && mcs_table == srsran_mcs_table_256qam && // ((dci_format == srsran_dci_format_nr_1_1 && rnti_type == srsran_rnti_type_cs) || (!is_pdcch_sps))) { - // return ra_nr_table_2; + // return ra_nr_table_idx_2; // } // - the UE is configured with the higher layer parameter mcs-Table given by SPS-Config set to 'qam64LowSE' @@ -310,17 +310,17 @@ static ra_nr_table_t ra_nr_select_table_pdsch(srsran_mcs_table_t mcs_tab // - if the PDSCH is scheduled without corresponding PDCCH transmission using SPS-Config, // if (sps_config_mcs_table_present && sps_config_mcs_table == srsran_mcs_table_qam64LowSE && // (rnti_type == srsran_rnti_type_cs || is_pdcch_sps)) { - // return ra_nr_table_3; + // return ra_nr_table_idx_3; // } // else - return ra_nr_table_1; + return ra_nr_table_idx_1; } -static ra_nr_table_t ra_nr_select_table(srsran_mcs_table_t mcs_table, - srsran_dci_format_nr_t dci_format, - srsran_search_space_type_t search_space_type, - srsran_rnti_type_t rnti_type) +static ra_nr_table_idx_t ra_nr_select_table(srsran_mcs_table_t mcs_table, + srsran_dci_format_nr_t dci_format, + srsran_search_space_type_t search_space_type, + srsran_rnti_type_t rnti_type) { // Check if it is a PUSCH transmission if (dci_format == srsran_dci_format_nr_0_0 || dci_format == srsran_dci_format_nr_0_1 || @@ -358,14 +358,14 @@ double srsran_ra_nr_R_from_mcs(srsran_mcs_table_t mcs_table, srsran_rnti_type_t rnti_type, uint32_t mcs_idx) { - ra_nr_table_t table = ra_nr_select_table(mcs_table, dci_format, search_space_type, rnti_type); + ra_nr_table_idx_t table = ra_nr_select_table(mcs_table, dci_format, search_space_type, rnti_type); switch (table) { - case ra_nr_table_1: + case ra_nr_table_idx_1: return srsran_ra_nr_R_from_mcs_table1(mcs_idx) / 1024.0; - case ra_nr_table_2: + case ra_nr_table_idx_2: return srsran_ra_nr_R_from_mcs_table2(mcs_idx) / 1024.0; - case ra_nr_table_3: + case ra_nr_table_idx_3: return srsran_ra_nr_R_from_mcs_table3(mcs_idx) / 1024.0; default: ERROR("Invalid table %d", table); @@ -380,14 +380,14 @@ srsran_mod_t srsran_ra_nr_mod_from_mcs(srsran_mcs_table_t mcs_table, srsran_rnti_type_t rnti_type, uint32_t mcs_idx) { - ra_nr_table_t table = ra_nr_select_table(mcs_table, dci_format, search_space_type, rnti_type); + ra_nr_table_idx_t table = ra_nr_select_table(mcs_table, dci_format, search_space_type, rnti_type); switch (table) { - case ra_nr_table_1: + case ra_nr_table_idx_1: return srsran_ra_nr_modulation_from_mcs_table1(mcs_idx); - case ra_nr_table_2: + case ra_nr_table_idx_2: return srsran_ra_nr_modulation_from_mcs_table2(mcs_idx); - case ra_nr_table_3: + case ra_nr_table_idx_3: return srsran_ra_nr_modulation_from_mcs_table3(mcs_idx); default: ERROR("Invalid table %d", table); @@ -1186,7 +1186,7 @@ int srsran_ra_nr_cqi_to_mcs(uint8_t cqi, return -1; } - ra_nr_table_t mcs_table_idx = ra_nr_select_table_pdsch(mcs_table, dci_format, search_space_type, rnti_type); + ra_nr_table_idx_t mcs_table_idx = ra_nr_select_table_pdsch(mcs_table, dci_format, search_space_type, rnti_type); return ra_nr_cqi_to_mcs_table[cqi_table_idx][mcs_table_idx][cqi]; } @@ -1243,21 +1243,21 @@ int srsran_ra_nr_se_to_mcs(double se_target, srsran_rnti_type_t rnti_type) { // Get MCS table index to be used - ra_nr_table_t mcs_table_idx = ra_nr_select_table_pdsch(mcs_table, dci_format, search_space_type, rnti_type); + ra_nr_table_idx_t mcs_table_idx = ra_nr_select_table_pdsch(mcs_table, dci_format, search_space_type, rnti_type); // Get MCS table and size based on mcs_table_idx const mcs_entry_t* mcs_se_table; size_t mcs_table_size; switch (mcs_table_idx) { - case ra_nr_table_1: + case ra_nr_table_idx_1: mcs_se_table = ra_nr_table1; mcs_table_size = RA_NR_MCS_SIZE_TABLE1; break; - case ra_nr_table_2: + case ra_nr_table_idx_2: mcs_se_table = ra_nr_table2; mcs_table_size = RA_NR_MCS_SIZE_TABLE2; break; - case ra_nr_table_3: + case ra_nr_table_idx_3: mcs_se_table = ra_nr_table3; mcs_table_size = RA_NR_MCS_SIZE_TABLE3; break; @@ -1276,7 +1276,7 @@ int srsran_ra_nr_se_to_mcs(double se_target, } // handle monotonicity oddity between MCS 16 and 17 for MCS table 1 - if (mcs_table_idx == ra_nr_table_1) { + if (mcs_table_idx == ra_nr_table_idx_1) { if (se_target == mcs_se_table[17].S) { return 17; } else if (se_target <= mcs_se_table[16].S && se_target > mcs_se_table[17].S) { @@ -1303,7 +1303,7 @@ int srsran_ra_nr_se_to_mcs(double se_target, else if (se_target < mcs_se_table[mid_point].S) { ub = mid_point; // handle monotonicity oddity between MCS 16 and 17 for MCS table 1 - if (mcs_table_idx == ra_nr_table_1 && ub == 17) { + if (mcs_table_idx == ra_nr_table_idx_1 && ub == 17) { ub = 16; } } @@ -1311,7 +1311,7 @@ int srsran_ra_nr_se_to_mcs(double se_target, else { /* se_target > mcs_se_table[mid_point].S ) */ lb = mid_point; // handle monotonicity oddity between MCS 16 and 17 for MCS table 1 - if (mcs_table_idx == ra_nr_table_1 && lb == 16) { + if (mcs_table_idx == ra_nr_table_idx_1 && lb == 16) { lb = 17; } } From d7e4018adfbc422fd42d8b00b548d7922c325022 Mon Sep 17 00:00:00 2001 From: Carlo Galiotto Date: Wed, 5 Jan 2022 14:10:35 +0100 Subject: [PATCH 11/15] sched: remove unused function Signed-off-by: Carlo Galiotto --- lib/src/phy/phch/ra_nr.c | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/lib/src/phy/phch/ra_nr.c b/lib/src/phy/phch/ra_nr.c index e0a8bec01..415fab60f 100644 --- a/lib/src/phy/phch/ra_nr.c +++ b/lib/src/phy/phch/ra_nr.c @@ -1201,41 +1201,6 @@ double srsran_ra_nr_cqi_to_se(uint8_t cqi, srsran_csi_cqi_table_t cqi_table_idx) return ra_nr_cqi_to_se_table[cqi_table_idx][cqi]; } -static inline int srsran_ra_nr_mcs_bin_search(double se, size_t mcs_table_size, const mcs_entry_t* mcs_se_table) -{ - if (mcs_se_table == NULL) { - ERROR("Missing MCS table pointer"); - return -1; - } - - if (se < mcs_se_table[0].S) { - return 0; - } else if (se > mcs_se_table[mcs_table_size - 1].S) { - return mcs_table_size - 1; - } - - size_t lb = 0; - size_t ub = mcs_table_size - 1; - while (ub > lb + 1) { - size_t mid_point = (size_t)floor(((double)(lb + ub)) / 2); - // break out of loop is there is an exact match - if (mcs_se_table[mid_point].S == se) { - ub = mid_point; - break; - } - // restrict the search to the left half of the vector - else if (se < mcs_se_table[mid_point].S) { - ub = mid_point; - } - // restrict the search to the right half of the vector - else { /* se > mcs_se_table[mid_point].S ) */ - lb = mid_point; - } - } - - return (int)ub; -} - int srsran_ra_nr_se_to_mcs(double se_target, srsran_mcs_table_t mcs_table, srsran_dci_format_nr_t dci_format, From 655fb7204f086a73e80e053f72d0b40e9ef0b75d Mon Sep 17 00:00:00 2001 From: Carlo Galiotto Date: Wed, 5 Jan 2022 17:06:58 +0100 Subject: [PATCH 12/15] rrc-nr: set CSI config for SA only Signed-off-by: Carlo Galiotto --- srsgnb/src/stack/rrc/cell_asn1_config.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/srsgnb/src/stack/rrc/cell_asn1_config.cc b/srsgnb/src/stack/rrc/cell_asn1_config.cc index 5acd6d346..1c5b056ab 100644 --- a/srsgnb/src/stack/rrc/cell_asn1_config.cc +++ b/srsgnb/src/stack/rrc/cell_asn1_config.cc @@ -937,7 +937,11 @@ int fill_master_cell_cfg_from_enb_cfg(const rrc_nr_cfg_t& cfg, uint32_t cc, asn1 out.sp_cell_cfg.recfg_with_sync_present = false; /* Check if setting true is enough */ - out.sp_cell_cfg.sp_cell_cfg_ded.csi_meas_cfg_present = true; // Note: not supported + if (cfg.is_standalone) { + out.sp_cell_cfg.sp_cell_cfg_ded.csi_meas_cfg_present = true; // Note: not supported + } else { + out.sp_cell_cfg.sp_cell_cfg_ded.csi_meas_cfg_present = false; // Note: not supported in NSA + } return SRSRAN_SUCCESS; } From 3d39f4b55f7edbcbbc686cfe180860583960d3b3 Mon Sep 17 00:00:00 2001 From: Carlo Galiotto Date: Wed, 5 Jan 2022 18:26:20 +0100 Subject: [PATCH 13/15] rrc-nr: remove unnecessary variable toggle Signed-off-by: Carlo Galiotto --- srsgnb/src/stack/rrc/cell_asn1_config.cc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/srsgnb/src/stack/rrc/cell_asn1_config.cc b/srsgnb/src/stack/rrc/cell_asn1_config.cc index 1c5b056ab..0605742ef 100644 --- a/srsgnb/src/stack/rrc/cell_asn1_config.cc +++ b/srsgnb/src/stack/rrc/cell_asn1_config.cc @@ -936,12 +936,6 @@ int fill_master_cell_cfg_from_enb_cfg(const rrc_nr_cfg_t& cfg, uint32_t cc, asn1 fill_sp_cell_cfg_from_enb_cfg(cfg, cc, out.sp_cell_cfg); out.sp_cell_cfg.recfg_with_sync_present = false; - /* Check if setting true is enough */ - if (cfg.is_standalone) { - out.sp_cell_cfg.sp_cell_cfg_ded.csi_meas_cfg_present = true; // Note: not supported - } else { - out.sp_cell_cfg.sp_cell_cfg_ded.csi_meas_cfg_present = false; // Note: not supported in NSA - } return SRSRAN_SUCCESS; } From 861648aa35fc6f53def52813213d819a9798af58 Mon Sep 17 00:00:00 2001 From: Carlo Galiotto Date: Wed, 5 Jan 2022 18:47:06 +0100 Subject: [PATCH 14/15] rrc-nr: differentiate SA csi_meas_cfg from NSA Signed-off-by: Carlo Galiotto --- srsgnb/src/stack/rrc/cell_asn1_config.cc | 416 +++++++++++++++-------- 1 file changed, 276 insertions(+), 140 deletions(-) diff --git a/srsgnb/src/stack/rrc/cell_asn1_config.cc b/srsgnb/src/stack/rrc/cell_asn1_config.cc index 0605742ef..e551ac522 100644 --- a/srsgnb/src/stack/rrc/cell_asn1_config.cc +++ b/srsgnb/src/stack/rrc/cell_asn1_config.cc @@ -125,49 +125,84 @@ void set_rach_cfg_common(const srsran_prach_cfg_t& prach_cfg, asn1::rrc_nr::rach /// Fill list of CSI-ReportConfig with gNB config int fill_csi_report_from_enb_cfg(const rrc_nr_cfg_t& cfg, csi_meas_cfg_s& csi_meas_cfg) { - csi_meas_cfg.csi_report_cfg_to_add_mod_list_present = true; - csi_meas_cfg.csi_report_cfg_to_add_mod_list.resize(1); - - auto& csi_report = csi_meas_cfg.csi_report_cfg_to_add_mod_list[0]; - csi_report.report_cfg_id = 0; - csi_report.res_for_ch_meas = 0; - csi_report.csi_im_res_for_interference_present = true; - csi_report.csi_im_res_for_interference = 1; - csi_report.report_cfg_type.set_periodic(); - csi_report.report_cfg_type.periodic().report_slot_cfg.set_slots80(); - csi_report.report_cfg_type.periodic().pucch_csi_res_list.resize(1); - csi_report.report_cfg_type.periodic().pucch_csi_res_list[0].ul_bw_part_id = 0; - csi_report.report_cfg_type.periodic().pucch_csi_res_list[0].pucch_res = - 17; // was 17 in orig PCAP, but code for NSA it was set to 1 - csi_report.report_quant.set_cri_ri_pmi_cqi(); - // Report freq config (optional) - csi_report.report_freq_cfg_present = true; - csi_report.report_freq_cfg.cqi_format_ind_present = true; - csi_report.report_freq_cfg.cqi_format_ind.value = - csi_report_cfg_s::report_freq_cfg_s_::cqi_format_ind_opts::wideband_cqi; - csi_report.report_freq_cfg.pmi_format_ind_present = true; - csi_report.report_freq_cfg.pmi_format_ind.value = - csi_report_cfg_s::report_freq_cfg_s_::pmi_format_ind_opts::wideband_pmi; - csi_report.time_restrict_for_ch_meass.value = csi_report_cfg_s::time_restrict_for_ch_meass_opts::not_cfgured; - csi_report.time_restrict_for_interference_meass.value = - asn1::rrc_nr::csi_report_cfg_s::time_restrict_for_interference_meass_opts::not_cfgured; - csi_report.codebook_cfg_present = true; - auto& type1 = csi_report.codebook_cfg.codebook_type.set_type1(); - type1.sub_type.set_type_i_single_panel(); - type1.sub_type.type_i_single_panel().nr_of_ant_ports.set_two(); - type1.sub_type.type_i_single_panel().nr_of_ant_ports.two().two_tx_codebook_subset_restrict.from_number(0b111111); - type1.sub_type.type_i_single_panel().type_i_single_panel_ri_restrict.from_number(0x03); - type1.codebook_mode = 1; - csi_report.group_based_beam_report.set_disabled(); - // Skip CQI table (optional) - csi_report.cqi_table_present = true; - csi_report.cqi_table = asn1::rrc_nr::csi_report_cfg_s::cqi_table_opts::table2; - csi_report.subband_size = asn1::rrc_nr::csi_report_cfg_s::subband_size_opts::value1; - - if (cfg.cell_list[0].duplex_mode == SRSRAN_DUPLEX_MODE_FDD) { - csi_report.report_cfg_type.periodic().report_slot_cfg.slots80() = 9; + if (cfg.is_standalone) { + csi_meas_cfg.csi_report_cfg_to_add_mod_list_present = true; + csi_meas_cfg.csi_report_cfg_to_add_mod_list.resize(1); + + auto& csi_report = csi_meas_cfg.csi_report_cfg_to_add_mod_list[0]; + csi_report.report_cfg_id = 0; + csi_report.res_for_ch_meas = 0; + csi_report.csi_im_res_for_interference_present = true; + csi_report.csi_im_res_for_interference = 1; + csi_report.report_cfg_type.set_periodic(); + csi_report.report_cfg_type.periodic().report_slot_cfg.set_slots80(); + csi_report.report_cfg_type.periodic().pucch_csi_res_list.resize(1); + csi_report.report_cfg_type.periodic().pucch_csi_res_list[0].ul_bw_part_id = 0; + csi_report.report_cfg_type.periodic().pucch_csi_res_list[0].pucch_res = + 17; // was 17 in orig PCAP, but code for NSA it was set to 1 + csi_report.report_quant.set_cri_ri_pmi_cqi(); + // Report freq config (optional) + csi_report.report_freq_cfg_present = true; + csi_report.report_freq_cfg.cqi_format_ind_present = true; + csi_report.report_freq_cfg.cqi_format_ind.value = + csi_report_cfg_s::report_freq_cfg_s_::cqi_format_ind_opts::wideband_cqi; + csi_report.report_freq_cfg.pmi_format_ind_present = true; + csi_report.report_freq_cfg.pmi_format_ind.value = + csi_report_cfg_s::report_freq_cfg_s_::pmi_format_ind_opts::wideband_pmi; + csi_report.time_restrict_for_ch_meass.value = csi_report_cfg_s::time_restrict_for_ch_meass_opts::not_cfgured; + csi_report.time_restrict_for_interference_meass.value = + asn1::rrc_nr::csi_report_cfg_s::time_restrict_for_interference_meass_opts::not_cfgured; + csi_report.codebook_cfg_present = true; + auto& type1 = csi_report.codebook_cfg.codebook_type.set_type1(); + type1.sub_type.set_type_i_single_panel(); + type1.sub_type.type_i_single_panel().nr_of_ant_ports.set_two(); + type1.sub_type.type_i_single_panel().nr_of_ant_ports.two().two_tx_codebook_subset_restrict.from_number(0b111111); + type1.sub_type.type_i_single_panel().type_i_single_panel_ri_restrict.from_number(0x03); + type1.codebook_mode = 1; + csi_report.group_based_beam_report.set_disabled(); + // Skip CQI table (optional) + csi_report.cqi_table_present = true; + csi_report.cqi_table = asn1::rrc_nr::csi_report_cfg_s::cqi_table_opts::table2; + csi_report.subband_size = asn1::rrc_nr::csi_report_cfg_s::subband_size_opts::value1; + + if (cfg.cell_list[0].duplex_mode == SRSRAN_DUPLEX_MODE_FDD) { + csi_report.report_cfg_type.periodic().report_slot_cfg.slots80() = 9; + } else { + csi_report.report_cfg_type.periodic().report_slot_cfg.slots80() = 7; + } } else { - csi_report.report_cfg_type.periodic().report_slot_cfg.slots80() = 7; + csi_meas_cfg.csi_report_cfg_to_add_mod_list_present = true; + csi_meas_cfg.csi_report_cfg_to_add_mod_list.resize(1); + + auto& csi_report = csi_meas_cfg.csi_report_cfg_to_add_mod_list[0]; + csi_report.report_cfg_id = 0; + csi_report.res_for_ch_meas = 0; + csi_report.csi_im_res_for_interference_present = true; + csi_report.csi_im_res_for_interference = 1; + csi_report.report_cfg_type.set_periodic(); + csi_report.report_cfg_type.periodic().report_slot_cfg.set_slots80(); + csi_report.report_cfg_type.periodic().pucch_csi_res_list.resize(1); + csi_report.report_cfg_type.periodic().pucch_csi_res_list[0].ul_bw_part_id = 0; + csi_report.report_cfg_type.periodic().pucch_csi_res_list[0].pucch_res = 1; // was 17 in orig PCAP + csi_report.report_quant.set_cri_ri_pmi_cqi(); + // Report freq config (optional) + csi_report.report_freq_cfg_present = true; + csi_report.report_freq_cfg.cqi_format_ind_present = true; + csi_report.report_freq_cfg.cqi_format_ind = csi_report_cfg_s::report_freq_cfg_s_::cqi_format_ind_opts::wideband_cqi; + csi_report.time_restrict_for_ch_meass = csi_report_cfg_s::time_restrict_for_ch_meass_opts::not_cfgured; + csi_report.time_restrict_for_interference_meass = + asn1::rrc_nr::csi_report_cfg_s::time_restrict_for_interference_meass_opts::not_cfgured; + csi_report.group_based_beam_report.set_disabled(); + // Skip CQI table (optional) + csi_report.cqi_table_present = true; + csi_report.cqi_table = asn1::rrc_nr::csi_report_cfg_s::cqi_table_opts::table2; + csi_report.subband_size = asn1::rrc_nr::csi_report_cfg_s::subband_size_opts::value1; + + if (cfg.cell_list[0].duplex_mode == SRSRAN_DUPLEX_MODE_FDD) { + csi_report.report_cfg_type.periodic().report_slot_cfg.slots80() = 5; + } else { + csi_report.report_cfg_type.periodic().report_slot_cfg.slots80() = 7; + } } return SRSRAN_SUCCESS; @@ -176,102 +211,201 @@ int fill_csi_report_from_enb_cfg(const rrc_nr_cfg_t& cfg, csi_meas_cfg_s& csi_me /// Fill lists of NZP-CSI-RS-Resource and NZP-CSI-RS-ResourceSet with gNB config void fill_nzp_csi_rs_from_enb_cfg(const rrc_nr_cfg_t& cfg, csi_meas_cfg_s& csi_meas_cfg) { - csi_meas_cfg.nzp_csi_rs_res_to_add_mod_list_present = true; - if (cfg.cell_list[0].duplex_mode == SRSRAN_DUPLEX_MODE_FDD) { - csi_meas_cfg.nzp_csi_rs_res_to_add_mod_list.resize(5); - auto& nzp_csi_res = csi_meas_cfg.nzp_csi_rs_res_to_add_mod_list; - // item 0 - nzp_csi_res[0].nzp_csi_rs_res_id = 0; - nzp_csi_res[0].res_map.freq_domain_alloc.set_other(); - nzp_csi_res[0].res_map.freq_domain_alloc.other().from_number(0b100000); - nzp_csi_res[0].res_map.nrof_ports.value = asn1::rrc_nr::csi_rs_res_map_s::nrof_ports_opts::p2; - nzp_csi_res[0].res_map.first_ofdm_symbol_in_time_domain = 4; - nzp_csi_res[0].res_map.cdm_type.value = asn1::rrc_nr::csi_rs_res_map_s::cdm_type_opts::fd_cdm2; - nzp_csi_res[0].res_map.density.set_one(); - nzp_csi_res[0].res_map.freq_band.start_rb = 0; - nzp_csi_res[0].res_map.freq_band.nrof_rbs = 52; - nzp_csi_res[0].pwr_ctrl_offset = 0; - nzp_csi_res[0].pwr_ctrl_offset_ss_present = true; - nzp_csi_res[0].pwr_ctrl_offset_ss.value = asn1::rrc_nr::nzp_csi_rs_res_s::pwr_ctrl_offset_ss_opts::db0; - nzp_csi_res[0].scrambling_id = cfg.cell_list[0].phy_cell.cell_id; - nzp_csi_res[0].periodicity_and_offset_present = true; - nzp_csi_res[0].periodicity_and_offset.set_slots80(); - nzp_csi_res[0].periodicity_and_offset.slots80() = 1; - // optional - nzp_csi_res[0].qcl_info_periodic_csi_rs_present = true; - nzp_csi_res[0].qcl_info_periodic_csi_rs = 0; - // item 1 - nzp_csi_res[1] = nzp_csi_res[0]; - nzp_csi_res[1].nzp_csi_rs_res_id = 1; - nzp_csi_res[1].res_map.freq_domain_alloc.set_row1(); - nzp_csi_res[1].res_map.freq_domain_alloc.row1().from_number(0b0001); - nzp_csi_res[1].res_map.nrof_ports.value = asn1::rrc_nr::csi_rs_res_map_s::nrof_ports_opts::p1; - nzp_csi_res[1].res_map.cdm_type.value = asn1::rrc_nr::csi_rs_res_map_s::cdm_type_opts::no_cdm; - nzp_csi_res[1].res_map.density.set_three(); - nzp_csi_res[1].periodicity_and_offset.set_slots40(); - nzp_csi_res[1].periodicity_and_offset.slots40() = 11; - // item 2 - nzp_csi_res[2] = nzp_csi_res[1]; - nzp_csi_res[2].nzp_csi_rs_res_id = 2; - nzp_csi_res[2].res_map.first_ofdm_symbol_in_time_domain = 8; - // item 3 - nzp_csi_res[3] = nzp_csi_res[1]; - nzp_csi_res[3].nzp_csi_rs_res_id = 3; - nzp_csi_res[3].res_map.first_ofdm_symbol_in_time_domain = 4; - nzp_csi_res[3].periodicity_and_offset.set_slots40(); - nzp_csi_res[3].periodicity_and_offset.slots40() = 12; - // item 4 - nzp_csi_res[4] = nzp_csi_res[1]; - nzp_csi_res[4].nzp_csi_rs_res_id = 4; - nzp_csi_res[4].res_map.first_ofdm_symbol_in_time_domain = 8; - nzp_csi_res[4].periodicity_and_offset.set_slots40(); - nzp_csi_res[4].periodicity_and_offset.slots40() = 12; - } else { - csi_meas_cfg.nzp_csi_rs_res_to_add_mod_list.resize(1); - auto& nzp_csi_res = csi_meas_cfg.nzp_csi_rs_res_to_add_mod_list; - nzp_csi_res[0].nzp_csi_rs_res_id = 0; - nzp_csi_res[0].res_map.freq_domain_alloc.set_row2(); - nzp_csi_res[0].res_map.freq_domain_alloc.row2().from_number(0b100000000000); - nzp_csi_res[0].res_map.nrof_ports.value = asn1::rrc_nr::csi_rs_res_map_s::nrof_ports_opts::p1; - nzp_csi_res[0].res_map.first_ofdm_symbol_in_time_domain = 4; - nzp_csi_res[0].res_map.cdm_type.value = asn1::rrc_nr::csi_rs_res_map_s::cdm_type_opts::no_cdm; - nzp_csi_res[0].res_map.density.set_one(); - nzp_csi_res[0].res_map.freq_band.start_rb = 0; - nzp_csi_res[0].res_map.freq_band.nrof_rbs = 52; - nzp_csi_res[0].pwr_ctrl_offset = 0; - // Skip pwr_ctrl_offset_ss_present - nzp_csi_res[0].periodicity_and_offset_present = true; - nzp_csi_res[0].periodicity_and_offset.set_slots80() = 0; - // optional - nzp_csi_res[0].qcl_info_periodic_csi_rs_present = true; - nzp_csi_res[0].qcl_info_periodic_csi_rs = 0; - } + if (cfg.is_standalone) { + csi_meas_cfg.nzp_csi_rs_res_to_add_mod_list_present = true; + if (cfg.cell_list[0].duplex_mode == SRSRAN_DUPLEX_MODE_FDD) { + csi_meas_cfg.nzp_csi_rs_res_to_add_mod_list.resize(5); + auto& nzp_csi_res = csi_meas_cfg.nzp_csi_rs_res_to_add_mod_list; + // item 0 + nzp_csi_res[0].nzp_csi_rs_res_id = 0; + nzp_csi_res[0].res_map.freq_domain_alloc.set_other(); + nzp_csi_res[0].res_map.freq_domain_alloc.other().from_number(0b100000); + nzp_csi_res[0].res_map.nrof_ports.value = asn1::rrc_nr::csi_rs_res_map_s::nrof_ports_opts::p2; + nzp_csi_res[0].res_map.first_ofdm_symbol_in_time_domain = 4; + nzp_csi_res[0].res_map.cdm_type.value = asn1::rrc_nr::csi_rs_res_map_s::cdm_type_opts::fd_cdm2; + nzp_csi_res[0].res_map.density.set_one(); + nzp_csi_res[0].res_map.freq_band.start_rb = 0; + nzp_csi_res[0].res_map.freq_band.nrof_rbs = 52; + nzp_csi_res[0].pwr_ctrl_offset = 0; + nzp_csi_res[0].pwr_ctrl_offset_ss_present = true; + nzp_csi_res[0].pwr_ctrl_offset_ss.value = asn1::rrc_nr::nzp_csi_rs_res_s::pwr_ctrl_offset_ss_opts::db0; + nzp_csi_res[0].scrambling_id = cfg.cell_list[0].phy_cell.cell_id; + nzp_csi_res[0].periodicity_and_offset_present = true; + nzp_csi_res[0].periodicity_and_offset.set_slots80(); + nzp_csi_res[0].periodicity_and_offset.slots80() = 1; + // optional + nzp_csi_res[0].qcl_info_periodic_csi_rs_present = true; + nzp_csi_res[0].qcl_info_periodic_csi_rs = 0; + // item 1 + nzp_csi_res[1] = nzp_csi_res[0]; + nzp_csi_res[1].nzp_csi_rs_res_id = 1; + nzp_csi_res[1].res_map.freq_domain_alloc.set_row1(); + nzp_csi_res[1].res_map.freq_domain_alloc.row1().from_number(0b0001); + nzp_csi_res[1].res_map.nrof_ports.value = asn1::rrc_nr::csi_rs_res_map_s::nrof_ports_opts::p1; + nzp_csi_res[1].res_map.cdm_type.value = asn1::rrc_nr::csi_rs_res_map_s::cdm_type_opts::no_cdm; + nzp_csi_res[1].res_map.density.set_three(); + nzp_csi_res[1].periodicity_and_offset.set_slots40(); + nzp_csi_res[1].periodicity_and_offset.slots40() = 11; + // item 2 + nzp_csi_res[2] = nzp_csi_res[1]; + nzp_csi_res[2].nzp_csi_rs_res_id = 2; + nzp_csi_res[2].res_map.first_ofdm_symbol_in_time_domain = 8; + // item 3 + nzp_csi_res[3] = nzp_csi_res[1]; + nzp_csi_res[3].nzp_csi_rs_res_id = 3; + nzp_csi_res[3].res_map.first_ofdm_symbol_in_time_domain = 4; + nzp_csi_res[3].periodicity_and_offset.set_slots40(); + nzp_csi_res[3].periodicity_and_offset.slots40() = 12; + // item 4 + nzp_csi_res[4] = nzp_csi_res[1]; + nzp_csi_res[4].nzp_csi_rs_res_id = 4; + nzp_csi_res[4].res_map.first_ofdm_symbol_in_time_domain = 8; + nzp_csi_res[4].periodicity_and_offset.set_slots40(); + nzp_csi_res[4].periodicity_and_offset.slots40() = 12; + } else { + csi_meas_cfg.nzp_csi_rs_res_to_add_mod_list.resize(1); + auto& nzp_csi_res = csi_meas_cfg.nzp_csi_rs_res_to_add_mod_list; + nzp_csi_res[0].nzp_csi_rs_res_id = 0; + nzp_csi_res[0].res_map.freq_domain_alloc.set_row2(); + nzp_csi_res[0].res_map.freq_domain_alloc.row2().from_number(0b100000000000); + nzp_csi_res[0].res_map.nrof_ports.value = asn1::rrc_nr::csi_rs_res_map_s::nrof_ports_opts::p1; + nzp_csi_res[0].res_map.first_ofdm_symbol_in_time_domain = 4; + nzp_csi_res[0].res_map.cdm_type.value = asn1::rrc_nr::csi_rs_res_map_s::cdm_type_opts::no_cdm; + nzp_csi_res[0].res_map.density.set_one(); + nzp_csi_res[0].res_map.freq_band.start_rb = 0; + nzp_csi_res[0].res_map.freq_band.nrof_rbs = 52; + nzp_csi_res[0].pwr_ctrl_offset = 0; + // Skip pwr_ctrl_offset_ss_present + nzp_csi_res[0].periodicity_and_offset_present = true; + nzp_csi_res[0].periodicity_and_offset.set_slots80() = 0; + // optional + nzp_csi_res[0].qcl_info_periodic_csi_rs_present = true; + nzp_csi_res[0].qcl_info_periodic_csi_rs = 0; + } - // Fill NZP-CSI Resource Sets - csi_meas_cfg.nzp_csi_rs_res_set_to_add_mod_list_present = true; - if (cfg.cell_list[0].duplex_mode == SRSRAN_DUPLEX_MODE_FDD) { - csi_meas_cfg.nzp_csi_rs_res_set_to_add_mod_list.resize(2); - auto& nzp_csi_res_set = csi_meas_cfg.nzp_csi_rs_res_set_to_add_mod_list; - // item 0 - nzp_csi_res_set[0].nzp_csi_res_set_id = 0; - nzp_csi_res_set[0].nzp_csi_rs_res.resize(1); - nzp_csi_res_set[0].nzp_csi_rs_res[0] = 0; - // item 1 - nzp_csi_res_set[1].nzp_csi_res_set_id = 1; - nzp_csi_res_set[1].nzp_csi_rs_res.resize(4); - nzp_csi_res_set[1].nzp_csi_rs_res[0] = 1; - nzp_csi_res_set[1].nzp_csi_rs_res[1] = 2; - nzp_csi_res_set[1].nzp_csi_rs_res[2] = 3; - nzp_csi_res_set[1].nzp_csi_rs_res[3] = 4; - nzp_csi_res_set[1].trs_info_present = true; - // // Skip TRS info + // Fill NZP-CSI Resource Sets + csi_meas_cfg.nzp_csi_rs_res_set_to_add_mod_list_present = true; + if (cfg.cell_list[0].duplex_mode == SRSRAN_DUPLEX_MODE_FDD) { + csi_meas_cfg.nzp_csi_rs_res_set_to_add_mod_list.resize(2); + auto& nzp_csi_res_set = csi_meas_cfg.nzp_csi_rs_res_set_to_add_mod_list; + // item 0 + nzp_csi_res_set[0].nzp_csi_res_set_id = 0; + nzp_csi_res_set[0].nzp_csi_rs_res.resize(1); + nzp_csi_res_set[0].nzp_csi_rs_res[0] = 0; + // item 1 + nzp_csi_res_set[1].nzp_csi_res_set_id = 1; + nzp_csi_res_set[1].nzp_csi_rs_res.resize(4); + nzp_csi_res_set[1].nzp_csi_rs_res[0] = 1; + nzp_csi_res_set[1].nzp_csi_rs_res[1] = 2; + nzp_csi_res_set[1].nzp_csi_rs_res[2] = 3; + nzp_csi_res_set[1].nzp_csi_rs_res[3] = 4; + nzp_csi_res_set[1].trs_info_present = true; + // // Skip TRS info + } else { + csi_meas_cfg.nzp_csi_rs_res_set_to_add_mod_list.resize(1); + auto& nzp_csi_res_set = csi_meas_cfg.nzp_csi_rs_res_set_to_add_mod_list; + nzp_csi_res_set[0].nzp_csi_res_set_id = 0; + nzp_csi_res_set[0].nzp_csi_rs_res.resize(1); + nzp_csi_res_set[0].nzp_csi_rs_res[0] = 0; + // Skip TRS info + } } else { - csi_meas_cfg.nzp_csi_rs_res_set_to_add_mod_list.resize(1); - auto& nzp_csi_res_set = csi_meas_cfg.nzp_csi_rs_res_set_to_add_mod_list; - nzp_csi_res_set[0].nzp_csi_res_set_id = 0; - nzp_csi_res_set[0].nzp_csi_rs_res.resize(1); - nzp_csi_res_set[0].nzp_csi_rs_res[0] = 0; - // Skip TRS info + csi_meas_cfg.nzp_csi_rs_res_to_add_mod_list_present = true; + if (cfg.cell_list[0].duplex_mode == SRSRAN_DUPLEX_MODE_FDD) { + csi_meas_cfg.nzp_csi_rs_res_to_add_mod_list.resize(5); + auto& nzp_csi_res = csi_meas_cfg.nzp_csi_rs_res_to_add_mod_list; + // item 0 + nzp_csi_res[0].nzp_csi_rs_res_id = 0; + nzp_csi_res[0].res_map.freq_domain_alloc.set_row2(); + nzp_csi_res[0].res_map.freq_domain_alloc.row2().from_number(0b100000000000); + nzp_csi_res[0].res_map.nrof_ports = asn1::rrc_nr::csi_rs_res_map_s::nrof_ports_opts::p1; + nzp_csi_res[0].res_map.first_ofdm_symbol_in_time_domain = 4; + nzp_csi_res[0].res_map.cdm_type = asn1::rrc_nr::csi_rs_res_map_s::cdm_type_opts::no_cdm; + nzp_csi_res[0].res_map.density.set_one(); + nzp_csi_res[0].res_map.freq_band.start_rb = 0; + nzp_csi_res[0].res_map.freq_band.nrof_rbs = 52; + nzp_csi_res[0].pwr_ctrl_offset = 0; + // Skip pwr_ctrl_offset_ss_present + nzp_csi_res[0].scrambling_id = cfg.cell_list[0].phy_cell.cell_id; + nzp_csi_res[0].periodicity_and_offset_present = true; + nzp_csi_res[0].periodicity_and_offset.set_slots80(); + nzp_csi_res[0].periodicity_and_offset.slots80() = 1; + // optional + nzp_csi_res[0].qcl_info_periodic_csi_rs_present = true; + nzp_csi_res[0].qcl_info_periodic_csi_rs = 0; + // item 1 + nzp_csi_res[1] = nzp_csi_res[0]; + nzp_csi_res[1].nzp_csi_rs_res_id = 1; + nzp_csi_res[1].res_map.freq_domain_alloc.set_row1(); + nzp_csi_res[1].res_map.freq_domain_alloc.row1().from_number(0b0001); + nzp_csi_res[1].res_map.first_ofdm_symbol_in_time_domain = 4; + nzp_csi_res[1].res_map.density.set_three(); + nzp_csi_res[1].periodicity_and_offset.set_slots40(); + nzp_csi_res[1].periodicity_and_offset.slots40() = 11; + // item 2 + nzp_csi_res[2] = nzp_csi_res[1]; + nzp_csi_res[2].nzp_csi_rs_res_id = 2; + nzp_csi_res[2].res_map.first_ofdm_symbol_in_time_domain = 8; + nzp_csi_res[2].periodicity_and_offset.set_slots40(); + nzp_csi_res[2].periodicity_and_offset.slots40() = 11; + // item 3 + nzp_csi_res[3] = nzp_csi_res[1]; + nzp_csi_res[3].nzp_csi_rs_res_id = 3; + nzp_csi_res[3].res_map.first_ofdm_symbol_in_time_domain = 4; + nzp_csi_res[3].periodicity_and_offset.set_slots40(); + nzp_csi_res[3].periodicity_and_offset.slots40() = 12; + // item 4 + nzp_csi_res[4] = nzp_csi_res[1]; + nzp_csi_res[4].nzp_csi_rs_res_id = 4; + nzp_csi_res[4].res_map.first_ofdm_symbol_in_time_domain = 8; + nzp_csi_res[4].periodicity_and_offset.set_slots40(); + nzp_csi_res[4].periodicity_and_offset.slots40() = 12; + } else { + csi_meas_cfg.nzp_csi_rs_res_to_add_mod_list.resize(1); + auto& nzp_csi_res = csi_meas_cfg.nzp_csi_rs_res_to_add_mod_list; + nzp_csi_res[0].nzp_csi_rs_res_id = 0; + nzp_csi_res[0].res_map.freq_domain_alloc.set_row2(); + nzp_csi_res[0].res_map.freq_domain_alloc.row2().from_number(0b100000000000); + nzp_csi_res[0].res_map.nrof_ports = asn1::rrc_nr::csi_rs_res_map_s::nrof_ports_opts::p1; + nzp_csi_res[0].res_map.first_ofdm_symbol_in_time_domain = 4; + nzp_csi_res[0].res_map.cdm_type = asn1::rrc_nr::csi_rs_res_map_s::cdm_type_opts::no_cdm; + nzp_csi_res[0].res_map.density.set_one(); + nzp_csi_res[0].res_map.freq_band.start_rb = 0; + nzp_csi_res[0].res_map.freq_band.nrof_rbs = 52; + nzp_csi_res[0].pwr_ctrl_offset = 0; + // Skip pwr_ctrl_offset_ss_present + nzp_csi_res[0].periodicity_and_offset_present = true; + nzp_csi_res[0].periodicity_and_offset.set_slots80() = 0; + // optional + nzp_csi_res[0].qcl_info_periodic_csi_rs_present = true; + nzp_csi_res[0].qcl_info_periodic_csi_rs = 0; + } + + // Fill NZP-CSI Resource Sets + csi_meas_cfg.nzp_csi_rs_res_set_to_add_mod_list_present = true; + if (cfg.cell_list[0].duplex_mode == SRSRAN_DUPLEX_MODE_FDD) { + csi_meas_cfg.nzp_csi_rs_res_set_to_add_mod_list.resize(2); + auto& nzp_csi_res_set = csi_meas_cfg.nzp_csi_rs_res_set_to_add_mod_list; + // item 0 + nzp_csi_res_set[0].nzp_csi_res_set_id = 0; + nzp_csi_res_set[0].nzp_csi_rs_res.resize(1); + nzp_csi_res_set[0].nzp_csi_rs_res[0] = 0; + // item 1 + nzp_csi_res_set[1].nzp_csi_res_set_id = 1; + nzp_csi_res_set[1].nzp_csi_rs_res.resize(4); + nzp_csi_res_set[1].nzp_csi_rs_res[0] = 1; + nzp_csi_res_set[1].nzp_csi_rs_res[1] = 2; + nzp_csi_res_set[1].nzp_csi_rs_res[2] = 3; + nzp_csi_res_set[1].nzp_csi_rs_res[3] = 4; + // // Skip TRS info + } else { + csi_meas_cfg.nzp_csi_rs_res_set_to_add_mod_list.resize(1); + auto& nzp_csi_res_set = csi_meas_cfg.nzp_csi_rs_res_set_to_add_mod_list; + nzp_csi_res_set[0].nzp_csi_res_set_id = 0; + nzp_csi_res_set[0].nzp_csi_rs_res.resize(1); + nzp_csi_res_set[0].nzp_csi_rs_res[0] = 0; + // Skip TRS info + } } } @@ -353,11 +487,13 @@ int fill_csi_meas_from_enb_cfg(const rrc_nr_cfg_t& cfg, csi_meas_cfg_s& csi_meas // Fill NZP-CSI Resources fill_nzp_csi_rs_from_enb_cfg(cfg, csi_meas_cfg); - // CSI IM config - fill_csi_im_resource_cfg_to_add(cfg, csi_meas_cfg); + if (cfg.is_standalone) { + // CSI IM config + fill_csi_im_resource_cfg_to_add(cfg, csi_meas_cfg); - // CSI report config - fill_csi_report_from_enb_cfg(cfg, csi_meas_cfg); + // CSI report config + fill_csi_report_from_enb_cfg(cfg, csi_meas_cfg); + } return SRSRAN_SUCCESS; } From bab0b488be9a60c35dd1650d11afa1ff9d2108bc Mon Sep 17 00:00:00 2001 From: Carlo Galiotto Date: Thu, 6 Jan 2022 15:41:45 +0100 Subject: [PATCH 15/15] rrc-nr: disable csi_meas_config The current configuration makes the PUCCH decoding fail. We need to investigate the reason for this befoer we re-enable it Signed-off-by: Carlo Galiotto --- srsgnb/src/stack/rrc/cell_asn1_config.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/srsgnb/src/stack/rrc/cell_asn1_config.cc b/srsgnb/src/stack/rrc/cell_asn1_config.cc index e551ac522..9088dee5c 100644 --- a/srsgnb/src/stack/rrc/cell_asn1_config.cc +++ b/srsgnb/src/stack/rrc/cell_asn1_config.cc @@ -1072,6 +1072,8 @@ int fill_master_cell_cfg_from_enb_cfg(const rrc_nr_cfg_t& cfg, uint32_t cc, asn1 fill_sp_cell_cfg_from_enb_cfg(cfg, cc, out.sp_cell_cfg); out.sp_cell_cfg.recfg_with_sync_present = false; + // The current CSI config make the PUCCH decoding fail. We temporarily disable it until further investigation + out.sp_cell_cfg.sp_cell_cfg_ded.csi_meas_cfg_present = false; return SRSRAN_SUCCESS; }