Currently the generation of SI2ter/SI2bis/SI5ter/SI5bis is always
disabled (see former patch 'si: Add a hack to disable
SI2ter/SI2bis/SI5ter/SI5bis messages').
This patch turns the hack into a configuration option, enabled by the
bts VTY command 'force-combined-si'.
Ticket: OW#1062
Sponsored-by: On-Waves ehf
---
openbsc/include/openbsc/gsm_data_shared.h | 3 +++
openbsc/src/libbsc/bsc_vty.c | 27 +++++++++++++++++++++++++++
openbsc/src/libbsc/system_information.c | 11 +++--------
openbsc/tests/vty_test_runner.py | 18 ++++++++++++++++++
4 files changed, 51 insertions(+), 8 deletions(-)
diff --git a/openbsc/include/openbsc/gsm_data_shared.h
b/openbsc/include/openbsc/gsm_data_shared.h
index b49a539..0922f78 100644
--- a/openbsc/include/openbsc/gsm_data_shared.h
+++ b/openbsc/include/openbsc/gsm_data_shared.h
@@ -670,6 +670,9 @@ struct gsm_bts {
int num_trx;
struct llist_head trx_list;
+ /* SI compatibility hacks */
+ int force_combined_si;
+
#ifdef ROLE_BSC
/* Abis NM queue */
struct llist_head abis_queue;
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index 7fa5ea7..4d09e15 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -636,6 +636,9 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts
*bts)
if (bts->excl_from_rf_lock)
vty_out(vty, " rf-lock-exclude%s", VTY_NEWLINE);
+ vty_out(vty, " %sforce-combined-si%s",
+ bts->force_combined_si ? "" : "no ", VTY_NEWLINE);
+
config_write_bts_model(vty, bts);
}
@@ -2658,6 +2661,28 @@ DEFUN(cfg_bts_no_excl_rf_lock,
return CMD_SUCCESS;
}
+#define FORCE_COMB_SI_STR "Force the generation of a single SI (no ter/bis)\n"
+
+DEFUN(cfg_bts_force_comb_si,
+ cfg_bts_force_comb_si_cmd,
+ "force-combined-si",
+ FORCE_COMB_SI_STR)
+{
+ struct gsm_bts *bts = vty->index;
+ bts->force_combined_si = 1;
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_bts_no_force_comb_si,
+ cfg_bts_no_force_comb_si_cmd,
+ "no force-combined-si",
+ NO_STR FORCE_COMB_SI_STR)
+{
+ struct gsm_bts *bts = vty->index;
+ bts->force_combined_si = 0;
+ return CMD_SUCCESS;
+}
+
#define TRX_TEXT "Radio Transceiver\n"
/* per TRX configuration */
@@ -3255,6 +3280,8 @@ int bsc_vty_init(const struct log_info *cat)
install_element(BTS_NODE, &cfg_bts_si5_neigh_cmd);
install_element(BTS_NODE, &cfg_bts_excl_rf_lock_cmd);
install_element(BTS_NODE, &cfg_bts_no_excl_rf_lock_cmd);
+ install_element(BTS_NODE, &cfg_bts_force_comb_si_cmd);
+ install_element(BTS_NODE, &cfg_bts_no_force_comb_si_cmd);
install_element(BTS_NODE, &cfg_trx_cmd);
install_node(&trx_node, dummy_config_write);
diff --git a/openbsc/src/libbsc/system_information.c
b/openbsc/src/libbsc/system_information.c
index cb67011..5f46bf9 100644
--- a/openbsc/src/libbsc/system_information.c
+++ b/openbsc/src/libbsc/system_information.c
@@ -44,7 +44,6 @@
* array. DCS1800 and PCS1900 can not be used at the same time so conserve
* memory and do the below.
*/
-#if 0
static int band_compatible(const struct gsm_bts *bts, int arfcn)
{
enum gsm_band band = gsm_arfcn2band(arfcn);
@@ -58,7 +57,6 @@ static int band_compatible(const struct gsm_bts *bts, int arfcn)
return 0;
}
-#endif
static int is_dcs_net(const struct gsm_bts *bts)
{
@@ -72,19 +70,16 @@ static int is_dcs_net(const struct gsm_bts *bts)
static int use_arfcn(const struct gsm_bts *bts, const int bis, const int ter,
const int pgsm, const int arfcn)
{
- if (bis || ter)
- return 0;
- return 1;
-#if 0
- Correct but somehow broken with either the nanoBTS or the iPhone5
if (!bis && !ter && band_compatible(bts, arfcn))
return 1;
+ if (bts->force_combined_si)
+ return 0;
+ /* Correct but somehow broken with either the nanoBTS or the iPhone5 */
if (bis && pgsm && band_compatible(bts, arfcn) && (arfcn < 1
|| arfcn > 124))
return 1;
if (ter && !band_compatible(bts, arfcn))
return 1;
return 0;
-#endif
}
/* Frequency Lists as per TS 04.08 10.5.2.13 */
diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py
index 16eb213..47e1ad1 100644
--- a/openbsc/tests/vty_test_runner.py
+++ b/openbsc/tests/vty_test_runner.py
@@ -173,6 +173,24 @@ class TestVTYNITB(TestVTYGenericBSC):
self.assertEquals(res.find('periodic location update 60'), -1)
self.assert_(res.find('no periodic location update') > 0)
+ def testEnableDisableSiHacks(self):
+ self.vty.enable()
+ self.vty.command("configure terminal")
+ self.vty.command("network")
+ self.vty.command("bts 0")
+
+ # Enable periodic lu..
+ self.vty.verify("force-combined-si", [''])
+ res = self.vty.command("write terminal")
+ self.assert_(res.find(' force-combined-si') > 0)
+ self.assertEquals(res.find('no force-combined-si'), -1)
+
+ # Now disable it..
+ self.vty.verify("no force-combined-si", [''])
+ res = self.vty.command("write terminal")
+ self.assertEquals(res.find(' force-combined-si'), -1)
+ self.assert_(res.find('no force-combined-si') > 0)
+
def testRachAccessControlClass(self):
self.vty.enable()
self.vty.command("configure terminal")
--
1.7.9.5