laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/21084 )

Change subject: abis_rsl: parse cm3 and indicate ACCH repetition cap to BTS
......................................................................

abis_rsl: parse cm3 and indicate ACCH repetition cap to BTS

In order to activate FACCH/SACCH repetition on the BTS, the classmark 3
IE in the CLASSMARK CHANGE message must be parsed and depending on the
Repeated ACCH Capability bit the RSL_IE_OSMO_REP_ACCH_CAP is added to
the RSL CHAN ACT und RSL CHAN MODE MODIFY. Since
RSL_IE_OSMO_REP_ACCH_CAP is a propritary IE, it may only be added for
BTS type osmo-bts.

Change-Id: I39ae439d05562b35b2e47774dc92f8789fea1a57
Related: OS#4796 SYS#5114
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/gsm_08_08.c
3 files changed, 43 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index ed40e36..a5b5a50 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -322,6 +322,9 @@
                        enum subscr_sccp_state state;
                } lb;
        } lcs;
+
+       struct gsm48_classmark3 cm3;
+       bool cm3_valid;
 };


diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 858c683..f8ea5a5 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -457,6 +457,35 @@
                     lchan->mr_bts_lv + 1);
 }

+/* indicate FACCH/SACCH Repetition to be performed by BTS,
+ * see also: 3GPP TS 44.006, section 10 and 11 */
+static void rep_acch_cap_for_bts(struct gsm_lchan *lchan,
+                                struct msgb *msg)
+{
+       struct abis_rsl_osmo_rep_acch_cap *cap;
+       struct gsm_bts *bts = lchan->ts->trx->bts;
+
+       /* The RSL_IE_OSMO_REP_ACCH_CAP IE is a proprietary IE, that can only
+        * be used with osmo-bts type BTSs */
+       if (!(bts->model->type == GSM_BTS_TYPE_OSMOBTS
+             && osmo_bts_has_feature(&bts->features, BTS_FEAT_ACCH_REP)))
+               return;
+
+       cap = (struct abis_rsl_osmo_rep_acch_cap*) msg->tail;
+       msgb_tlv_put(msg, RSL_IE_OSMO_REP_ACCH_CAP, sizeof(*cap),
+                    (uint8_t*) &bts->repeated_acch_policy);
+
+       if (!(lchan->conn && lchan->conn->cm3_valid
+             && lchan->conn->cm3.repeated_acch_capability)) {
+               /* MS supports only FACCH repetition for command frames, so
+                * we mask out all other features, even when they are enabled
+                * on this BTS. */
+               cap->dl_facch_all = 0;
+               cap->dl_sacch = 0;
+               cap->ul_sacch = 0;
+       }
+}
+
 /* Chapter 8.4.1 */
 int rsl_tx_chan_activ(struct gsm_lchan *lchan, uint8_t act_type, uint8_t 
ho_ref)
 {
@@ -552,6 +581,7 @@
           better skip sending it unless we know for sure what each expects. */

        mr_config_for_bts(lchan, msg);
+       rep_acch_cap_for_bts(lchan, msg);

        msg->dst = trx->rsl_link;

@@ -590,6 +620,7 @@
        }

        mr_config_for_bts(lchan, msg);
+        rep_acch_cap_for_bts(lchan, msg);

        msg->dst = lchan->ts->trx->rsl_link;

diff --git a/src/osmo-bsc/gsm_08_08.c b/src/osmo-bsc/gsm_08_08.c
index 2c51c95..9c5cf2f 100644
--- a/src/osmo-bsc/gsm_08_08.c
+++ b/src/osmo-bsc/gsm_08_08.c
@@ -34,6 +34,7 @@
 #include <osmocom/bsc/lcs_loc_req.h>

 #include <osmocom/gsm/protocol/gsm_08_08.h>
+#include <osmocom/gsm/protocol/gsm_04_08.h>
 #include <osmocom/gsm/gsm0808.h>
 #include <osmocom/gsm/mncc.h>
 #include <osmocom/gsm/gsm48.h>
@@ -602,6 +603,14 @@
        }
        conn_update_ms_power_class(conn, rc8);

+        rc = gsm48_decode_classmark3(&conn->cm3, cm3, cm3_len);
+       if (rc < 0) {
+               LOGP(DMSC, LOGL_NOTICE, "Unable to decode classmark3 during CM 
Update.\n");
+               memset(&conn->cm3, 0, sizeof(conn->cm3));
+               conn->cm3_valid = false;
+       } else
+               conn->cm3_valid = true;
+
        if (!msc_connected(conn))
                return;


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/21084
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I39ae439d05562b35b2e47774dc92f8789fea1a57
Gerrit-Change-Number: 21084
Gerrit-PatchSet: 12
Gerrit-Owner: dexter <pma...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de>
Gerrit-Reviewer: laforge <lafo...@osmocom.org>
Gerrit-Reviewer: neels <nhofm...@sysmocom.de>
Gerrit-Reviewer: pespin <pes...@sysmocom.de>
Gerrit-MessageType: merged

Reply via email to