diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-09-20 17:59:21 +0200 |
---|---|---|
committer | pespin <pespin@sysmocom.de> | 2021-09-23 12:07:29 +0000 |
commit | dfedf2cb76cb47b729ebf22cce6e5b4d549b946c (patch) | |
tree | e25c804841a11a935bc9d321af20e66cb58cfbd7 /src/osmo-bts-trx/trx_if.c | |
parent | 192390c797bd82823636027df61c308dc4d1dcc0 (diff) |
phy_link: Introduce bts_model_phy_link_close() and use it in bts-trx
This step is required while turning off the BTS without killing the
process. Right now only osmo-bts-trx supports this feature, so this
function is only available and used by osmo-bts-trx.
Later on, when the feature is support more generally, we can move call
to this function to common place like bts_shutdown_fsm or alike.
Change-Id: I3253112700a31b85db82dc7ccadec8542bac745e
Diffstat (limited to 'src/osmo-bts-trx/trx_if.c')
-rw-r--r-- | src/osmo-bts-trx/trx_if.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 1a920476..f0c87469 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -1341,6 +1341,23 @@ cleanup: return -1; } +/*! close the PHY link using TRX protocol */ +int bts_model_phy_link_close(struct phy_link *plink) +{ + bool clock_stopped = false; + struct phy_instance *pinst; + llist_for_each_entry(pinst, &plink->instances, list) { + if (!clock_stopped) { + clock_stopped = true; + trx_sched_clock_stopped(pinst->trx->bts); + } + trx_phy_inst_close(pinst); + } + trx_udp_close(&plink->u.osmotrx.trx_ofd_clk); + phy_link_state_set(plink, PHY_LINK_SHUTDOWN); + return 0; +} + /*! determine if the TRX for given handle is powered up */ int trx_if_powered(struct trx_l1h *l1h) { |