From ed7c99f6ba1add1c2d1f65895140a774fc5b9d88 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Fri, 5 May 2023 17:34:34 +0200 Subject: [PATCH] grr,bssgp,llc,sndcp: Define qos_params 3GPP TS 44.064 loosely defines "QoS params" on each primitive by listing the fields, which are a bit different on each primitive. Change-Id: I6760bace69d400edd4576ec2820e29b74f8dfca5 --- include/osmocom/gprs/llc/llc_prim.h | 30 ++++++++++++++++++----- include/osmocom/gprs/rlcmac/rlcmac_prim.h | 8 ++++-- include/osmocom/gprs/sndcp/sndcp.h | 3 +++ include/osmocom/gprs/sndcp/sndcp_prim.h | 6 +++-- src/gmm/gmm.c | 10 ++++---- src/gmm/gmm_prim.c | 2 +- 6 files changed, 43 insertions(+), 16 deletions(-) diff --git a/include/osmocom/gprs/llc/llc_prim.h b/include/osmocom/gprs/llc/llc_prim.h index a2b53cb..d5a424d 100644 --- a/include/osmocom/gprs/llc/llc_prim.h +++ b/include/osmocom/gprs/llc/llc_prim.h @@ -167,7 +167,12 @@ struct osmo_gprs_llc_ll_prim { } xid; /* OSMO_GPRS_LLC_LL_DATA | Req */ struct { - uint8_t qos_params[3]; + struct { + uint8_t peak_throughput; + /* SGSN-only: */ + uint8_t precedence_class; + uint8_t delay_class; + } qos_params; /* 3GPP TS 44.064 7.2.2.5 */ uint8_t reference; /* TODO: confirm type */ uint8_t radio_prio; /* only for the MS side */ } data_req; @@ -177,7 +182,13 @@ struct osmo_gprs_llc_ll_prim { } data_cnf; /* OSMO_GPRS_LLC_LL_UNITDATA | Req */ struct { - uint8_t qos_params[3]; + struct { + uint8_t reliability_class; + uint8_t peak_throughput; + /* SGSN-only: */ + uint8_t precedence_class; + uint8_t delay_class; + } qos_params; /* 3GPP TS 44.064 7.2.2.6 */ uint8_t radio_prio; /* only for the MS side */ bool apply_gea; /* Cipher */ bool apply_gia; /* Integrity Protection */ @@ -209,14 +220,17 @@ struct osmo_gprs_llc_grr_prim { struct { uint8_t sapi; uint8_t radio_prio; - uint8_t qos_params[3]; - + struct { + uint8_t peak_throughput; + } qos_params; /* 3GPP TS 44.064 7.2.3.1 */ } data_req; /* OSMO_GPRS_LLC_GRR_UNITDATA| Req */ struct { uint8_t sapi; uint8_t radio_prio; - uint8_t qos_params[3]; + struct { + uint8_t peak_throughput; + } qos_params; /* 3GPP TS 44.064 7.2.3.2 */ uint8_t cause; } unitdata_req; }; @@ -237,7 +251,11 @@ struct osmo_gprs_llc_bssgp_prim { union { /* OSMO_GPRS_LLC_BSSGP_DL_UNITDATA | Req */ struct { - uint8_t qos_params[3]; + struct { + uint8_t precedence_class; + uint8_t delay_class; + uint8_t peak_throughput; + } qos_params; /* 3GPP TS 44.064 7.2.4.1 */ bool rlc_confirm; uint8_t sapi; /* TODO: MOCN specific parameters: diff --git a/include/osmocom/gprs/rlcmac/rlcmac_prim.h b/include/osmocom/gprs/rlcmac/rlcmac_prim.h index 2d7a899..ae6c0d1 100644 --- a/include/osmocom/gprs/rlcmac/rlcmac_prim.h +++ b/include/osmocom/gprs/rlcmac/rlcmac_prim.h @@ -49,13 +49,17 @@ struct osmo_gprs_rlcmac_grr_prim { struct { uint8_t sapi; uint8_t radio_prio; - uint8_t qos_params[3]; + struct { + uint8_t peak_throughput; + } qos_params; /* 3GPP TS 44.064 7.2.3.1 */ } data_req; /* OSMO_GPRS_RLCMAC_GRR_UNITDATA | Req */ struct { uint8_t sapi; uint8_t radio_prio; - uint8_t qos_params[3]; + struct { + uint8_t peak_throughput; + } qos_params; /* 3GPP TS 44.064 7.2.3.2 */ uint8_t cause; } unitdata_req; }; diff --git a/include/osmocom/gprs/sndcp/sndcp.h b/include/osmocom/gprs/sndcp/sndcp.h index 8acf93f..f8c5485 100644 --- a/include/osmocom/gprs/sndcp/sndcp.h +++ b/include/osmocom/gprs/sndcp/sndcp.h @@ -5,6 +5,9 @@ #include #include +/* 3GPP TS 24.008 10.5.6.5 Quality of service */ +#define OSMO_GPRS_SNDCP_QOS_MAXLEN 22 + enum osmo_gprs_sndcp_location { OSMO_GPRS_SNDCP_LOCATION_UNSET, OSMO_GPRS_SNDCP_LOCATION_MS, diff --git a/include/osmocom/gprs/sndcp/sndcp_prim.h b/include/osmocom/gprs/sndcp/sndcp_prim.h index b19498f..bf8f90f 100644 --- a/include/osmocom/gprs/sndcp/sndcp_prim.h +++ b/include/osmocom/gprs/sndcp/sndcp_prim.h @@ -125,7 +125,8 @@ struct osmo_gprs_sndcp_snsm_prim { struct { uint8_t nsapi; uint8_t sapi; - uint8_t qos_params[3]; + uint8_t qos_profile[OSMO_GPRS_SNDCP_QOS_MAXLEN]; + uint8_t qos_profile_len; uint8_t radio_prio; } activate_ind; /* OSMO_GPRS_SNDCP_SNSM_ACTIVATE | Rsp */ @@ -147,7 +148,8 @@ struct osmo_gprs_sndcp_snsm_prim { struct { uint8_t nsapi; uint8_t sapi; - uint8_t qos_params[3]; + uint8_t qos_profile[OSMO_GPRS_SNDCP_QOS_MAXLEN]; + uint8_t qos_profile_len; uint8_t radio_prio; unsigned int tx_npdu_nr; unsigned int rx_npdu_nr; diff --git a/src/gmm/gmm.c b/src/gmm/gmm.c index faba983..c75a279 100644 --- a/src/gmm/gmm.c +++ b/src/gmm/gmm.c @@ -386,7 +386,7 @@ static int gprs_gmm_tx_id_resp(struct gprs_gmm_entity *gmme, llc_prim->ll.l3_pdu = msg->l3h; llc_prim->ll.l3_pdu_len = msgb_l3len(msg); /* TODO: - llc_prim->ll.qos_params[3]; + llc_prim->ll.qos_params.*; llc_prim->ll.radio_prio; llc_prim->ll.apply_gea; llc_prim->ll.apply_gia; @@ -420,7 +420,7 @@ int gprs_gmm_tx_ciph_auth_resp(const struct gprs_gmm_entity *gmme, const uint8_t llc_prim->ll.l3_pdu = msg->l3h; llc_prim->ll.l3_pdu_len = msgb_l3len(msg); /* TODO: - llc_prim->ll.qos_params[3]; + llc_prim->ll.qos_params.*; llc_prim->ll.radio_prio; llc_prim->ll.apply_gea; llc_prim->ll.apply_gia; @@ -457,7 +457,7 @@ int gprs_gmm_tx_att_req(struct gprs_gmm_entity *gmme, llc_prim->ll.l3_pdu = msg->l3h; llc_prim->ll.l3_pdu_len = msgb_l3len(msg); /* TODO: - llc_prim->ll.qos_params[3]; + llc_prim->ll.qos_params.*; llc_prim->ll.radio_prio; llc_prim->ll.apply_gea; llc_prim->ll.apply_gia; @@ -489,7 +489,7 @@ static int gprs_gmm_tx_att_compl(struct gprs_gmm_entity *gmme) llc_prim->ll.l3_pdu = msg->l3h; llc_prim->ll.l3_pdu_len = msgb_l3len(msg); /* TODO: - llc_prim->ll.qos_params[3]; + llc_prim->ll.qos_params.*; llc_prim->ll.radio_prio; llc_prim->ll.apply_gea; llc_prim->ll.apply_gia; @@ -523,7 +523,7 @@ int gprs_gmm_tx_detach_req(struct gprs_gmm_entity *gmme, llc_prim->ll.l3_pdu = msg->l3h; llc_prim->ll.l3_pdu_len = msgb_l3len(msg); /* TODO: - llc_prim->ll.qos_params[3]; + llc_prim->ll.qos_params.*; llc_prim->ll.radio_prio; llc_prim->ll.apply_gea; llc_prim->ll.apply_gia; diff --git a/src/gmm/gmm_prim.c b/src/gmm/gmm_prim.c index ed8fed6..af8f663 100644 --- a/src/gmm/gmm_prim.c +++ b/src/gmm/gmm_prim.c @@ -525,7 +525,7 @@ static int gprs_gmm_prim_handle_gmmsm_unitdata_req(struct osmo_gprs_gmm_prim *gm gmm_prim->gmmsm.unitdata_req.smpdu_len); llc_prim->ll.unitdata_req.radio_prio = gmme->radio_prio; /* TODO: - llc_prim->ll.qos_params[3]; + llc_prim->ll.qos_params.*; llc_prim->ll.apply_gea; llc_prim->ll.apply_gia; */