tbf_fsm: rename state NULL -> NEW
This helps distinguishing the case where a TBF is in the initial state
and the unexpected case where osmo_fsm_inst_state_name reports "NULL"
due to fi pointer being NULL.
Change-Id: Ieaabfc9fa0dedb299bcf4541783cf80e366a88c3
diff --git a/src/tbf_fsm.c b/src/tbf_fsm.c
index 0b6a2a3..d1d4668 100644
--- a/src/tbf_fsm.c
+++ b/src/tbf_fsm.c
@@ -32,7 +32,7 @@
#define X(s) (1 << (s))
const struct osmo_tdef_state_timeout tbf_fsm_timeouts[32] = {
- [TBF_ST_NULL] = {},
+ [TBF_ST_NEW] = {},
[TBF_ST_ASSIGN] = { },
[TBF_ST_FLOW] = { },
[TBF_ST_FINISHED] = {},
@@ -97,7 +97,7 @@
}
-static void st_null(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+static void st_new(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct tbf_fsm_ctx *ctx = (struct tbf_fsm_ctx *)fi->priv;
switch (event) {
@@ -392,7 +392,7 @@
}
static struct osmo_fsm_state tbf_fsm_states[] = {
- [TBF_ST_NULL] = {
+ [TBF_ST_NEW] = {
.in_event_mask =
X(TBF_EV_ASSIGN_ADD_CCCH) |
X(TBF_EV_ASSIGN_ADD_PACCH),
@@ -400,8 +400,8 @@
X(TBF_ST_ASSIGN) |
X(TBF_ST_FLOW) |
X(TBF_ST_RELEASING),
- .name = "NULL",
- .action = st_null,
+ .name = "NEW",
+ .action = st_new,
},
[TBF_ST_ASSIGN] = {
.in_event_mask =
diff --git a/src/tbf_fsm.h b/src/tbf_fsm.h
index d62e091..614c319 100644
--- a/src/tbf_fsm.h
+++ b/src/tbf_fsm.h
@@ -43,7 +43,7 @@
};
enum tbf_fsm_states {
- TBF_ST_NULL = 0, /* new created TBF */
+ TBF_ST_NEW = 0, /* new created TBF */
TBF_ST_ASSIGN, /* wait for downlink assignment */
TBF_ST_FLOW, /* RLC/MAC flow, resource needed */
TBF_ST_FINISHED, /* flow finished, wait for release */