tbf_fsm: Move osmo_fsm_inst fi out of struct tbf_fsm_ctx

This is a preparatory step towards splitting tbf_fsm.c into tbf_ul_fsm.c
and tbf_dl_fsm.c.
In order to accomplish it, the struct tbf_fsm_ctx will also be
duplicated (and each one will contain a explicit ul_tbf/dl_tbf pointer).
Hence, a DL_TBF will have a struct tbf_dl_fsm_ctx and a UL_TBF will have
a struct tbf_ul_fsm_ctx, since those hold implementation specific
state. However, the FSM interface will be partly shared (events,
states), and hence we want to keep the "fi" pointer into the "tbf"
parent class so that it can be used regardless of the tbf direction
type.

Change-Id: I03e691ccf6a94431caa55653349158f5b85db017
diff --git a/src/tbf.h b/src/tbf.h
index 678607b..b2d8db6 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -257,6 +257,7 @@
 	time_t m_created_ts;
 
 	struct rate_ctr_group *m_ctrs;
+	struct osmo_fsm_inst *state_fi;
 	struct tbf_fsm_ctx state_fsm;
 	struct tbf_ul_ass_fsm_ctx ul_ass_fsm;
 	struct tbf_ul_ass_fsm_ctx dl_ass_fsm;
@@ -302,7 +303,7 @@
 
 inline const char *gprs_rlcmac_tbf::state_name() const
 {
-	return osmo_fsm_inst_state_name(state_fsm.fi);
+	return osmo_fsm_inst_state_name(state_fi);
 }
 
 inline bool gprs_rlcmac_tbf::check_n_clear(uint8_t state_flag)
@@ -329,9 +330,9 @@
 {
 	/* The TBF is established or has been assigned by a IMM.ASS for
 	 * download */
-	return state_fsm.fi->state > TBF_ST_ASSIGN ||
+	return state_fi->state > TBF_ST_ASSIGN ||
 		(direction == GPRS_RLCMAC_DL_TBF &&
-		 state_fsm.fi->state == TBF_ST_ASSIGN &&
+		 state_fi->state == TBF_ST_ASSIGN &&
 		 (state_fsm.state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH)));
 }