diff options
-rw-r--r-- | include/osmo-bts/phy_link.h | 3 | ||||
-rw-r--r-- | src/osmo-bts-trx/trx_provision_fsm.c | 16 |
2 files changed, 11 insertions, 8 deletions
diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index ac38c289..862ed48f 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -50,7 +50,8 @@ struct phy_link { 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 4ea67584..3d7eebfc 100644 --- a/src/osmo-bts-trx/trx_provision_fsm.c +++ b/src/osmo-bts-trx/trx_provision_fsm.c @@ -50,12 +50,14 @@ static void l1if_poweronoff_cb(struct trx_l1h *l1h, bool poweronoff, int rc) 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 @@ static void st_open_wait_power_cnf_on_enter(struct osmo_fsm_inst *fi, uint32_t p 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 @@ static void st_open_poweron(struct osmo_fsm_inst *fi, uint32_t event, void *data 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; |