pespin has uploaded this change for review.

View Change

gmm: Introduce interface GMMBSSGP

This interface was not described in TS 24.007 like the rest, though some
references to it can be seen in that document in Annex C.

The interface is actually described in TS 48.018 5.3.

This commit only adds the skeleton with all the primitives, etc.
All the logic inside GMM layer implementation, and primitive specific fields,
is still missing.

Related: OS#5852
Change-Id: I39045833fd43cfe98cb1a3812fbce3fdcaae6dc6
---
M include/osmocom/gprs/gmm/gmm_prim.h
M include/osmocom/gprs/gmm/gmm_private.h
M src/gmm/gmm_prim.c
3 files changed, 274 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/24/37724/1
diff --git a/include/osmocom/gprs/gmm/gmm_prim.h b/include/osmocom/gprs/gmm/gmm_prim.h
index e066a15..e38e188 100644
--- a/include/osmocom/gprs/gmm/gmm_prim.h
+++ b/include/osmocom/gprs/gmm/gmm_prim.h
@@ -30,6 +30,7 @@
OSMO_GPRS_GMM_SAP_GMMRABM, /* UMTS only */
OSMO_GPRS_GMM_SAP_GMMSS,
OSMO_GPRS_GMM_SAP_GMMSS2,
+ OSMO_GPRS_GMM_SAP_GMMBSSGP, /* TS 48.018 5.3 */
};
extern const struct value_string osmo_gprs_gmm_prim_sap_names[];
static inline const char *osmo_gprs_gmm_prim_sap_name(enum osmo_gprs_gmm_prim_sap val)
@@ -197,6 +198,63 @@
};
};

+/* TS 48.018 Section 5.3 "GMM<->BSSGP"
+ * This interface wasn't described in TS 24.007 like the others, but can be seen
+ * greyed up in TS 24.007 Annex C diagrams.
+ */
+enum osmo_gprs_gmm_gmmbssgp_prim_type {
+ OSMO_GPRS_GMM_GMMBSSGP_PAGING, /* Req: BVCI, NSEI,... */
+ OSMO_GPRS_GMM_GMMBSSGP_RA_CAPABILITY, /* Req: BVCI, NSEI,... */
+ OSMO_GPRS_GMM_GMMBSSGP_RA_CAPABILITY_UPDATE, /* Ind, Resp */
+ OSMO_GPRS_GMM_GMMBSSGP_RADIO_STATUS, /* Ind: BVCI, NSEI,... */
+ OSMO_GPRS_GMM_GMMBSSGP_SUSPEND, /* Ind: BVCI, NSEI,... */
+ OSMO_GPRS_GMM_GMMBSSGP_RESUME, /* Ind: BVCI, NSEI,... */
+ OSMO_GPRS_GMM_GMMBSSGP_MS_REGISTRATION_ENQUIRY, /* Ind, Resp */
+};
+extern const struct value_string osmo_gprs_gmm_gmmbssgp_prim_type_names[];
+static inline const char *osmo_gprs_gmm_gmmbssgp_prim_type_name(enum osmo_gprs_gmm_gmmbssgp_prim_type val)
+{
+ return get_value_string(osmo_gprs_gmm_gmmbssgp_prim_type_names, val);
+}
+
+/* Parameters for OSMO_GPRS_GMM_BSSGP_* prims
+ * Same as struct osmo_gprs_rlcmac_gmmbssgp_prim.
+ */
+struct osmo_gprs_gmm_gmmbssgp_prim {
+ /* Common fields */
+ uint16_t bvci;
+ uint16_t nsei;
+ union {
+ /* OSMO_GPRS_GMM_GMMBSSGP_PAGING | Req */
+ struct {
+ } paging_req;
+ /* OSMO_GPRS_GMM_GMMBSSGP_RA_CAPABILITY | Req */
+ struct {
+ } ra_capability_req;
+ /* OSMO_GPRS_GMM_GMMBSSGP_RA_CAPABILITY_UPDATE | Ind */
+ struct {
+ } ra_capability_update_ind;
+ /* OSMO_GPRS_GMM_GMMBSSGP_RA_CAPABILITY_UPDATE | Resp */
+ struct {
+ } ra_capability_update_resp;
+ /* OSMO_GPRS_GMM_GMMBSSGP_RADIO_STATUS | Ind */
+ struct {
+ } radio_status_ind;
+ /* OSMO_GPRS_GMM_GMMBSSGP_SUSPEND | Ind */
+ struct {
+ } suspend_ind;
+ /* OSMO_GPRS_GMM_GMMBSSGP_RESUME | Ind */
+ struct {
+ } resume_ind;
+ /* OSMO_GPRS_GMM_GMMBSSGP_MS_REGISTRATION_ENQUIRY | Ind */
+ struct {
+ } ms_registration_enquiry_ind;
+ /* OSMO_GPRS_GMM_GMMBSSGP_MS_REGISTRATION_ENQUIRY | Resp */
+ struct {
+ } ms_registration_enquiry_resp;
+ };
+};
+
/* TS 24.007 Section 9.5.1 "Service primitives for GMMSM-SAP"
*/
enum osmo_gprs_gmm_gmmsm_prim_type {
@@ -279,6 +337,7 @@
union {
struct osmo_gprs_gmm_gmmreg_prim gmmreg;
struct osmo_gprs_gmm_gmmrr_prim gmmrr;
+ struct osmo_gprs_gmm_gmmbssgp_prim gmmbssgp;
struct osmo_gprs_gmm_gmmsm_prim gmmsm;
};
};
@@ -307,6 +366,13 @@
/* Alloc primitive for GMMRR SAP: */
struct osmo_gprs_gmm_prim *osmo_gprs_gmm_prim_alloc_gmmrr_page_ind(uint32_t tlli);

