diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2017-10-23 04:13:58 +0200 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-11-09 01:14:09 +0000 |
commit | 13fcdcf2ee54f2fca43e4f6f7bad62a9f49e30d6 (patch) | |
tree | be8461e0613d095ed2949a82cde44130d6a99e1d /src | |
parent | 49d493935525de8dc8f6829150cd2a752f32aa4b (diff) |
osmo-bsc RESET FSM: use distinct struct names
Use distinctive struct names: s/fsm_/fsm_bsc_reset/. They only exist
in the static context and it works fine, but the mad fsm-to-dot.py script
breaks with identical struct names. Can't hurt to have unique names.
Change-Id: I986377a74ccd83ca3b52e7f058bbc9115f05f741
Diffstat (limited to 'src')
-rw-r--r-- | src/osmo-bsc/osmo_bsc_reset.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/osmo-bsc/osmo_bsc_reset.c b/src/osmo-bsc/osmo_bsc_reset.c index aadbd866b..e482a4471 100644 --- a/src/osmo-bsc/osmo_bsc_reset.c +++ b/src/osmo-bsc/osmo_bsc_reset.c @@ -33,24 +33,24 @@ #define RESET_RESEND_TIMER_NO 1234 /* FIXME: dig out the real timer number */ #define BAD_CONNECTION_THRESOLD 3 /* connection failures */ -enum fsm_states { +enum fsm_bsc_reset_states { ST_DISC, /* Disconnected from MSC */ ST_CONN, /* We have a confirmed connection to the MSC */ }; -static const struct value_string fsm_state_names[] = { +static const struct value_string fsm_bsc_reset_state_names[] = { {ST_DISC, "ST_DISC (disconnected)"}, {ST_CONN, "ST_CONN (connected)"}, {0, NULL}, }; -enum fsm_evt { +enum fsm_bsc_reset_evt { EV_RESET_ACK, /* got reset acknowlegement from the MSC */ EV_N_DISCONNECT, /* lost a connection */ EV_N_CONNECT, /* made a successful connection */ }; -static const struct value_string fsm_evt_names[] = { +static const struct value_string fsm_bsc_reset_evt_names[] = { {EV_RESET_ACK, "EV_RESET_ACK"}, {EV_N_DISCONNECT, "EV_N_DISCONNECT"}, {EV_N_CONNECT, "EV_N_CONNECT"}, @@ -63,7 +63,7 @@ static void fsm_disc_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) struct bsc_msc_data *msc = (struct bsc_msc_data *)data; LOGP(DMSC, LOGL_NOTICE, "fsm-state (msc-reset): %s, fsm-event: %s, MSC No.: %i\n", - get_value_string(fsm_state_names, ST_DISC), get_value_string(fsm_evt_names, event), msc->nr); + get_value_string(fsm_bsc_reset_state_names, ST_DISC), get_value_string(fsm_bsc_reset_evt_names, event), msc->nr); msc->msc_con->msc_conn_loss_count = 0; osmo_fsm_inst_state_chg(fi, ST_CONN, 0, 0); } @@ -74,7 +74,7 @@ static void fsm_conn_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) struct bsc_msc_data *msc = (struct bsc_msc_data *)data; LOGP(DMSC, LOGL_NOTICE, "fsm-state (msc-reset): %s, fsm-event: %s, MSC No.: %i\n", - get_value_string(fsm_state_names, ST_CONN), get_value_string(fsm_evt_names, event), msc->nr); + get_value_string(fsm_bsc_reset_state_names, ST_CONN), get_value_string(fsm_bsc_reset_evt_names, event), msc->nr); OSMO_ASSERT(msc); @@ -98,7 +98,7 @@ static int fsm_reset_ack_timeout_cb(struct osmo_fsm_inst *fi) struct bsc_msc_data *msc = (struct bsc_msc_data *)fi->priv; LOGP(DMSC, LOGL_NOTICE, "reset-ack timeout (T%i) in state %s, MSC No.: %i, resending...\n", fi->T, - get_value_string(fsm_state_names, fi->state), msc->nr); + get_value_string(fsm_bsc_reset_state_names, fi->state), msc->nr); osmo_bsc_sigtran_reset(msc); osmo_bsc_sigtran_tx_reset(msc); @@ -107,7 +107,7 @@ static int fsm_reset_ack_timeout_cb(struct osmo_fsm_inst *fi) return 0; } -static struct osmo_fsm_state fsm_states[] = { +static struct osmo_fsm_state fsm_bsc_reset_states[] = { [ST_DISC] = { .in_event_mask = (1 << EV_RESET_ACK), .out_state_mask = (1 << ST_DISC) | (1 << ST_CONN), @@ -125,8 +125,8 @@ static struct osmo_fsm_state fsm_states[] = { /* State machine definition */ static struct osmo_fsm fsm = { .name = "A-CONNECTION", - .states = fsm_states, - .num_states = ARRAY_SIZE(fsm_states), + .states = fsm_bsc_reset_states, + .num_states = ARRAY_SIZE(fsm_bsc_reset_states), .log_subsys = DMSC, .timer_cb = fsm_reset_ack_timeout_cb, }; |