pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmocom-bb/+/32080 )
Change subject: layer23: modem: Forward GMMRR primitives between GMM and RLCMAC layers
......................................................................
layer23: modem: Forward GMMRR primitives between GMM and RLCMAC layers
Related: OS#5501
Change-Id: I7603d8bbda0cdd437eb7557267efb7bbc3552565
---
M src/host/layer23/src/modem/gmm.c
M src/host/layer23/src/modem/rlcmac.c
2 files changed, 40 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/80/32080/1
diff --git a/src/host/layer23/src/modem/gmm.c b/src/host/layer23/src/modem/gmm.c
index f88226e..04a6156 100644
--- a/src/host/layer23/src/modem/gmm.c
+++ b/src/host/layer23/src/modem/gmm.c
@@ -41,7 +41,7 @@
#include <osmocom/bb/common/apn.h>
#include <osmocom/bb/common/ms.h>
#include <osmocom/bb/modem/gmm.h>
-
+#include <osmocom/gprs/rlcmac/rlcmac_prim.h>
static int modem_gmm_prim_up_cb(struct osmo_gprs_gmm_prim *gmm_prim, void *user_data)
{
@@ -72,7 +72,21 @@
const char *pdu_name = osmo_gprs_gmm_prim_name(gmm_prim);
int rc = 0;
+ osmo_static_assert(sizeof(struct osmo_gprs_gmm_gmmrr_prim) == sizeof(struct
osmo_gprs_rlcmac_gmmrr_prim),
+ _gmmrr_prim_size);
+
switch (gmm_prim->oph.sap) {
+ case OSMO_GPRS_GMM_SAP_GMMRR:
+ /* Forward it to lower layers, pass ownership over to RLCMAC: */
+ /* Optimization: GMM-GMMRR-ASSIGN-REQ is 1-to-1 ABI compatible with
+ RLCMAC-GMMRR-ASSIGN-REQ, we just need to adapt the header.
+ See osmo_static_assert(_gmmrr_prim_size) above.
+ */
+ gmm_prim->oph.sap = OSMO_GPRS_RLCMAC_SAP_GMMRR;
+ gmm_prim->oph.primitive = OSMO_GPRS_RLCMAC_GMMRR_ASSIGN;
+ osmo_gprs_rlcmac_prim_upper_down((struct osmo_gprs_rlcmac_prim *)gmm_prim);
+ rc = 1; /* Tell GMM that we take ownership of the prim. */
+ break;
case OSMO_GPRS_GMM_SAP_GMMREG:
default:
LOGP(DGMM, LOGL_ERROR, "%s(): Unexpected Rx %s\n", __func__, pdu_name);
diff --git a/src/host/layer23/src/modem/rlcmac.c b/src/host/layer23/src/modem/rlcmac.c
index 8327620..9ebac07 100644
--- a/src/host/layer23/src/modem/rlcmac.c
+++ b/src/host/layer23/src/modem/rlcmac.c
@@ -35,6 +35,7 @@
#include <osmocom/gprs/rlcmac/rlcmac_prim.h>
#include <osmocom/gprs/rlcmac/rlcmac.h>
#include <osmocom/gprs/llc/llc_prim.h>
+#include <osmocom/gprs/gmm/gmm_prim.h>
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/common/l1ctl.h>
@@ -75,12 +76,23 @@
static int modem_rlcmac_handle_gmmrr(struct osmo_gprs_rlcmac_prim *rlcmac_prim)
{
+ struct osmo_gprs_gmm_prim *gmm_prim;
int rc;
+
+ osmo_static_assert(sizeof(struct osmo_gprs_rlcmac_gmmrr_prim) == sizeof(struct
osmo_gprs_gmm_gmmrr_prim),
+ _gmmrr_prim_size);
+
switch (rlcmac_prim->oph.primitive) {
case OSMO_GPRS_RLCMAC_GMMRR_PAGE:
- LOGP(DRLCMAC, LOGL_ERROR, "%s(): TODO: implement answering to paging indication
TLLI=0x%08x\n",
- __func__, rlcmac_prim->gmmrr.page_ind.tlli);
- rc = 0;
+ /* Forward it to upper layers, pass ownership over to GMM: */
+ /* Optimization: RLCMAC-GMMRR-ASSIGN-REQ is 1-to-1 ABI compatible with
+ GMM-GMMRR-ASSIGN-REQ, we just need to adapt the header.
+ See osmo_static_assert(_gmmrr_prim_size) above.
+ */
+ gmm_prim->oph.sap = OSMO_GPRS_GMM_SAP_GMMRR;
+ gmm_prim->oph.primitive = OSMO_GPRS_GMM_GMMRR_ASSIGN;
+ osmo_gprs_gmm_prim_lower_up((struct osmo_gprs_gmm_prim *)rlcmac_prim);
+ rc = 1; /* Tell RLCMAC that we take ownership of the prim. */
break;
default:
LOGP(DRLCMAC, LOGL_NOTICE, "%s(): Unexpected Rx RLCMAC GMMRR prim %u\n",
--
To view, visit
https://gerrit.osmocom.org/c/osmocom-bb/+/32080
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I7603d8bbda0cdd437eb7557267efb7bbc3552565
Gerrit-Change-Number: 32080
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange