diff --git a/common/5g_platform_types.h b/common/5g_platform_types.h index b46490a2e8..4ed7f33e47 100644 --- a/common/5g_platform_types.h +++ b/common/5g_platform_types.h @@ -55,4 +55,53 @@ typedef enum { typedef enum { NON_DYNAMIC, DYNAMIC } fiveQI_t; +/* QoS Priority Level */ +typedef enum { + QOS_PRIORITY_SPARE = 0, + QOS_PRIORITY_HIGHEST, + QOS_PRIORITY_2, + QOS_PRIORITY_3, + QOS_PRIORITY_4, + QOS_PRIORITY_5, + QOS_PRIORITY_6, + QOS_PRIORITY_7, + QOS_PRIORITY_8, + QOS_PRIORITY_9, + QOS_PRIORITY_10, + QOS_PRIORITY_11, + QOS_PRIORITY_12, + QOS_PRIORITY_13, + QOS_PRIORITY_LOWEST, + QOS_NO_PRIORITY +} qos_priority_t; + +/* Pre-emption Capability */ +typedef enum { + PEC_SHALL_NOT_TRIGGER_PREEMPTION = 0, + PEC_MAY_TRIGGER_PREEMPTION, + PEC_MAX, +} qos_pec_t; + +/* Pre-emption Vulnerability */ +typedef enum { + PEV_NOT_PREEMPTABLE = 0, + PEV_PREEMPTABLE = 1, + PEV_MAX, +} qos_pev_t; + +/* Allocation Retention Priority */ +typedef struct { + qos_priority_t priority_level; + qos_pec_t pre_emp_capability; + qos_pev_t pre_emp_vulnerability; +} qos_arp_t; + +typedef struct pdusession_level_qos_parameter_s { + uint8_t qfi; + uint64_t fiveQI; + uint64_t qos_priority; + fiveQI_t fiveQI_type; + qos_arp_t arp; +} pdusession_level_qos_parameter_t; + #endif diff --git a/openair2/COMMON/ngap_messages_types.h b/openair2/COMMON/ngap_messages_types.h index a07f798005..1c5fa90868 100644 --- a/openair2/COMMON/ngap_messages_types.h +++ b/openair2/COMMON/ngap_messages_types.h @@ -139,43 +139,6 @@ typedef struct ngap_ambr_s { bitrate_t br_dl; } ngap_ambr_t; -typedef enum ngap_priority_level_s { - NGAP_PRIORITY_LEVEL_SPARE = 0, - NGAP_PRIORITY_LEVEL_HIGHEST = 1, - NGAP_PRIORITY_LEVEL_2 = 2, - NGAP_PRIORITY_LEVEL_3 = 3, - NGAP_PRIORITY_LEVEL_4 = 4, - NGAP_PRIORITY_LEVEL_5 = 5, - NGAP_PRIORITY_LEVEL_6 = 6, - NGAP_PRIORITY_LEVEL_7 = 7, - NGAP_PRIORITY_LEVEL_8 = 8, - NGAP_PRIORITY_LEVEL_9 = 9, - NGAP_PRIORITY_LEVEL_10 = 10, - NGAP_PRIORITY_LEVEL_11 = 11, - NGAP_PRIORITY_LEVEL_12 = 12, - NGAP_PRIORITY_LEVEL_13 = 13, - NGAP_PRIORITY_LEVEL_LOWEST = 14, - NGAP_PRIORITY_LEVEL_NO_PRIORITY = 15 -} ngap_priority_level_t; - -typedef enum ngap_pre_emp_capability_e { - NGAP_PRE_EMPTION_CAPABILITY_SHALL_NOT_TRIGGER_PREEMPTION = 0, - NGAP_PRE_EMPTION_CAPABILITY_MAY_TRIGGER_PREEMPTION = 1, - NGAP_PRE_EMPTION_CAPABILITY_MAX, -} ngap_pre_emp_capability_t; - -typedef enum ngap_pre_emp_vulnerability_e { - NGAP_PRE_EMPTION_VULNERABILITY_NOT_PREEMPTABLE = 0, - NGAP_PRE_EMPTION_VULNERABILITY_PREEMPTABLE = 1, - NGAP_PRE_EMPTION_VULNERABILITY_MAX, -} ngap_pre_emp_vulnerability_t; - -typedef struct ngap_allocation_retention_priority_s { - ngap_priority_level_t priority_level; - ngap_pre_emp_capability_t pre_emp_capability; - ngap_pre_emp_vulnerability_t pre_emp_vulnerability; -} ngap_allocation_retention_priority_t; - typedef struct ngap_security_capabilities_s { uint16_t nRencryption_algorithms; uint16_t nRintegrity_algorithms; @@ -203,14 +166,6 @@ typedef enum ngap_rrc_establishment_cause_e { NGAP_RRC_CAUSE_LAST } ngap_rrc_establishment_cause_t; -typedef struct pdusession_level_qos_parameter_s { - uint8_t qfi; - uint64_t fiveQI; - uint64_t qos_priority; - fiveQI_t fiveQI_type; - ngap_allocation_retention_priority_t allocation_retention_priority; -} pdusession_level_qos_parameter_t; - typedef struct fiveg_s_tmsi_s { uint16_t amf_set_id; uint8_t amf_pointer; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 5e95ad690a..6c1c80f30e 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -38,6 +38,7 @@ #include #include #include +#include "5g_platform_types.h" #include "openair2/RRC/NR/nr_rrc_proto.h" #include "openair2/RRC/NR/rrc_gNB_UE_context.h" #include "openair3/SECU/key_nas_deriver.h" @@ -2464,13 +2465,11 @@ f1ap_qos_flow_param_t get_qos_char_from_qos_flow_param(const pdusession_level_qo qos_char.qos_type = NON_DYNAMIC; qos_char.nondyn.fiveQI = qos_param->fiveQI; } - const ngap_allocation_retention_priority_t *a = &qos_param->allocation_retention_priority; + const qos_arp_t *a = &qos_param->arp; qos_char.arp.prio = a->priority_level; - qos_char.arp.preempt_cap = a->pre_emp_capability == NGAP_PRE_EMPTION_CAPABILITY_MAY_TRIGGER_PREEMPTION - ? MAY_TRIGGER_PREEMPTION - : SHALL_NOT_TRIGGER_PREEMPTION; - qos_char.arp.preempt_vuln = - a->pre_emp_vulnerability == NGAP_PRE_EMPTION_VULNERABILITY_PREEMPTABLE ? PREEMPTABLE : NOT_PREEMPTABLE; + qos_char.arp.preempt_cap = + a->pre_emp_capability == PEC_MAY_TRIGGER_PREEMPTION ? MAY_TRIGGER_PREEMPTION : SHALL_NOT_TRIGGER_PREEMPTION; + qos_char.arp.preempt_vuln = a->pre_emp_vulnerability == PEV_PREEMPTABLE ? PREEMPTABLE : NOT_PREEMPTABLE; return qos_char; } diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index 4effc47935..7afc7afa23 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -368,11 +368,11 @@ bool trigger_bearer_setup(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, int n, pdusession qos_char->non_dynamic.qos_priority_level = qos_session->qos_priority; } - ngran_allocation_retention_priority_t *rent_priority = &qos_flow->qos_params.alloc_reten_priority; - ngap_allocation_retention_priority_t *rent_priority_in = &qos_session->allocation_retention_priority; - rent_priority->priority_level = rent_priority_in->priority_level; - rent_priority->preemption_capability = rent_priority_in->pre_emp_capability; - rent_priority->preemption_vulnerability = rent_priority_in->pre_emp_vulnerability; + ngran_allocation_retention_priority_t *arp_out = &qos_flow->qos_params.alloc_reten_priority; + qos_arp_t *arp_in = &qos_session->arp; + arp_out->priority_level = arp_in->priority_level; + arp_out->preemption_capability = arp_in->pre_emp_capability; + arp_out->preemption_vulnerability = arp_in->pre_emp_vulnerability; } } } diff --git a/openair3/NGAP/ngap_common.c b/openair3/NGAP/ngap_common.c index 9e3e2e9d13..c3865cff10 100644 --- a/openair3/NGAP/ngap_common.c +++ b/openair3/NGAP/ngap_common.c @@ -201,9 +201,9 @@ pdusession_level_qos_parameter_t fill_qos(uint8_t qfi, const NGAP_QosFlowLevelQo } // Allocation and Retention Priority const NGAP_AllocationAndRetentionPriority_t *arp = ¶ms->allocationAndRetentionPriority; - out.allocation_retention_priority.priority_level = arp->priorityLevelARP; - out.allocation_retention_priority.pre_emp_capability = arp->pre_emptionCapability; - out.allocation_retention_priority.pre_emp_vulnerability = arp->pre_emptionVulnerability; + out.arp.priority_level = arp->priorityLevelARP; + out.arp.pre_emp_capability = arp->pre_emptionCapability; + out.arp.pre_emp_vulnerability = arp->pre_emptionVulnerability; return out; }