+/* Alloc primitive for GMMBSSGP SAP: */
+struct osmo_gprs_gmm_prim *osmo_gprs_gmm_prim_alloc_gmmbssgp_ra_capability_update_ind(uint16_t bvci, uint16_t nsei);
+struct osmo_gprs_gmm_prim *osmo_gprs_gmm_prim_alloc_gmmbssgp_radio_status_ind(uint16_t bvci, uint16_t nsei);
+struct osmo_gprs_gmm_prim *osmo_gprs_gmm_prim_alloc_gmmbssgp_suspend_ind(uint16_t bvci, uint16_t nsei);
+struct osmo_gprs_gmm_prim *osmo_gprs_gmm_prim_alloc_gmmbssgp_resume_ind(uint16_t bvci, uint16_t nsei);
+struct osmo_gprs_gmm_prim *osmo_gprs_gmm_prim_alloc_gmmbssgp_ms_registration_enquiry_ind(uint16_t bvci, uint16_t nsei);
+
/* Alloc primitive for GMMSM SAP: */
struct osmo_gprs_gmm_prim *osmo_gprs_gmm_prim_alloc_gmmsm_establish_req(uint32_t id);
struct osmo_gprs_gmm_prim *osmo_gprs_gmm_prim_alloc_gmmsm_unitdata_req(uint32_t id, uint8_t *smpdu, unsigned int smpdu_len);
diff --git a/include/osmocom/gprs/gmm/gmm_private.h b/include/osmocom/gprs/gmm/gmm_private.h
index db2cc8e..a94fec2 100644
--- a/include/osmocom/gprs/gmm/gmm_private.h
+++ b/include/osmocom/gprs/gmm/gmm_private.h
@@ -110,10 +110,16 @@

struct osmo_gprs_gmm_prim *gprs_gmm_prim_alloc_gmmrr_assign_req(uint32_t old_tlli, uint32_t new_tlli);

