<p>Harald Welte <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/3384">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Harald Welte: Looks good to me, approved
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  osmith: Looks good to me, but someone else must approve
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Forward GPRS SUSPEND REQ from BTS to SGSN using BSSGP<br><br>As specified in 3GPP TS 03.60 Section 16.2.1 and 44.018 Section 3.4.15,<br>a Class B MS is sending a "RR GPRS SUSPEND REQ" via a DCCH to the BTS if<br>it wants to suspend GPRS services.  As of<br>Change-Id I3c1af662c8f0d3d22da200638480f6ef05c3ed1f, OsmoBTS forwards<br>this via the PCU socket, so we need to pick it up and send it via BSSGP<br>to the SGSN.<br><br>Change-Id: I7b4beb413a6f974373a404b5a11c44d86ba695d3<br>Closes: OS#2249<br>---<br>M include/osmocom/pcu/pcuif_proto.h<br>M src/pcu_l1_if.cpp<br>2 files changed, 28 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/pcu/pcuif_proto.h b/include/osmocom/pcu/pcuif_proto.h</span><br><span>index b06077c..144fba6 100644</span><br><span>--- a/include/osmocom/pcu/pcuif_proto.h</span><br><span>+++ b/include/osmocom/pcu/pcuif_proto.h</span><br><span>@@ -12,6 +12,7 @@</span><br><span> #define PCU_IF_MSG_DATA_REQ   0x00    /* send data to given channel */</span><br><span> #define PCU_IF_MSG_DATA_CNF 0x01    /* confirm (e.g. transmission on PCH) */</span><br><span> #define PCU_IF_MSG_DATA_IND 0x02    /* receive data from given channel */</span><br><span style="color: hsl(120, 100%, 40%);">+#define PCU_IF_MSG_SUSP_REQ      0x03    /* BTS forwards GPRS SUSP REQ to PCU */</span><br><span> #define PCU_IF_MSG_RTS_REQ   0x10    /* ready to send request */</span><br><span> #define PCU_IF_MSG_DATA_CNF_DT   0x11    /* confirm (with direct tlli) */</span><br><span> #define PCU_IF_MSG_RACH_IND 0x22    /* receive RACH */</span><br><span>@@ -171,6 +172,13 @@</span><br><span>    uint8_t         identity_lv[9];</span><br><span> } __attribute__ ((packed));</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* BTS tells PCU about a GPRS SUSPENSION REQUEST received on DCCH */</span><br><span style="color: hsl(120, 100%, 40%);">+struct gsm_pcu_if_susp_req {</span><br><span style="color: hsl(120, 100%, 40%);">+        uint32_t        tlli;</span><br><span style="color: hsl(120, 100%, 40%);">+ uint8_t         ra_id[6];</span><br><span style="color: hsl(120, 100%, 40%);">+     uint8_t         cause;</span><br><span style="color: hsl(120, 100%, 40%);">+} __attribute__ ((packed));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> struct gsm_pcu_if {</span><br><span>         /* context based information */</span><br><span>      uint8_t         msg_type;       /* message type */</span><br><span>@@ -182,6 +190,7 @@</span><br><span>             struct gsm_pcu_if_data          data_cnf;</span><br><span>            struct gsm_pcu_if_data_cnf_dt   data_cnf_dt;</span><br><span>                 struct gsm_pcu_if_data          data_ind;</span><br><span style="color: hsl(120, 100%, 40%);">+             struct gsm_pcu_if_susp_req      susp_req;</span><br><span>            struct gsm_pcu_if_rts_req       rts_req;</span><br><span>             struct gsm_pcu_if_rach_ind      rach_ind;</span><br><span>            struct gsm_pcu_if_txt_ind       txt_ind;</span><br><span>diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp</span><br><span>index b59f198..5cabe4f 100644</span><br><span>--- a/src/pcu_l1_if.cpp</span><br><span>+++ b/src/pcu_l1_if.cpp</span><br><span>@@ -604,6 +604,22 @@</span><br><span>                                             pag_req->identity_lv);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+static int pcu_rx_susp_req(struct gsm_pcu_if_susp_req *susp_req)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+       struct bssgp_bvc_ctx *bctx = gprs_bssgp_pcu_current_bctx();</span><br><span style="color: hsl(120, 100%, 40%);">+   struct gprs_ra_id ra_id;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    gsm48_parse_ra(&ra_id, susp_req->ra_id);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     LOGP(DL1IF, LOGL_INFO, "GPRS Suspend request received: TLLI=0x%08x RAI=%s\n",</span><br><span style="color: hsl(120, 100%, 40%);">+               susp_req->tlli, osmo_rai_name(&ra_id));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      if (!bctx)</span><br><span style="color: hsl(120, 100%, 40%);">+            return -1;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  return bssgp_tx_suspend(bctx->nsei, susp_req->tlli, &ra_id);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> int pcu_rx(uint8_t msg_type, struct gsm_pcu_if *pcu_prim)</span><br><span> {</span><br><span>        int rc = 0;</span><br><span>@@ -630,6 +646,9 @@</span><br><span>    case PCU_IF_MSG_PAG_REQ:</span><br><span>             rc = pcu_rx_pag_req(&pcu_prim->u.pag_req);</span><br><span>            break;</span><br><span style="color: hsl(120, 100%, 40%);">+        case PCU_IF_MSG_SUSP_REQ:</span><br><span style="color: hsl(120, 100%, 40%);">+             rc = pcu_rx_susp_req(&pcu_prim->u.susp_req);</span><br><span style="color: hsl(120, 100%, 40%);">+           break;</span><br><span>       default:</span><br><span>             LOGP(DL1IF, LOGL_ERROR, "Received unknwon PCU msg type %d\n",</span><br><span>                      msg_type);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/3384">change 3384</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/3384"/><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-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I7b4beb413a6f974373a404b5a11c44d86ba695d3 </div>
<div style="display:none"> Gerrit-Change-Number: 3384 </div>
<div style="display:none"> Gerrit-PatchSet: 14 </div>
<div style="display:none"> Gerrit-Owner: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Max <msuraev@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: osmith <osmith@sysmocom.de> </div>