pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-gprs/+/32642 )

Change subject: grr,bssgp,llc,sndcp: Define qos_params
......................................................................

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
---
M include/osmocom/gprs/llc/llc_prim.h
M include/osmocom/gprs/rlcmac/rlcmac_prim.h
M include/osmocom/gprs/sndcp/sndcp.h
M include/osmocom/gprs/sndcp/sndcp_prim.h
M src/gmm/gmm.c
M src/gmm/gmm_prim.c
6 files changed, 55 insertions(+), 16 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  laforge: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved




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 @@
                } 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 @@
                } 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 {
                        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 @@
        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 {
                        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 <stdint.h>
 #include <stddef.h>

+/* 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 {
                        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 {
                        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 @@
        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 @@
        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 @@
        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 @@
        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 @@
        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 @@
                        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;
        */

--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/32642
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: I6760bace69d400edd4576ec2820e29b74f8dfca5
Gerrit-Change-Number: 32642
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to