+struct osmo_gprs_gmm_prim *gprs_gmm_prim_alloc_gmmbssgp_paging_req(uint16_t bvci, uint16_t nsei);
+struct osmo_gprs_gmm_prim *gprs_gmm_prim_alloc_gmmbssgp_ra_capability_req(uint16_t bvci, uint16_t nsei);
+struct osmo_gprs_gmm_prim *gprs_gmm_prim_alloc_gmmbssgp_ra_capability_update_resp(uint16_t bvci, uint16_t nsei);
+struct osmo_gprs_gmm_prim *gprs_gmm_prim_alloc_gmmbssgp_ms_registration_enquiry_resp(uint16_t bvci, uint16_t nsei);
+
struct osmo_gprs_gmm_prim *gprs_gmm_prim_alloc_gmmsm_establish_cnf(uint32_t id, uint8_t cause);
struct osmo_gprs_gmm_prim *gprs_gmm_prim_alloc_gmmsm_release_ind(uint32_t id);
struct osmo_gprs_gmm_prim *gprs_gmm_prim_alloc_gmmsm_unitdata_ind(uint32_t id, uint8_t *smpdu, unsigned int smpdu_len);
struct osmo_gprs_gmm_prim *gprs_gmm_prim_alloc_gmmsm_modify_ind(uint32_t id);
+
/* gmm.c: */
struct gprs_gmm_entity *gprs_gmm_gmme_alloc(uint32_t ptmsi, const char *imsi);
void gprs_gmm_gmme_free(struct gprs_gmm_entity *gmme);
diff --git a/src/gmm/gmm_prim.c b/src/gmm/gmm_prim.c
index 693a811..bae2dbd 100644
--- a/src/gmm/gmm_prim.c
+++ b/src/gmm/gmm_prim.c
@@ -43,6 +43,7 @@
{ OSMO_GPRS_GMM_SAP_GMMRABM, "GMMRABM" },
{ OSMO_GPRS_GMM_SAP_GMMSS, "GMMSS" },
{ OSMO_GPRS_GMM_SAP_GMMSS2, "GMMSS2" },
+ { OSMO_GPRS_GMM_SAP_GMMBSSGP, "GMMBSSGP" },
{ 0, NULL }
};

@@ -60,6 +61,17 @@
{ 0, NULL }
};

+const struct value_string osmo_gprs_gmm_gmmbssgp_prim_type_names[] = {
+ { OSMO_GPRS_GMM_GMMBSSGP_PAGING, "AGING" },
+ { OSMO_GPRS_GMM_GMMBSSGP_RA_CAPABILITY, "A_CAPABILITY" },
+ { OSMO_GPRS_GMM_GMMBSSGP_RA_CAPABILITY_UPDATE, "A_CAPABILITY_UPDATE" },
+ { OSMO_GPRS_GMM_GMMBSSGP_RADIO_STATUS, "RADIO_STATUS" },
+ { OSMO_GPRS_GMM_GMMBSSGP_SUSPEND, "SUSPEND" },
+ { OSMO_GPRS_GMM_GMMBSSGP_RESUME, "RESUME" },
+ { OSMO_GPRS_GMM_GMMBSSGP_MS_REGISTRATION_ENQUIRY, "MS_REGISTRATION_ENQUIRY" },
+ { 0, NULL }
+};
+
const struct value_string osmo_gprs_gmm_gmmsm_prim_type_names[] = {
{ OSMO_GPRS_GMM_GMMSM_ESTABLISH, "ESTABLISH" },
{ OSMO_GPRS_GMM_GMMSM_RELEASE, "RELEASE" },
@@ -107,6 +119,9 @@
case OSMO_GPRS_GMM_SAP_GMMSM:
type = osmo_gprs_gmm_gmmsm_prim_type_name(gmm_prim->oph.primitive);
break;
+ case OSMO_GPRS_GMM_SAP_GMMBSSGP:
+ type = osmo_gprs_gmm_gmmbssgp_prim_type_name(gmm_prim->oph.primitive);
+ break;
default:
type = "unsupported-gmm-sap";
}
@@ -281,6 +296,105 @@
return gmm_prim;
}

