pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-gprs/+/31285 )


Change subject: rlcmac: Implement GMMRR-ASSIGN.req
......................................................................

rlcmac: Implement GMMRR-ASSIGN.req

Change-Id: I3178aa1af4a6c05c84253c6befcd4c786b8dd8e9
---
M include/osmocom/gprs/rlcmac/rlcmac_prim.h
M src/rlcmac/rlcmac_prim.c
2 files changed, 16 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/85/31285/1

diff --git a/include/osmocom/gprs/rlcmac/rlcmac_prim.h 
b/include/osmocom/gprs/rlcmac/rlcmac_prim.h
index 92e644e..40d2d9a 100644
--- a/include/osmocom/gprs/rlcmac/rlcmac_prim.h
+++ b/include/osmocom/gprs/rlcmac/rlcmac_prim.h
@@ -186,7 +186,7 @@
                                uint32_t tlli, uint8_t *ll_pdu, size_t 
ll_pdu_len);

 /* Alloc primitive for GMMRR SAP: */
-struct osmo_gprs_rlcmac_prim *osmo_gprs_rlcmac_prim_alloc_gmmrr_asign_req(
+struct osmo_gprs_rlcmac_prim *osmo_gprs_rlcmac_prim_alloc_gmmrr_assign_req(
                                uint32_t new_tlli);

 /* Alloc primitive for L1CTL SAP: */
diff --git a/src/rlcmac/rlcmac_prim.c b/src/rlcmac/rlcmac_prim.c
index ef0dd22..9e0c12f 100644
--- a/src/rlcmac/rlcmac_prim.c
+++ b/src/rlcmac/rlcmac_prim.c
@@ -383,8 +383,21 @@

 static int rlcmac_prim_handle_gmmrr_assign_req(struct osmo_gprs_rlcmac_prim 
*rlcmac_prim)
 {
-       int rc = gprs_rlcmac_prim_handle_unsupported(rlcmac_prim);
-       return rc;
+       struct gprs_rlcmac_entity *gre;
+
+       gre = 
gprs_rlcmac_find_entity_by_tlli(rlcmac_prim->gmmrr.assign_req.new_tlli);
+       if (!gre) {
+               LOGRLCMAC(LOGL_INFO, "GMMRR-ASSIGN.req: TLLI=0x%08x not found, 
creating entity on the fly\n",
+                         rlcmac_prim->gmmrr.assign_req.new_tlli);
+               gre = 
gprs_rlcmac_entity_alloc(rlcmac_prim->gmmrr.assign_req.new_tlli);
+               OSMO_ASSERT(gre);
+       } else {
+               LOGRLCMAC(LOGL_INFO, "GMMRR-ASSIGN.req: TLLI=0x%08x already 
exists\n",
+                         rlcmac_prim->gmmrr.assign_req.new_tlli);
+       }
+
+       msgb_free(rlcmac_prim->oph.msg);
+       return 0;
 }

 static int gprs_rlcmac_prim_gmmrr_upper_down(struct osmo_gprs_rlcmac_prim 
*rlcmac_prim)

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

Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: I3178aa1af4a6c05c84253c6befcd4c786b8dd8e9
Gerrit-Change-Number: 31285
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-MessageType: newchange

Reply via email to