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.orgpespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/25679 )
Change subject: trx_provision_fsm: poweronff_sent flag: track POWERON and POWEROFF separately
......................................................................
trx_provision_fsm: poweronff_sent flag: track POWERON and POWEROFF separately
It helps better understanding the code, and will allow handling
situations where for instance a POWERON in in transit while the BTS is
instructed to shutdown, hence a POWEROFF needs to be sent.
Change-Id: Iaf62217ceab7420afa4140cba61e1c2f983c61b4
---
M include/osmo-bts/phy_link.h
M src/osmo-bts-trx/trx_provision_fsm.c
2 files changed, 11 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/79/25679/1
diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h
index ac38c28..862ed48 100644
--- a/include/osmo-bts/phy_link.h
+++ b/include/osmo-bts/phy_link.h
@@ -50,7 +50,8 @@
bool use_legacy_setbsic;
uint8_t trxd_pdu_ver_max; /* Maximum TRXD PDU version to negotiate */
bool powered; /* last POWERON (true) or POWEROFF (false) confirmed */
- bool poweronoff_sent; /* is there a POWERON/POWEROFF in transit? (one or the other based on ->powered) */
+ bool poweron_sent; /* is there a POWERON in transit? */
+ bool poweroff_sent; /* is there a POWEROFF in transit? */
} osmotrx;
struct {
char *mcast_dev; /* Network device for multicast */
diff --git a/src/osmo-bts-trx/trx_provision_fsm.c b/src/osmo-bts-trx/trx_provision_fsm.c
index 4ea6758..3d7eebf 100644
--- a/src/osmo-bts-trx/trx_provision_fsm.c
+++ b/src/osmo-bts-trx/trx_provision_fsm.c
@@ -50,12 +50,14 @@
struct phy_link *plink = pinst->phy_link;
plink->u.osmotrx.powered = poweronoff;
- plink->u.osmotrx.poweronoff_sent = false;
- if (poweronoff)
+ if (poweronoff) {
+ plink->u.osmotrx.poweron_sent = false;
osmo_fsm_inst_dispatch(l1h->provision_fi, TRX_PROV_EV_POWERON_CNF, (void*)(intptr_t)rc);
- else
+ } else {
+ plink->u.osmotrx.poweroff_sent = false;
osmo_fsm_inst_dispatch(l1h->provision_fi, TRX_PROV_EV_POWEROFF_CNF, (void*)(intptr_t)rc);
+ }
}
@@ -520,7 +522,7 @@
struct phy_instance *pinst = l1h->phy_inst;
trx_if_cmd_poweron(l1h, l1if_poweronoff_cb);
- pinst->phy_link->u.osmotrx.poweronoff_sent = true;
+ pinst->phy_link->u.osmotrx.poweron_sent = true;
}
static void st_open_wait_power_cnf(struct osmo_fsm_inst *fi, uint32_t event, void *data)
@@ -588,9 +590,9 @@
switch (event) {
case TRX_PROV_EV_CLOSE:
/* power off transceiver, if not already */
- if (pinst->num == 0 && plink->u.osmotrx.powered && !plink->u.osmotrx.poweronoff_sent) {
- trx_if_cmd_poweroff(l1h, l1if_poweronoff_cb);
- plink->u.osmotrx.poweronoff_sent = true;
+ if (pinst->num == 0 && plink->u.osmotrx.powered && !plink->u.osmotrx.poweroff_sent) {
+ trx_if_cmd_poweroff(l1h, l1if_poweronoff_cb);
+ plink->u.osmotrx.poweroff_sent = true;
}
trx_prov_fsm_state_chg(fi, TRX_PROV_ST_OPEN_WAIT_POWEROFF_CNF);
break;
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/25679
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Iaf62217ceab7420afa4140cba61e1c2f983c61b4
Gerrit-Change-Number: 25679
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211004/a8006a62/attachment.htm>