+/*** GMMBSSGP ***/
+static inline struct osmo_gprs_gmm_prim *gmm_prim_gmmbssgp_alloc(enum osmo_gprs_gmm_gmmbssgp_prim_type type,
+ enum osmo_prim_operation operation,
+ unsigned int extra_size)
+{
+ return gprs_gmm_prim_alloc(OSMO_GPRS_GMM_SAP_GMMBSSGP, type, operation, extra_size);
+}
+
+/* 3GPP TS 48.018 5.3.4 GMM-PAGING.req: */
+struct osmo_gprs_gmm_prim *gprs_gmm_prim_alloc_gmmbssgp_paging_req(uint16_t bvci, uint16_t nsei)
+{
+ struct osmo_gprs_gmm_prim *gmm_prim;
+ gmm_prim = gmm_prim_gmmrr_alloc(OSMO_GPRS_GMM_GMMBSSGP_PAGING, PRIM_OP_REQUEST, 0);
+ gmm_prim->gmmbssgp.bvci = bvci;
+ gmm_prim->gmmbssgp.nsei = nsei;
+ return gmm_prim;
+}
+
+/* 3GPP TS 48.018 5.3.5 GMM-RA-CAPABILITY.req: */
+struct osmo_gprs_gmm_prim *gprs_gmm_prim_alloc_gmmbssgp_ra_capability_req(uint16_t bvci, uint16_t nsei)
+{
+ struct osmo_gprs_gmm_prim *gmm_prim;
+ gmm_prim = gmm_prim_gmmrr_alloc(OSMO_GPRS_GMM_GMMBSSGP_RA_CAPABILITY, PRIM_OP_REQUEST, 0);
+ gmm_prim->gmmbssgp.bvci = bvci;
+ gmm_prim->gmmbssgp.nsei = nsei;
+ return gmm_prim;
+}
+
+/* 3GPP TS 48.018 5.3.6 GMM-RA-CAPABILITY-UPDATE.ind: */
+struct osmo_gprs_gmm_prim *osmo_gprs_gmm_prim_alloc_gmmbssgp_ra_capability_update_ind(uint16_t bvci, uint16_t nsei)
+{
+ struct osmo_gprs_gmm_prim *gmm_prim;
+ gmm_prim = gmm_prim_gmmrr_alloc(OSMO_GPRS_GMM_GMMBSSGP_RA_CAPABILITY_UPDATE, PRIM_OP_INDICATION, 0);
+ gmm_prim->gmmbssgp.bvci = bvci;
+ gmm_prim->gmmbssgp.nsei = nsei;
+ return gmm_prim;
+}
+
+/* 3GPP TS 48.018 5.3.7 GMM-RA-CAPABILITY-UPDATE.res: */
+struct osmo_gprs_gmm_prim *gprs_gmm_prim_alloc_gmmbssgp_ra_capability_update_resp(uint16_t bvci, uint16_t nsei)
+{
+ struct osmo_gprs_gmm_prim *gmm_prim;
+ gmm_prim = gmm_prim_gmmrr_alloc(OSMO_GPRS_GMM_GMMBSSGP_RA_CAPABILITY_UPDATE, PRIM_OP_RESPONSE, 0);
+ gmm_prim->gmmbssgp.bvci = bvci;
+ gmm_prim->gmmbssgp.nsei = nsei;
+ return gmm_prim;
+}
+
+/* 3GPP TS 48.018 5.3.8 GMM-RADIO-STATUS.ind: */
+struct osmo_gprs_gmm_prim *osmo_gprs_gmm_prim_alloc_gmmbssgp_radio_status_ind(uint16_t bvci, uint16_t nsei)
+{
+ struct osmo_gprs_gmm_prim *gmm_prim;
+ gmm_prim = gmm_prim_gmmrr_alloc(OSMO_GPRS_GMM_GMMBSSGP_RADIO_STATUS, PRIM_OP_INDICATION, 0);
+ gmm_prim->gmmbssgp.bvci = bvci;
+ gmm_prim->gmmbssgp.nsei = nsei;
+ return gmm_prim;
+}
+
+/* 3GPP TS 48.018 5.3.9 GMM-SUSPEND.ind: */
+struct osmo_gprs_gmm_prim *osmo_gprs_gmm_prim_alloc_gmmbssgp_suspend_ind(uint16_t bvci, uint16_t nsei)
+{
+ struct osmo_gprs_gmm_prim *gmm_prim;
+ gmm_prim = gmm_prim_gmmrr_alloc(OSMO_GPRS_GMM_GMMBSSGP_SUSPEND, PRIM_OP_INDICATION, 0);
+ gmm_prim->gmmbssgp.bvci = bvci;
+ gmm_prim->gmmbssgp.nsei = nsei;
+ return gmm_prim;
+}
+
+/* 3GPP TS 48.018 5.3.10 GMM-RESUME.ind: */
+struct osmo_gprs_gmm_prim *osmo_gprs_gmm_prim_alloc_gmmbssgp_resume_ind(uint16_t bvci, uint16_t nsei)
+{
+ struct osmo_gprs_gmm_prim *gmm_prim;
+ gmm_prim = gmm_prim_gmmrr_alloc(OSMO_GPRS_GMM_GMMBSSGP_RESUME, PRIM_OP_INDICATION, 0);
+ gmm_prim->gmmbssgp.bvci = bvci;
+ gmm_prim->gmmbssgp.nsei = nsei;
+ return gmm_prim;
+}
+
+/* 3GPP TS 48.018 5.3.10a GMM-MS-REGISTRATION-ENQUIRY.ind: */
+struct osmo_gprs_gmm_prim *osmo_gprs_gmm_prim_alloc_gmmbssgp_ms_registration_enquiry_ind(uint16_t bvci, uint16_t nsei)
+{
+ struct osmo_gprs_gmm_prim *gmm_prim;
+ gmm_prim = gmm_prim_gmmrr_alloc(OSMO_GPRS_GMM_GMMBSSGP_MS_REGISTRATION_ENQUIRY, PRIM_OP_INDICATION, 0);
+ gmm_prim->gmmbssgp.bvci = bvci;
+ gmm_prim->gmmbssgp.nsei = nsei;
+ return gmm_prim;
+}
+
+/* 3GPP TS 48.018 5.3.10b GMM-MS-REGISTRATION-ENQUIRY.res: */
+struct osmo_gprs_gmm_prim *gprs_gmm_prim_alloc_gmmbssgp_ms_registration_enquiry_resp(uint16_t bvci, uint16_t nsei)
+{
+ struct osmo_gprs_gmm_prim *gmm_prim;
+ gmm_prim = gmm_prim_gmmrr_alloc(OSMO_GPRS_GMM_GMMBSSGP_MS_REGISTRATION_ENQUIRY, PRIM_OP_RESPONSE, 0);
+ gmm_prim->gmmbssgp.bvci = bvci;
+ gmm_prim->gmmbssgp.nsei = nsei;
+ return gmm_prim;
+}
+
+
/*** GMMSM ***/

