<p>pespin <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/24224">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Optimize PAGING-CS PDCH set selection when target MS is known<br><br>Before this patch, when a PAGING-GS was received in PCU from SGSN, it<br>would always forward the paging request to all PDCHs in all TRXs of all<br>BTS (well, it did some heuristics to avoid sending it in some PDCHs<br>where onyl repeated TBFs would be listening).<br><br>The previous behavior, didn't make much sense in the case where the PCU<br>is asked to page an MS which it knows (ie in which PDCHs is listening<br>to). Hence, in that case it makes sense to simply send the paging<br>request on 1 PDCH where the MS is listening, instead of sending it in a<br>big set of different PDCHs.<br><br>This commit also splits the old get_paging_mi() helper which was<br>erroneously created to parseboth CS/PS-PAGING requesst, since they<br>actually use a different set of target subscriber information (for<br>instance, CS-PAGING provides optionally a TLLI, and one provides P-TMSI<br>while the other provides TMSI).<br><br>In this patch, the handling of CS paging request is split into 2 parts:<br>1- A new helper "struct paging_req_cs" is introduced, where incoming<br>CS-PAGING requests (from both SGSN over BSSGP and BTS/BSC over PCUIF)<br>are parsed and information stored. Then, from available information, it<br>tries to find a target MS if avaialable<br>2- bts_add_paging() is called from both BSSGP and PCUIF paths with the<br>helper struct and the target MS (NULL if not found). If MS exists,<br>paging is forwarding only on 1 PDCH that MS is attached to. If no MS<br>exists, then the old heursitics are used to forward the request to all<br>MS.<br><br>Change-Id: Iea46d5321a29d800813b1aa2bf4ce175ce45e2cf<br>---<br>M src/bts.cpp<br>M src/bts.h<br>M src/gprs_bssgp_pcu.c<br>M src/pcu_l1_if.cpp<br>4 files changed, 157 insertions(+), 24 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/bts.cpp b/src/bts.cpp</span><br><span>index 5769c2f..e9864e7 100644</span><br><span>--- a/src/bts.cpp</span><br><span>+++ b/src/bts.cpp</span><br><span>@@ -337,11 +337,44 @@</span><br><span>             bts_set_current_frame_number(bts, fn);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-int bts_add_paging(struct gprs_rlcmac_bts *bts, uint8_t chan_needed, const struct osmo_mobile_identity *mi)</span><br><span style="color: hsl(120, 100%, 40%);">+/* Helper used by bts_add_paging() whenever the target MS is known */</span><br><span style="color: hsl(120, 100%, 40%);">+static void bts_add_paging_known_ms(struct GprsMs *ms, const struct osmo_mobile_identity *mi, uint8_t chan_needed)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+      uint8_t ts;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ms->ul_tbf) {</span><br><span style="color: hsl(120, 100%, 40%);">+          for (ts = 0; ts < ARRAY_SIZE(ms->ul_tbf->pdch); ts++) {</span><br><span style="color: hsl(120, 100%, 40%);">+                      if (ms->ul_tbf->pdch[ts]) {</span><br><span style="color: hsl(120, 100%, 40%);">+                             LOGPDCH(ms->ul_tbf->pdch[ts], DRLCMAC, LOGL_INFO,</span><br><span style="color: hsl(120, 100%, 40%);">+                                       "Paging on PACCH for %s\n", tbf_name(ms->ul_tbf));</span><br><span style="color: hsl(120, 100%, 40%);">+                               if (!ms->ul_tbf->pdch[ts]->add_paging(chan_needed, mi))</span><br><span style="color: hsl(120, 100%, 40%);">+                                      continue;</span><br><span style="color: hsl(120, 100%, 40%);">+                             return;</span><br><span style="color: hsl(120, 100%, 40%);">+                       }</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+     if (ms->dl_tbf) {</span><br><span style="color: hsl(120, 100%, 40%);">+          for (ts = 0; ts < ARRAY_SIZE(ms->dl_tbf->pdch); ts++) {</span><br><span style="color: hsl(120, 100%, 40%);">+                      if (ms->dl_tbf->pdch[ts]) {</span><br><span style="color: hsl(120, 100%, 40%);">+                             LOGPDCH(ms->dl_tbf->pdch[ts], DRLCMAC, LOGL_INFO,</span><br><span style="color: hsl(120, 100%, 40%);">+                                       "Paging on PACCH for %s\n", tbf_name(ms->ul_tbf));</span><br><span style="color: hsl(120, 100%, 40%);">+                               if (!ms->dl_tbf->pdch[ts]->add_paging(chan_needed, mi))</span><br><span style="color: hsl(120, 100%, 40%);">+                                      continue;</span><br><span style="color: hsl(120, 100%, 40%);">+                             return;</span><br><span style="color: hsl(120, 100%, 40%);">+                       }</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+     LOGPMS(ms, DRLCMAC, LOGL_INFO, "Unable to page on PACCH, no available TBFs\n");</span><br><span style="color: hsl(120, 100%, 40%);">+     return;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* ms is NULL if no specific taget was found */</span><br><span style="color: hsl(120, 100%, 40%);">+int bts_add_paging(struct gprs_rlcmac_bts *bts, const struct paging_req_cs *req, struct GprsMs *ms)</span><br><span> {</span><br><span>      uint8_t l, trx, ts, any_tbf = 0;</span><br><span>     struct gprs_rlcmac_tbf *tbf;</span><br><span>         struct llist_item *pos;</span><br><span style="color: hsl(120, 100%, 40%);">+       const struct osmo_mobile_identity *mi;</span><br><span>       uint8_t slot_mask[8];</span><br><span>        int8_t first_ts; /* must be signed */</span><br><span> </span><br><span>@@ -351,13 +384,31 @@</span><br><span>            NULL</span><br><span>         };</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+        /* First, build the MI used to page on PDCH from available subscriber info: */</span><br><span style="color: hsl(120, 100%, 40%);">+        if (req->mi_tmsi_present) {</span><br><span style="color: hsl(120, 100%, 40%);">+                mi = &req->mi_tmsi;</span><br><span style="color: hsl(120, 100%, 40%);">+    } else if (req->mi_imsi_present) {</span><br><span style="color: hsl(120, 100%, 40%);">+         mi = &req->mi_imsi;</span><br><span style="color: hsl(120, 100%, 40%);">+    } else {</span><br><span style="color: hsl(120, 100%, 40%);">+              LOGPMS(ms, DRLCMAC, LOGL_ERROR, "Unable to page on PACCH, no TMSI nor IMSI in request\n");</span><br><span style="color: hsl(120, 100%, 40%);">+          return -EINVAL;</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  if (log_check_level(DRLCMAC, LOGL_INFO)) {</span><br><span>           char str[64];</span><br><span>                osmo_mobile_identity_to_str_buf(str, sizeof(str), mi);</span><br><span style="color: hsl(0, 100%, 40%);">-          LOGP(DRLCMAC, LOGL_INFO, "Add RR paging: chan-needed=%d MI=%s\n", chan_needed, str);</span><br><span style="color: hsl(120, 100%, 40%);">+                LOGP(DRLCMAC, LOGL_INFO, "Add RR paging: chan-needed=%d MI=%s\n", req->chan_needed, str);</span><br><span>       }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   /* collect slots to page</span><br><span style="color: hsl(120, 100%, 40%);">+      /* We known the target MS for the paging req, send the req only on PDCH</span><br><span style="color: hsl(120, 100%, 40%);">+        * were that target MS is listening (first slot is enough), and we are done. */</span><br><span style="color: hsl(120, 100%, 40%);">+       if (ms) {</span><br><span style="color: hsl(120, 100%, 40%);">+             bts_add_paging_known_ms(ms, mi, req->chan_needed);</span><br><span style="color: hsl(120, 100%, 40%);">+         return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* We don't know the target MS.</span><br><span style="color: hsl(120, 100%, 40%);">+    * collect slots to page</span><br><span>      * Mark slots for every TBF, but only mark one of it.</span><br><span>         * Mark only the first slot found.</span><br><span>    * Don't mark, if TBF uses a different slot that is already marked. */</span><br><span>@@ -399,7 +450,7 @@</span><br><span>             for (ts = 0; ts < 8; ts++) {</span><br><span>                      if ((slot_mask[trx] & (1 << ts))) {</span><br><span>                                /* schedule */</span><br><span style="color: hsl(0, 100%, 40%);">-                          if (!bts->trx[trx].pdch[ts].add_paging(chan_needed, mi))</span><br><span style="color: hsl(120, 100%, 40%);">+                           if (!bts->trx[trx].pdch[ts].add_paging(req->chan_needed, mi))</span><br><span>                                  return -ENOMEM;</span><br><span> </span><br><span>                          LOGPDCH(&bts->trx[trx].pdch[ts], DRLCMAC, LOGL_INFO, "Paging on PACCH\n");</span><br><span>diff --git a/src/bts.h b/src/bts.h</span><br><span>index ea44fb7..11b5113 100644</span><br><span>--- a/src/bts.h</span><br><span>+++ b/src/bts.h</span><br><span>@@ -265,8 +265,17 @@</span><br><span> extern "C" {</span><br><span> #endif</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+struct paging_req_cs {</span><br><span style="color: hsl(120, 100%, 40%);">+   uint8_t chan_needed;</span><br><span style="color: hsl(120, 100%, 40%);">+  uint32_t tlli; /* GSM_RESERVED_TMSI if not present */</span><br><span style="color: hsl(120, 100%, 40%);">+ bool mi_tmsi_present;</span><br><span style="color: hsl(120, 100%, 40%);">+ struct osmo_mobile_identity mi_tmsi;</span><br><span style="color: hsl(120, 100%, 40%);">+  bool mi_imsi_present;</span><br><span style="color: hsl(120, 100%, 40%);">+ struct osmo_mobile_identity mi_imsi;</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> struct GprsMs *bts_alloc_ms(struct gprs_rlcmac_bts *bts, uint8_t ms_class, uint8_t egprs_ms_class);</span><br><span style="color: hsl(0, 100%, 40%);">-int bts_add_paging(struct gprs_rlcmac_bts *bts, uint8_t chan_needed, const struct osmo_mobile_identity *mi);</span><br><span style="color: hsl(120, 100%, 40%);">+int bts_add_paging(struct gprs_rlcmac_bts *bts, const struct paging_req_cs *req, struct GprsMs *ms);</span><br><span> </span><br><span> uint32_t bts_rfn_to_fn(const struct gprs_rlcmac_bts *bts, int32_t rfn);</span><br><span> </span><br><span>diff --git a/src/gprs_bssgp_pcu.c b/src/gprs_bssgp_pcu.c</span><br><span>index f6114de..5d0a489 100644</span><br><span>--- a/src/gprs_bssgp_pcu.c</span><br><span>+++ b/src/gprs_bssgp_pcu.c</span><br><span>@@ -171,8 +171,78 @@</span><br><span>                   ms_class, egprs_ms_class, delay_csec, data, len);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* 3GPP TS 48.018 Table 10.3.2. Returns 0 on success, suggested BSSGP cause otherwise */</span><br><span style="color: hsl(120, 100%, 40%);">+static unsigned int get_paging_cs_mi(struct paging_req_cs *req, const struct tlv_parsed *tp)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ int rc;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     req->chan_needed = tlvp_val8(tp, BSSGP_IE_CHAN_NEEDED, 0);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       if (!TLVP_PRESENT(tp, BSSGP_IE_IMSI)) {</span><br><span style="color: hsl(120, 100%, 40%);">+               LOGP(DBSSGP, LOGL_ERROR, "IMSI Mobile Identity mandatory IE not found\n");</span><br><span style="color: hsl(120, 100%, 40%);">+          return BSSGP_CAUSE_MISSING_MAND_IE;</span><br><span style="color: hsl(120, 100%, 40%);">+   }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   rc = osmo_mobile_identity_decode(&req->mi_imsi, TLVP_VAL(tp, BSSGP_IE_IMSI),</span><br><span style="color: hsl(120, 100%, 40%);">+                                    TLVP_LEN(tp, BSSGP_IE_IMSI), true);</span><br><span style="color: hsl(120, 100%, 40%);">+  if (rc < 0 || req->mi_imsi.type != GSM_MI_TYPE_IMSI) {</span><br><span style="color: hsl(120, 100%, 40%);">+          LOGP(DBSSGP, LOGL_ERROR, "Invalid IMSI Mobile Identity\n");</span><br><span style="color: hsl(120, 100%, 40%);">+         return BSSGP_CAUSE_INV_MAND_INF;</span><br><span style="color: hsl(120, 100%, 40%);">+      }</span><br><span style="color: hsl(120, 100%, 40%);">+     req->mi_imsi_present = true;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     /* TIMSI is optional */</span><br><span style="color: hsl(120, 100%, 40%);">+       req->mi_tmsi_present = false;</span><br><span style="color: hsl(120, 100%, 40%);">+      if (TLVP_PRESENT(tp, BSSGP_IE_TMSI)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                /* Be safe against an evil SGSN - check the length */</span><br><span style="color: hsl(120, 100%, 40%);">+         if (TLVP_LEN(tp, BSSGP_IE_TMSI) != GSM23003_TMSI_NUM_BYTES) {</span><br><span style="color: hsl(120, 100%, 40%);">+                 LOGP(DBSSGP, LOGL_NOTICE, "TMSI IE has odd length (!= 4)\n");</span><br><span style="color: hsl(120, 100%, 40%);">+                       return BSSGP_CAUSE_COND_IE_ERR;</span><br><span style="color: hsl(120, 100%, 40%);">+               }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+           /* NOTE: TMSI (unlike IMSI) IE comes without MI type header */</span><br><span style="color: hsl(120, 100%, 40%);">+                req->mi_tmsi = (struct osmo_mobile_identity){</span><br><span style="color: hsl(120, 100%, 40%);">+                      .type = GSM_MI_TYPE_TMSI,</span><br><span style="color: hsl(120, 100%, 40%);">+             };</span><br><span style="color: hsl(120, 100%, 40%);">+            req->mi_tmsi.tmsi = osmo_load32be(TLVP_VAL(tp, BSSGP_IE_TMSI));</span><br><span style="color: hsl(120, 100%, 40%);">+            req->mi_tmsi_present = true;</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   if (TLVP_PRESENT(tp, BSSGP_IE_TLLI))</span><br><span style="color: hsl(120, 100%, 40%);">+          req->tlli = osmo_load32be(TLVP_VAL(tp, BSSGP_IE_TLLI));</span><br><span style="color: hsl(120, 100%, 40%);">+    else</span><br><span style="color: hsl(120, 100%, 40%);">+          req->tlli = GSM_RESERVED_TMSI;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static int gprs_bssgp_pcu_rx_paging_cs(struct msgb *msg, const struct tlv_parsed *tp)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+      struct paging_req_cs req;</span><br><span style="color: hsl(120, 100%, 40%);">+     struct gprs_rlcmac_bts *bts;</span><br><span style="color: hsl(120, 100%, 40%);">+  struct GprsMs *ms;</span><br><span style="color: hsl(120, 100%, 40%);">+    int rc;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     if ((rc = get_paging_cs_mi(&req, tp)) > 0)</span><br><span style="color: hsl(120, 100%, 40%);">+             return bssgp_tx_status((enum gprs_bssgp_cause) rc, NULL, msg);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      /* We need to page all BTSs since even if a BTS has a matching MS, it</span><br><span style="color: hsl(120, 100%, 40%);">+  * may have already moved to a newer BTS. On Each BTS, if the MS is</span><br><span style="color: hsl(120, 100%, 40%);">+    * known, then bts_add_paging() can optimize and page only on PDCHs the</span><br><span style="color: hsl(120, 100%, 40%);">+        * target MS is using. */</span><br><span style="color: hsl(120, 100%, 40%);">+     llist_for_each_entry(bts, &the_pcu->bts_list, list) {</span><br><span style="color: hsl(120, 100%, 40%);">+          /* TODO: Match by TMSI before IMSI if present?! */</span><br><span style="color: hsl(120, 100%, 40%);">+            ms = bts_ms_by_tlli(bts, req.tlli, req.tlli);</span><br><span style="color: hsl(120, 100%, 40%);">+         if (!ms && req.mi_imsi_present)</span><br><span style="color: hsl(120, 100%, 40%);">+                       ms = bts_ms_by_imsi(bts, req.mi_imsi.imsi);</span><br><span style="color: hsl(120, 100%, 40%);">+           bts_add_paging(bts, &req, ms);</span><br><span style="color: hsl(120, 100%, 40%);">+    }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* Returns 0 on success, suggested BSSGP cause otherwise */</span><br><span style="color: hsl(0, 100%, 40%);">-static unsigned int get_paging_mi(struct osmo_mobile_identity *mi, const struct tlv_parsed *tp)</span><br><span style="color: hsl(120, 100%, 40%);">+static unsigned int get_paging_ps_mi(struct osmo_mobile_identity *mi, const struct tlv_parsed *tp)</span><br><span> {</span><br><span>        /* Use TMSI (if present) or IMSI */</span><br><span>  if (TLVP_PRESENT(tp, BSSGP_IE_TMSI)) {</span><br><span>@@ -202,22 +272,6 @@</span><br><span>        return 0;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static int gprs_bssgp_pcu_rx_paging_cs(struct msgb *msg, const struct tlv_parsed *tp)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-        struct osmo_mobile_identity mi;</span><br><span style="color: hsl(0, 100%, 40%);">- struct gprs_rlcmac_bts *bts;</span><br><span style="color: hsl(0, 100%, 40%);">-    int rc;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if ((rc = get_paging_mi(&mi, tp)) > 0)</span><br><span style="color: hsl(0, 100%, 40%);">-           return bssgp_tx_status((enum gprs_bssgp_cause) rc, NULL, msg);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-  /* FIXME: look if MS is attached a specific BTS and then only page on that one? */</span><br><span style="color: hsl(0, 100%, 40%);">-      llist_for_each_entry(bts, &the_pcu->bts_list, list) {</span><br><span style="color: hsl(0, 100%, 40%);">-            bts_add_paging(bts, tlvp_val8(tp, BSSGP_IE_CHAN_NEEDED, 0), &mi);</span><br><span style="color: hsl(0, 100%, 40%);">-   }</span><br><span style="color: hsl(0, 100%, 40%);">-       return 0;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> static int gprs_bssgp_pcu_rx_paging_ps(struct msgb *msg, const struct tlv_parsed *tp)</span><br><span> {</span><br><span>     struct osmo_mobile_identity mi_imsi;</span><br><span>@@ -242,7 +296,7 @@</span><br><span>           return bssgp_tx_status(BSSGP_CAUSE_INV_MAND_INF, NULL, msg);</span><br><span>         }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   if ((rc = get_paging_mi(&paging_mi, tp)) > 0)</span><br><span style="color: hsl(120, 100%, 40%);">+  if ((rc = get_paging_ps_mi(&paging_mi, tp)) > 0)</span><br><span>              return bssgp_tx_status((enum gprs_bssgp_cause) rc, NULL, msg);</span><br><span> </span><br><span>   /* FIXME: look if MS is attached a specific BTS and then only page on that one? */</span><br><span>diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp</span><br><span>index 0ccf642..cfd36d7 100644</span><br><span>--- a/src/pcu_l1_if.cpp</span><br><span>+++ b/src/pcu_l1_if.cpp</span><br><span>@@ -817,6 +817,9 @@</span><br><span> static int pcu_rx_pag_req(struct gprs_rlcmac_bts *bts, struct gsm_pcu_if_pag_req *pag_req)</span><br><span> {</span><br><span>         struct osmo_mobile_identity mi;</span><br><span style="color: hsl(120, 100%, 40%);">+       struct GprsMs *ms = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+     struct paging_req_cs req = { .chan_needed = pag_req->chan_needed,</span><br><span style="color: hsl(120, 100%, 40%);">+                               .tlli = GSM_RESERVED_TMSI };</span><br><span>    int rc;</span><br><span> </span><br><span>  LOGP(DL1IF, LOGL_DEBUG, "Paging request received: chan_needed=%d "</span><br><span>@@ -835,7 +838,23 @@</span><br><span>          return -EINVAL;</span><br><span>      }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   return bts_add_paging(bts, pag_req->chan_needed, &mi);</span><br><span style="color: hsl(120, 100%, 40%);">+ switch (mi.type) {</span><br><span style="color: hsl(120, 100%, 40%);">+    case GSM_MI_TYPE_TMSI:</span><br><span style="color: hsl(120, 100%, 40%);">+                req.mi_tmsi = mi;</span><br><span style="color: hsl(120, 100%, 40%);">+             req.mi_tmsi_present = true;</span><br><span style="color: hsl(120, 100%, 40%);">+           /* TODO: look up MS by TMSI? Derive TLLI? */</span><br><span style="color: hsl(120, 100%, 40%);">+          break;</span><br><span style="color: hsl(120, 100%, 40%);">+        case GSM_MI_TYPE_IMSI:</span><br><span style="color: hsl(120, 100%, 40%);">+                req.mi_imsi = mi;</span><br><span style="color: hsl(120, 100%, 40%);">+             req.mi_imsi_present = true;</span><br><span style="color: hsl(120, 100%, 40%);">+           ms = bts_ms_by_imsi(bts, req.mi_imsi.imsi);</span><br><span style="color: hsl(120, 100%, 40%);">+           break;</span><br><span style="color: hsl(120, 100%, 40%);">+        default:</span><br><span style="color: hsl(120, 100%, 40%);">+              LOGP(DL1IF, LOGL_ERROR, "Unexpected MI type %u\n", mi.type);</span><br><span style="color: hsl(120, 100%, 40%);">+                return -EINVAL;</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   return bts_add_paging(bts, &req, ms);</span><br><span> }</span><br><span> </span><br><span> static int pcu_rx_susp_req(struct gprs_rlcmac_bts *bts, struct gsm_pcu_if_susp_req *susp_req)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-pcu/+/24224">change 24224</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-pcu/+/24224"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-pcu </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Iea46d5321a29d800813b1aa2bf4ce175ce45e2cf </div>
<div style="display:none"> Gerrit-Change-Number: 24224 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>