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

Change subject: Introduce VTY command to disable srvcc fast-return on target BTS
......................................................................

Introduce VTY command to disable srvcc fast-return on target BTS

Related: SYS#5337
Change-Id: I2ac91b5dffc9b6de60576aabe21a15f24fea38cb
---
M include/osmocom/bsc/bsc_subscr_conn_fsm.h
M include/osmocom/bsc/bts.h
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/bsc_subscr_conn_fsm.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts.c
M src/osmo-bsc/handover_fsm.c
M src/osmo-bsc/osmo_bsc_bssap.c
8 files changed, 47 insertions(+), 13 deletions(-)

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



diff --git a/include/osmocom/bsc/bsc_subscr_conn_fsm.h 
b/include/osmocom/bsc/bsc_subscr_conn_fsm.h
index a681bc4..d7deb06 100644
--- a/include/osmocom/bsc/bsc_subscr_conn_fsm.h
+++ b/include/osmocom/bsc/bsc_subscr_conn_fsm.h
@@ -93,6 +93,8 @@

 static inline const struct osmo_plmn_id *gscon_last_eutran_plmn(const struct 
gsm_subscriber_connection *conn)
 {
-       return (conn && conn->last_eutran_plmn_valid) ?
-               &conn->last_eutran_plmn : NULL;
+       return (conn && conn->fast_return.allowed &&
+               conn->fast_return.last_eutran_plmn_valid) ?
+                       &conn->fast_return.last_eutran_plmn :
+                       NULL;
 }
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index 72f83eb..4436ed0 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -539,6 +539,9 @@

        /* We will ignore CHAN RQD with access delay greater than 
rach_max_delay */
        uint8_t rach_max_delay;
+
+       /* Is Fast return to LTE allowed during Chan Release in this BTS? */
+       bool srvcc_fast_return_allowed;
 };

 #define GSM_BTS_SI2Q(bts, i)   (struct gsm48_system_information_type_2quater 
*)((bts)->si_buf[SYSINFO_TYPE_2quater][i])
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index d3d5b7d..37e3899 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -388,8 +388,11 @@
        struct gsm48_classmark3 cm3;
        bool cm3_valid;

-       bool last_eutran_plmn_valid;
-       struct osmo_plmn_id last_eutran_plmn;
+       struct {
+               bool allowed; /* Is fast return to LTE allowed once the conn is 
released? */
+               bool last_eutran_plmn_valid; /* Is information stored in field 
below available? */
+               struct osmo_plmn_id last_eutran_plmn;
+       } fast_return;
 };


diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c 
b/src/osmo-bsc/bsc_subscr_conn_fsm.c
index 8b89e1a..c4a7875 100644
--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c
+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c
@@ -885,10 +885,11 @@
                                bsc_subscr_set_imsi(conn->bsub, mi_imsi.imsi);
                }
                if (TLVP_PRESENT(tp, GSM0808_IE_LAST_USED_EUTRAN_PLMN_ID)) {
-                       conn->last_eutran_plmn_valid = true;
-                       osmo_plmn_from_bcd(TLVP_VAL(tp, 
GSM0808_IE_LAST_USED_EUTRAN_PLMN_ID), &conn->last_eutran_plmn);
+                       conn->fast_return.allowed = true; /* Always allowed for 
CSFB */
+                       conn->fast_return.last_eutran_plmn_valid = true;
+                       osmo_plmn_from_bcd(TLVP_VAL(tp, 
GSM0808_IE_LAST_USED_EUTRAN_PLMN_ID), &conn->fast_return.last_eutran_plmn);
                        LOGPFSML(fi, LOGL_DEBUG, "subscr comes from E-UTRAN 
PLMN %s\n",
-                                osmo_plmn_name(&conn->last_eutran_plmn));
+                                
osmo_plmn_name(&conn->fast_return.last_eutran_plmn));
                }
                gscon_update_id(conn);
                break;
diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 880bd94..707d99c 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -1289,6 +1289,9 @@
                        VTY_NEWLINE);
        }

+       if (!bts->srvcc_fast_return_allowed)
+               vty_out(vty, "  srvcc fast-return forbid%s", VTY_NEWLINE);
+
        /* BS/MS Power Control parameters */
        config_write_power_ctrl(vty, 2, &bts->bs_power_ctrl);
        config_write_power_ctrl(vty, 2, &bts->ms_power_ctrl);
