osmo-trx: Add multi_arfcn support

2nd TRX arfcn is changed in defaults.conf because multi_arfcn requires
them to be alocated in steps of 4 starting from TRX0.

It is not enabled by default yet on B200 (it must use it to support
several TRX) because current host running osmo-gsm-tester is not
performant enough and cannot keep up with timers due to multi-arfcn CPU
overhead.

Change-Id: I096df82ad1f4cbb41dfbd6a78466a845f34be385
diff --git a/example/defaults.conf b/example/defaults.conf
index 7ad5e1f..42258a6 100644
--- a/example/defaults.conf
+++ b/example/defaults.conf
@@ -48,7 +48,7 @@
     - phys_chan_config: PDCH
   - nominal_power: 23
     max_power_red: 0
-    arfcn: 870
+    arfcn: 872
     timeslot_list:
     - phys_chan_config: TCH/F
     - phys_chan_config: TCH/F
diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py
index a4bc082..e7e3542 100644
--- a/src/osmo_gsm_tester/bts_osmotrx.py
+++ b/src/osmo_gsm_tester/bts_osmotrx.py
@@ -174,6 +174,8 @@
         self.dbg(config_file=self.config_file)
 
         values = self.conf
+        multi_arfcn_bool = util.str2bool(values.get('osmo_trx', {}).get('multi_arfcn', False))
+        config.overlay(values, { 'osmo_trx': { 'multi_arfcn': multi_arfcn_bool } })
 
         self.dbg('OSMO-TRX CONFIG:\n' + pprint.pformat(values))
 
diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py
index 9ca5665..e043d87 100644
--- a/src/osmo_gsm_tester/resource.py
+++ b/src/osmo_gsm_tester/resource.py
@@ -72,6 +72,7 @@
         'bts[].osmo_trx.type': schema.STR,
         'bts[].osmo_trx.clock_reference': schema.OSMO_TRX_CLOCK_REF,
         'bts[].osmo_trx.trx_ip': schema.IPV4,
+        'bts[].osmo_trx.multi_arfcn': schema.BOOL_STR,
         'arfcn[].arfcn': schema.INT,
         'arfcn[].band': schema.BAND,
         'modem[].label': schema.STR,
diff --git a/src/osmo_gsm_tester/templates/osmo-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-trx.cfg.tmpl
index 2f6e830..0003f1b 100644
--- a/src/osmo_gsm_tester/templates/osmo-trx.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-trx.cfg.tmpl
@@ -19,6 +19,11 @@
  remote-ip ${osmo_trx.bts_ip}
  base-port 5700
  egprs disable
+%if osmo_trx.get('multi_arfcn', False):
+ multi-arfcn enable
+%else:
+ multi-arfcn disable
+%endif
  tx-sps 4
  rx-sps 4
  clock-ref ${osmo_trx.clock_reference}