aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx/trx_if.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-06-24 18:42:00 +0200
committerHarald Welte <laforge@gnumonks.org>2017-08-09 13:03:33 +0000
commitfe6c75d24a1751341bcee91cb45c7ac7f5d07da3 (patch)
tree2933e2de8bab066c11d4e602b886f5a92f8a9939 /src/osmo-bts-trx/trx_if.c
parentbd65b72f91f195dd9b6ea2df67d6d1b36b1e9864 (diff)
TRX: Remove global variables, move SETBSIC/SETTSC handling into phy_link
Whether or not we are talking to an OpenBTS (SETBSIC) or OsmoTRX (SETTSC) transceiver is a property of the phy_link, and not a property of the BTS. Also, we *really, really* should never use global variables. I'm very happy this is being cleaned up, finally. Change-Id: I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c
Diffstat (limited to 'src/osmo-bts-trx/trx_if.c')
-rw-r--r--src/osmo-bts-trx/trx_if.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index 8ce28936..86a3b9be 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -51,8 +51,6 @@
//#define TOA_RSSI_DEBUG
int transceiver_available = 0;
-int settsc_enabled = 0;
-int setbsic_enabled = 0;
#define TRX_MAX_BURST_LEN 512
@@ -248,21 +246,21 @@ int trx_if_cmd_poweron(struct trx_l1h *l1h)
/*! Send "SETTSC" command to TRX */
int trx_if_cmd_settsc(struct trx_l1h *l1h, uint8_t tsc)
{
- if (!settsc_enabled)
+ struct phy_instance *pinst = l1h->phy_inst;
+ if (pinst->phy_link->u.osmotrx.use_legacy_setbsic)
return 0;
- /* if TSC is enabled only, the positive response is mandatory */
- return trx_ctrl_cmd(l1h, (setbsic_enabled) ? 0 : 1, "SETTSC", "%d",
- tsc);
+
+ return trx_ctrl_cmd(l1h, 1, "SETTSC", "%d", tsc);
}
/*! Send "SETBSIC" command to TRX */
int trx_if_cmd_setbsic(struct trx_l1h *l1h, uint8_t bsic)
{
- if (!setbsic_enabled)
+ struct phy_instance *pinst = l1h->phy_inst;
+ if (!pinst->phy_link->u.osmotrx.use_legacy_setbsic)
return 0;
- /* if BSIC is enabled only, the positive response is mandatory */
- return trx_ctrl_cmd(l1h, (settsc_enabled) ? 0 : 1, "SETBSIC", "%d",
- bsic);
+
+ return trx_ctrl_cmd(l1h, 1, "SETBSIC", "%d", bsic);
}
/*! Send "SETRXGAIN" command to TRX */