From fe6c75d24a1751341bcee91cb45c7ac7f5d07da3 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 24 Jun 2017 18:42:00 +0200 Subject: 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 --- src/osmo-bts-trx/trx_if.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/osmo-bts-trx/trx_if.c') 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 */ -- cgit v1.2.3