static inline struct osmo_gprs_gmm_prim *gmm_prim_gmmsm_alloc(enum osmo_gprs_gmm_gmmsm_prim_type type,
@@ -666,6 +780,72 @@
return rc;
}

+static int gprs_gmm_prim_handle_gmmbssgp_ra_capability_update_ind(struct osmo_gprs_gmm_prim *gmm_prim)
+{
+ int rc;
+ rc = gprs_gmm_prim_handle_unsupported(gmm_prim);
+ rc = 1; /* prim ownership taken, already freed */
+ return rc;
+}
+
+static int gprs_gmm_prim_handle_gmmbssgp_radio_status_ind(struct osmo_gprs_gmm_prim *gmm_prim)
+{
+ int rc;
+ rc = gprs_gmm_prim_handle_unsupported(gmm_prim);
+ rc = 1; /* prim ownership taken, already freed */
+ return rc;
+}
+
+static int gprs_gmm_prim_handle_gmmbssgp_suspend_ind(struct osmo_gprs_gmm_prim *gmm_prim)
+{
+ int rc;
+ rc = gprs_gmm_prim_handle_unsupported(gmm_prim);
+ rc = 1; /* prim ownership taken, already freed */
+ return rc;
+}
+
+static int gprs_gmm_prim_handle_gmmbssgp_resume_ind(struct osmo_gprs_gmm_prim *gmm_prim)
+{
+ int rc;
+ rc = gprs_gmm_prim_handle_unsupported(gmm_prim);
+ rc = 1; /* prim ownership taken, already freed */
+ return rc;
+}
+
+static int gprs_gmm_prim_handle_gmmbssgp_ms_registration_enquiry_ind(struct osmo_gprs_gmm_prim *gmm_prim)
+{
+ int rc;
+ rc = gprs_gmm_prim_handle_unsupported(gmm_prim);
+ rc = 1; /* prim ownership taken, already freed */
+ return rc;
+}
+
+static int gprs_gmm_prim_handle_gmmbssgp(struct osmo_gprs_gmm_prim *gmm_prim)
+{
+ int rc = 0;
+ switch (OSMO_PRIM_HDR(&gmm_prim->oph)) {
+ case OSMO_PRIM(OSMO_GPRS_GMM_GMMBSSGP_RA_CAPABILITY_UPDATE, PRIM_OP_INDICATION):
+ rc = gprs_gmm_prim_handle_gmmbssgp_ra_capability_update_ind(gmm_prim);
+ break;
+ case OSMO_PRIM(OSMO_GPRS_GMM_GMMBSSGP_RADIO_STATUS, PRIM_OP_INDICATION):
+ rc = gprs_gmm_prim_handle_gmmbssgp_radio_status_ind(gmm_prim);
+ break;
+ case OSMO_PRIM(OSMO_GPRS_GMM_GMMBSSGP_SUSPEND, PRIM_OP_INDICATION):
+ rc = gprs_gmm_prim_handle_gmmbssgp_suspend_ind(gmm_prim);
+ break;
+ case OSMO_PRIM(OSMO_GPRS_GMM_GMMBSSGP_RESUME, PRIM_OP_INDICATION):
+ rc = gprs_gmm_prim_handle_gmmbssgp_resume_ind(gmm_prim);
+ break;
+ case OSMO_PRIM(OSMO_GPRS_GMM_GMMBSSGP_MS_REGISTRATION_ENQUIRY, PRIM_OP_INDICATION):
+ rc = gprs_gmm_prim_handle_gmmbssgp_ms_registration_enquiry_ind(gmm_prim);
+ break;
+ default:
+ rc = gprs_gmm_prim_handle_unsupported(gmm_prim);
+ rc = 1;
+ }
+ return rc;
+}
+
/* GMM lower layers (LLC) push GMM primitive up to GMM layer: */
int osmo_gprs_gmm_prim_lower_up(struct osmo_gprs_gmm_prim *gmm_prim)
{
@@ -680,6 +860,9 @@
case OSMO_GPRS_GMM_SAP_GMMRR:
rc = gprs_gmm_prim_handle_gmmrr(gmm_prim);
break;
+ case OSMO_GPRS_GMM_SAP_GMMBSSGP:
+ rc = gprs_gmm_prim_handle_gmmbssgp(gmm_prim);
+ break;
default:
rc = gprs_gmm_prim_handle_unsupported(gmm_prim);
rc = 1;

To view, visit change 37724. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: I39045833fd43cfe98cb1a3812fbce3fdcaae6dc6
Gerrit-Change-Number: 37724
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-MessageType: newchange