aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/bts.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-02-15 14:19:46 +0100
committerHarald Welte <laforge@gnumonks.org>2016-02-15 14:19:46 +0100
commitf5b42c34219ef8d01987b4d811be3bc8035e337d (patch)
tree9058d6a1b079f7d2ac5d9bff6cff24b4be5f43a2 /src/common/bts.c
parentf58542899a91d1db0bbe9966ae98ccdf449f45d0 (diff)
parenta02bf125accedddc43b2d8ce3093c72d4e41ffc3 (diff)
Merge branch 'laforge/phy-link'
this introduces the new phy_link / phy_instance interface, which is the basis of clean support for all kinds of multi-trx configurations with various BTS modules. WARNING: This breaks configuration file compatibility. You will need to introduce config nodes for 'phy' and 'instance', as well as the link from the 'trx' nodes towards the phy instance.
Diffstat (limited to 'src/common/bts.c')
-rw-r--r--src/common/bts.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/common/bts.c b/src/common/bts.c
index 43f4c255..222a82ce 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -44,6 +44,7 @@
#include <osmo-bts/oml.h>
#include <osmo-bts/signal.h>
+static void bts_update_agch_max_queue_length(struct gsm_bts *bts);
struct gsm_network bts_gsmnet = {
.bts_list = { &bts_gsmnet.bts_list, &bts_gsmnet.bts_list },
@@ -72,6 +73,8 @@ static int bts_signal_cbfn(unsigned int subsys, unsigned int signal,
return 0;
}
+/* Initialize the BTS (and TRX) data structures, called before config
+ * file reading */
int bts_init(struct gsm_bts *bts)
{
struct gsm_bts_role_bts *btsb;
@@ -255,6 +258,31 @@ int trx_link_estab(struct gsm_bts_trx *trx)
return 0;
}
+/* set the availability of the TRX (used by PHY driver) */
+int trx_set_available(struct gsm_bts_trx *trx, int avail)
+{
+ int tn;
+
+ LOGP(DSUM, LOGL_INFO, "TRX(%d): Setting available = %d\n",
+ trx->nr, avail);
+ if (avail) {
+ /* FIXME: This needs to be sorted out */
+#if 0
+ oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OFF_LINE);
+ oml_mo_state_chg(&trx->bb_transc.mo, -1, NM_AVSTATE_OFF_LINE);
+ for (tn = 0; tn < ARRAY_SIZE(trx->ts); tn++)
+ oml_mo_state_chg(&trx->ts[tn].mo, NM_OPSTATE_DISABLED, NM_AVSTATE_DEPENDENCY);
+#endif
+ } else {
+ oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED);
+ oml_mo_state_chg(&trx->bb_transc.mo, -1, NM_AVSTATE_NOT_INSTALLED);
+
+ for (tn = 0; tn < ARRAY_SIZE(trx->ts); tn++)
+ oml_mo_state_chg(&trx->ts[tn].mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED);
+ }
+ return 0;
+}
+
int lchan_init_lapdm(struct gsm_lchan *lchan)
{
struct lapdm_channel *lc = &lchan->lapdm_ch;
@@ -310,7 +338,7 @@ int bts_agch_max_queue_length(int T, int bcch_conf)
return (T + 2 * S) * ccch_rach_ratio256 / 256;
}
-void bts_update_agch_max_queue_length(struct gsm_bts *bts)
+static void bts_update_agch_max_queue_length(struct gsm_bts *bts)
{
struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
struct gsm48_system_information_type_3 *si3;