@@ -5001,6 +5004,20 @@
        return CMD_SUCCESS;
 }

+DEFUN_ATTR(cfg_bts_srvcc_fast_return, cfg_bts_srvcc_fast_return_cmd,
+          "srvcc fast-return (allow|forbid)",
+          "SRVCC Configuration\n"
+          "Allow or forbid Fast Return to 4G on Channel Release in this BTS\n"
+          "Allow\n"
+          "Forbid\n",
+          CMD_ATTR_IMMEDIATE)
+{
+       struct gsm_bts *bts = vty->index;
+
+       bts->srvcc_fast_return_allowed = strcmp(argv[0], "allow") == 0;
+       return CMD_SUCCESS;
+}
+
 #define BS_POWER_CONTROL_CMD \
        "bs-power-control"
 #define MS_POWER_CONTROL_CMD \
@@ -8105,6 +8122,7 @@
        install_element(BTS_NODE, &cfg_bts_rep_rxqual_cmd);
        install_element(BTS_NODE, &cfg_bts_interf_meas_avg_period_cmd);
        install_element(BTS_NODE, &cfg_bts_interf_meas_level_bounds_cmd);
+       install_element(BTS_NODE, &cfg_bts_srvcc_fast_return_cmd);

        neighbor_ident_vty_init();
        /* See also handover commands added on bts level from handover_vty.c */
diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c
index 4b02042..e140565 100644
--- a/src/osmo-bsc/bts.c
+++ b/src/osmo-bsc/bts.c
@@ -362,6 +362,9 @@

        bts->rach_max_delay = 63;

+       /* SRVCC is enabled by default */
+       bts->srvcc_fast_return_allowed = true;
+
        return bts;
 }

diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c
index 8141a5d..08b1dc7 100644
--- a/src/osmo-bsc/handover_fsm.c
+++ b/src/osmo-bsc/handover_fsm.c
@@ -721,9 +721,10 @@
        }

        if (req->last_eutran_plmn_valid) {
-               conn->last_eutran_plmn_valid = true;
-               memcpy(&conn->last_eutran_plmn, &req->last_eutran_plmn,
-                      sizeof(conn->last_eutran_plmn));
+               conn->fast_return.allowed = 
ho->new_bts->srvcc_fast_return_allowed;
+               conn->fast_return.last_eutran_plmn_valid = true;
+               memcpy(&conn->fast_return.last_eutran_plmn, 
&req->last_eutran_plmn,
+                      sizeof(conn->fast_return.last_eutran_plmn));
        }

        lchan_activate(ho->new_lchan, &info);
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index da0429b..563a957 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -460,7 +460,7 @@
        }

        if (TLVP_PRESENT(&tp, GSM0808_IE_CSFB_INDICATION) &&
-           !conn->last_eutran_plmn_valid) {
+           !conn->fast_return.last_eutran_plmn_valid) {
                LOGPFSML(conn->fi, LOGL_NOTICE,
                         "Clear Command: CSFB Indication present, "
                         "but subscriber has no Last Used E-UTRAN PLMN Id! "
@@ -1372,10 +1372,13 @@
                .current_channel_type_1 = 
gsm0808_current_channel_type_1(lchan->type),
        };

-       if (conn->last_eutran_plmn_valid) {
+       /* Even if fast_return is now allowed locally, we may still want to
+        * signal the Last EUTRAN PLMN Id to the new cell, since destination
+        * config may differ and allow fast return */
+       if (conn->fast_return.last_eutran_plmn_valid) {
                params.old_bss_to_new_bss_info_present = true;
                params.old_bss_to_new_bss_info.last_eutran_plmn_id_present = 
true;
-               params.old_bss_to_new_bss_info.last_eutran_plmn_id = 
conn->last_eutran_plmn;
+               params.old_bss_to_new_bss_info.last_eutran_plmn_id = 
conn->fast_return.last_eutran_plmn;
        }

        switch (lchan->type) {

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I2ac91b5dffc9b6de60576aabe21a15f24fea38cb
Gerrit-Change-Number: 24666
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pes...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pma...@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