diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2020-11-06 23:19:45 +0100 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2020-12-01 11:58:24 +0000 |
commit | 0eb479e2831cfcb3e65bdce727b7b9909d2d5d09 (patch) | |
tree | 1d235a86364dcb6ee1b8239c5fad67e5d912e3f8 | |
parent | ca878ff4dff1fc88902732151f0eeed80347c985 (diff) |
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
-rw-r--r-- | include/osmocom/bsc/gsm_data.h | 3 | ||||
-rw-r--r-- | src/osmo-bsc/abis_rsl.c | 31 | ||||
-rw-r--r-- | src/osmo-bsc/gsm_08_08.c | 9 |
3 files changed, 43 insertions, 0 deletions
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index ed40e360f..a5b5a50f7 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -322,6 +322,9 @@ struct gsm_subscriber_connection { 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 858c683e1..f8ea5a5d7 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -457,6 +457,35 @@ static void mr_config_for_bts(struct gsm_lchan *lchan, struct msgb *msg) 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 @@ int rsl_tx_chan_activ(struct gsm_lchan *lchan, uint8_t act_type, uint8_t ho_ref) 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 @@ int rsl_chan_mode_modify_req(struct gsm_lchan *lchan) } 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 2c51c958a..9c5cf2faf 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 @@ void bsc_cm_update(struct gsm_subscriber_connection *conn, } 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; |