fixeria submitted this change.

View Change

Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved pespin: Looks good to me, approved
trxcon: cosmetic: rename 'trx->fsm' to 'trx->fi'

Make it cleaner that it's an FSM *instance*.

Change-Id: I688b903fe21086beca7fb86dcee90f6f751d7cc3
---
M src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h
M src/host/trxcon/src/trx_if.c
M src/host/trxcon/src/trxcon.c
3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h b/src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h
index e205c93..0e9c849 100644
--- a/src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h
+++ b/src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h
@@ -30,7 +30,7 @@

struct osmo_timer_list trx_ctrl_timer;
struct llist_head trx_ctrl_list;
- struct osmo_fsm_inst *fsm;
+ struct osmo_fsm_inst *fi;

/* HACK: we need proper state machines */
uint32_t prev_state;
diff --git a/src/host/trxcon/src/trx_if.c b/src/host/trxcon/src/trx_if.c
index d3bf160..f2317a9 100644
--- a/src/host/trxcon/src/trx_if.c
+++ b/src/host/trxcon/src/trx_if.c
@@ -149,9 +149,9 @@
send(trx->trx_ofd_ctrl.fd, tcm->cmd, strlen(tcm->cmd) + 1, 0);

/* Trigger state machine */
- if (trx->fsm->state != TRX_STATE_RSP_WAIT) {
- trx->prev_state = trx->fsm->state;
- osmo_fsm_inst_state_chg(trx->fsm, TRX_STATE_RSP_WAIT, 0, 0);
+ if (trx->fi->state != TRX_STATE_RSP_WAIT) {
+ trx->prev_state = trx->fi->state;
+ osmo_fsm_inst_state_chg(trx->fi, TRX_STATE_RSP_WAIT, 0, 0);
}

/* Start expire timer */
@@ -175,7 +175,7 @@
tcm = llist_entry(trx->trx_ctrl_list.next, struct trx_ctrl_msg, list);
if (++tcm->retry_cnt > 3) {
LOGP(DTRX, LOGL_NOTICE, "Transceiver offline\n");
- osmo_fsm_inst_state_chg(trx->fsm, TRX_STATE_OFFLINE, 0, 0);
+ osmo_fsm_inst_state_chg(trx->fi, TRX_STATE_OFFLINE, 0, 0);
osmo_fsm_inst_dispatch(trxcon->fi, TRX_EVENT_OFFLINE, trx);
return;
}
@@ -538,18 +538,18 @@
/* Trigger state machine */
if (!strncmp(tcm->cmd + 4, "POWERON", 7)) {
trx->powered_up = true;
- osmo_fsm_inst_state_chg(trx->fsm, TRX_STATE_ACTIVE, 0, 0);
+ osmo_fsm_inst_state_chg(trx->fi, TRX_STATE_ACTIVE, 0, 0);
}
else if (!strncmp(tcm->cmd + 4, "POWEROFF", 8)) {
trx->powered_up = false;
- osmo_fsm_inst_state_chg(trx->fsm, TRX_STATE_IDLE, 0, 0);
+ osmo_fsm_inst_state_chg(trx->fi, TRX_STATE_IDLE, 0, 0);
}
else if (!strncmp(tcm->cmd + 4, "MEASURE", 7))
trx_if_measure_rsp_cb(trx, buf + 14);
else if (!strncmp(tcm->cmd + 4, "ECHO", 4))
- osmo_fsm_inst_state_chg(trx->fsm, TRX_STATE_IDLE, 0, 0);
+ osmo_fsm_inst_state_chg(trx->fi, TRX_STATE_IDLE, 0, 0);
else
- osmo_fsm_inst_state_chg(trx->fsm, trx->prev_state, 0, 0);
+ osmo_fsm_inst_state_chg(trx->fi, trx->prev_state, 0, 0);

/* Remove command from list */
llist_del(&tcm->list);
@@ -664,7 +664,7 @@
* transceiver and its TRXC interface.
*/
#if 0
- if (trx->fsm->state != TRX_STATE_ACTIVE) {
+ if (trx->fi->state != TRX_STATE_ACTIVE) {
LOGP(DTRXD, LOGL_ERROR, "Ignoring TX data, "
"transceiver isn't ready\n");
return -EAGAIN;
@@ -711,9 +711,9 @@

/* Allocate a new dedicated state machine */
/* TODO: allocate it as a child of trxcon->fi */
- trx->fsm = osmo_fsm_inst_alloc(&trx_fsm, trx,
+ trx->fi = osmo_fsm_inst_alloc(&trx_fsm, trx,
NULL, LOGL_DEBUG, "trx_interface");
- if (trx->fsm == NULL) {
+ if (trx->fi == NULL) {
LOGP(DTRX, LOGL_ERROR, "Failed to allocate an instance "
"of FSM '%s'\n", trx_fsm.name);
talloc_free(trx);
@@ -740,7 +740,7 @@

udp_error:
LOGP(DTRX, LOGL_ERROR, "Couldn't establish UDP connection\n");
- osmo_fsm_inst_free(trx->fsm);
+ osmo_fsm_inst_free(trx->fi);
talloc_free(trx);
return NULL;
}
@@ -751,7 +751,7 @@
struct trx_ctrl_msg *tcm;

/* Reset state machine */
- osmo_fsm_inst_state_chg(trx->fsm, TRX_STATE_IDLE, 0, 0);
+ osmo_fsm_inst_state_chg(trx->fi, TRX_STATE_IDLE, 0, 0);

/* Clear command queue */
while (!llist_empty(&trx->trx_ctrl_list)) {
@@ -778,7 +778,7 @@
trx_udp_close(&trx->trx_ofd_data);

/* Free memory */
- osmo_fsm_inst_free(trx->fsm);
+ osmo_fsm_inst_free(trx->fi);
talloc_free(trx);
}

diff --git a/src/host/trxcon/src/trxcon.c b/src/host/trxcon/src/trxcon.c
index d6f9157..77f481a 100644
--- a/src/host/trxcon/src/trxcon.c
+++ b/src/host/trxcon/src/trxcon.c
@@ -270,7 +270,7 @@
case L1CTL_EVENT_DISCONNECT:
osmo_fsm_inst_state_chg(fi, TRXCON_STATE_IDLE, 0, 0);

- if (trxcon->trx->fsm->state != TRX_STATE_OFFLINE) {
+ if (trxcon->trx->fi->state != TRX_STATE_OFFLINE) {
/* Reset scheduler and clock counter */
l1sched_reset(trxcon->sched, true);


To view, visit change 28673. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I688b903fe21086beca7fb86dcee90f6f751d7cc3
Gerrit-Change-Number: 28673
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged