Change in osmo-bts[master]: bts-trx: Get rid of check_transceiver_availability_trx()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Thu Sep 23 10:00:26 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/25526 )

Change subject: bts-trx: Get rid of check_transceiver_availability_trx()
......................................................................

bts-trx: Get rid of check_transceiver_availability_trx()

Get rid of this helper function, which is a remain of past epochs
(pre-FSM). In the current uses, there's only 2 real cases: the "if" path
upon SET BTS ATTR received (and even that one should be moved as per
what the code comment states), and the one happening when the TRX is
closed.

it really makes no sense to DISABLE the TRX as a result of SET BTS ATTR.

Change-Id: I48adfeecd722684152c589bcba827079b0a78c3a
---
M src/osmo-bts-trx/l1_if.c
1 file changed, 10 insertions(+), 24 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  fixeria: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index 0fedcfc..9b210eb 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -87,26 +87,6 @@
 	return l1h;
 }
 
-static void check_transceiver_availability_trx(struct trx_l1h *l1h, int avail)
-{
-	struct phy_instance *pinst = l1h->phy_inst;
-	struct gsm_bts_trx *trx = pinst->trx;
-
-	/* HACK, we should change state when we receive first clock from
-	 * transceiver */
-	if (avail) {
-		/* signal availability */
-		if (!pinst->u.osmotrx.sw_act_reported) {
-			osmo_fsm_inst_dispatch(trx->mo.fi, NM_EV_SW_ACT, NULL);
-			osmo_fsm_inst_dispatch(trx->bb_transc.mo.fi, NM_EV_SW_ACT, NULL);
-			pinst->u.osmotrx.sw_act_reported = true;
-		}
-	} else {
-		osmo_fsm_inst_dispatch(trx->mo.fi, NM_EV_DISABLE, NULL);
-		osmo_fsm_inst_dispatch(trx->bb_transc.mo.fi, NM_EV_DISABLE, NULL);
-	}
-}
-
 int bts_model_lchan_deactivate(struct gsm_lchan *lchan)
 {
 	if (lchan->rel_act_kind == LCHAN_REL_ACT_REACT) {
@@ -211,7 +191,8 @@
 	osmo_fsm_inst_dispatch(l1h->provision_fi, TRX_PROV_EV_CLOSE, NULL);
 
 	/* Set to Operational State: Disabled */
-	check_transceiver_availability_trx(l1h, 0);
+	osmo_fsm_inst_dispatch(trx->mo.fi, NM_EV_DISABLE, NULL);
+	osmo_fsm_inst_dispatch(trx->bb_transc.mo.fi, NM_EV_DISABLE, NULL);
 }
 
 /* on RSL failure, deactivate transceiver */
@@ -234,7 +215,6 @@
 	struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
 	uint8_t bsic = bts->bsic;
 	struct gsm_bts_trx *trx;
-	struct phy_link *plink;
 
 	/* ARFCN for C0 is assigned during Set BTS Attr, see oml.c */
 	osmo_fsm_inst_dispatch(l1h->provision_fi, TRX_PROV_EV_CFG_ARFCN, (void *)(intptr_t)pinst->trx->arfcn);
@@ -242,10 +222,16 @@
 	llist_for_each_entry(trx, &bts->trx_list, list) {
 		pinst = trx_phy_instance(trx);
 		l1h = pinst->u.osmotrx.hdl;
-		plink = pinst->phy_link;
 
 		osmo_fsm_inst_dispatch(l1h->provision_fi, TRX_PROV_EV_CFG_BSIC, (void*)(intptr_t)bsic);
-		check_transceiver_availability_trx(l1h, phy_link_state_get(plink) != PHY_LINK_SHUTDOWN);
+		/* signal availability */
+		if (!pinst->u.osmotrx.sw_act_reported) {
+			/* HACK, we should change state when we receive first clock from
+			 * transceiver */
+			osmo_fsm_inst_dispatch(trx->mo.fi, NM_EV_SW_ACT, NULL);
+			osmo_fsm_inst_dispatch(trx->bb_transc.mo.fi, NM_EV_SW_ACT, NULL);
+			pinst->u.osmotrx.sw_act_reported = true;
+		}
 	}
 
 	return 0;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/25526
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I48adfeecd722684152c589bcba827079b0a78c3a
Gerrit-Change-Number: 25526
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210923/8c9cdfa2/attachment.htm>


More information about the gerrit-log mailing list