pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/33186 )
Change subject: layer23: modem: Forward LLC-TRANSMITTED.ind RLCMAC->GMM ......................................................................
layer23: modem: Forward LLC-TRANSMITTED.ind RLCMAC->GMM
Change-Id: Ife91ad87fed78daf86e9f28ceed981d61799758e --- M src/host/layer23/src/modem/grr.c M src/host/layer23/src/modem/rlcmac.c 2 files changed, 39 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/86/33186/1
diff --git a/src/host/layer23/src/modem/grr.c b/src/host/layer23/src/modem/grr.c index c4e8537..b290c8b 100644 --- a/src/host/layer23/src/modem/grr.c +++ b/src/host/layer23/src/modem/grr.c @@ -47,6 +47,16 @@
#include <l1ctl_proto.h>
+static uint32_t _gsm48_req_ref2fn(const struct gsm48_req_ref *ref) +{ + const struct gsm_time time = { + .t3 = ref->t3_high << 3 | ref->t3_low, + .t2 = ref->t2, + .t1 = ref->t1, + }; + return gsm_gsmtime2fn(&time); +} + /* Generate an 8-bit CHANNEL REQUEST message as per 3GPP TS 44.018, 9.1.8 */ uint8_t modem_grr_gen_chan_req(bool single_block) { @@ -254,9 +264,10 @@ return 0; } if (!grr_match_req_ref(ms, &ia->req_ref)) { - LOGP(DRR, LOGL_INFO, "%s(): req_ref mismatch (RA=0x%02x, T1=%u, T3=%u, T2=%u)\n", + LOGP(DRR, LOGL_INFO, "%s(): req_ref mismatch (RA=0x%02x, T1=%u, T3=%u, T2=%u, FN=%u)\n", __func__, ia->req_ref.ra, ia->req_ref.t1, - ia->req_ref.t3_high << 3 | ia->req_ref.t3_low, ia->req_ref.t2); + ia->req_ref.t3_high << 3 | ia->req_ref.t3_low, ia->req_ref.t2, + _gsm48_req_ref2fn(&ia->req_ref)); return 0; }
@@ -460,8 +471,9 @@ if (rr->state == GSM48_RR_ST_CONN_PEND) { const struct gsm48_req_ref *ref = (void *)&ch->data[1]; LOGP(DRSL, LOGL_NOTICE, - "Rx RACH.conf (RA=0x%02x, T1=%u, T3=%u, T2=%u)\n", - rr->cr_ra, ref->t1, ref->t3_high << 3 | ref->t3_low, ref->t2); + "Rx RACH.conf (RA=0x%02x, T1=%u, T3=%u, T2=%u, FN=%u)\n", + rr->cr_ra, ref->t1, ref->t3_high << 3 | ref->t3_low, ref->t2, + _gsm48_req_ref2fn(ref)); /* shift the CHANNEL REQUEST history buffer */ memmove(&rr->cr_hist[1], &rr->cr_hist[0], ARRAY_SIZE(rr->cr_hist) - 1); /* store the new entry */ diff --git a/src/host/layer23/src/modem/rlcmac.c b/src/host/layer23/src/modem/rlcmac.c index e030299..161effd 100644 --- a/src/host/layer23/src/modem/rlcmac.c +++ b/src/host/layer23/src/modem/rlcmac.c @@ -85,8 +85,8 @@ switch (rlcmac_prim->oph.primitive) { case OSMO_GPRS_RLCMAC_GMMRR_PAGE: /* 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. + /* Optimization: RLCMAC-GMMRR-PAGE-IND is 1-to-1 ABI compatible with + GMM-GMMRR-PAGE-IND, we just need to adapt the header. See osmo_static_assert(_gmmrr_prim_size) above. */ gmm_prim = (struct osmo_gprs_gmm_prim *)rlcmac_prim; @@ -95,6 +95,18 @@ osmo_gprs_gmm_prim_lower_up(gmm_prim); rc = 1; /* Tell RLCMAC that we take ownership of the prim. */ break; + case OSMO_GPRS_RLCMAC_GMMRR_LLC_TRANSMITTED: + /* Forward it to upper layers, pass ownership over to GMM: */ + /* Optimization: RLCMAC-GMMRR-LLC-TRANSMITTED-IND is 1-to-1 ABI compatible with + GMM-GMMRR-LLC-TRANSMITTED-IND, we just need to adapt the header. + See osmo_static_assert(_gmmrr_prim_size) above. + */ + gmm_prim = (struct osmo_gprs_gmm_prim *)rlcmac_prim; + gmm_prim->oph.sap = OSMO_GPRS_GMM_SAP_GMMRR; + gmm_prim->oph.primitive = OSMO_GPRS_GMM_GMMRR_LLC_TRANSMITTED; + osmo_gprs_gmm_prim_lower_up(gmm_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", __func__, rlcmac_prim->oph.primitive);