implicitly register osmo_fsm definitions

I'm going to add a regression test that probes lchan_fsm. I noticed that
I have to call lchan_fsm_init() for osmo_fsm_register(). Let's make this
implicit as we usually do now, to not have to register FSMs in tests.

Change-Id: I58760e743c78a370aedc9720f265c0f8da5c2045
This commit is contained in:
Neels Hofmeyr 2023-03-02 01:46:41 +01:00
parent e073463ec4
commit b599836c7a
11 changed files with 5 additions and 25 deletions

View File

@ -40,8 +40,6 @@ enum assignment_fsm_event {
ASSIGNMENT_EV_CONN_RELEASING,
};
void assignment_fsm_init(void);
int reassignment_request_to_lchan(enum assign_for assign_for, struct gsm_lchan *lchan, struct gsm_lchan *to_lchan,
int tsc_set, int tsc);
int reassignment_request_to_chan_type(enum assign_for assign_for, struct gsm_lchan *lchan,

View File

@ -57,8 +57,6 @@ struct osmo_mgcpc_ep_ci;
struct assignment_request;
struct gsm_lchan;
void bsc_subscr_conn_fsm_init(void);
/* Allocate a subscriber connection and its associated FSM */
struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_network *net);
void gscon_update_id(struct gsm_subscriber_connection *conn);

View File

@ -55,8 +55,6 @@ struct handover_rr_detect_data {
const uint8_t *access_delay;
};
void handover_fsm_init(void);
int handover_request(struct handover_out_req *req);
void handover_start(struct handover_out_req *req);
void handover_start_inter_bsc_in(struct gsm_subscriber_connection *conn,

View File

@ -56,8 +56,6 @@ enum lchan_fsm_event {
LCHAN_EV_REQUEST_MODE_MODIFY,
};
void lchan_fsm_init(void);
void lchan_fsm_alloc(struct gsm_lchan *lchan);
void lchan_release(struct gsm_lchan *lchan, bool do_rr_release,
bool err, enum gsm48_rr_cause cause_rr,

View File

@ -364,7 +364,7 @@ static bool lchan_type_compat_with_mode(enum gsm_chan_t type, const struct chann
}
}
void assignment_fsm_init(void)
static __attribute__((constructor)) void assignment_fsm_init(void)
{
OSMO_ASSERT(osmo_fsm_register(&assignment_fsm) == 0);
}

View File

@ -1208,7 +1208,7 @@ static struct osmo_fsm gscon_fsm = {
.event_names = gscon_fsm_event_names,
};
void bsc_subscr_conn_fsm_init(void)
static __attribute__((constructor)) void bsc_subscr_conn_fsm_init(void)
{
OSMO_ASSERT(osmo_fsm_register(&gscon_fsm) == 0);
OSMO_ASSERT(osmo_fsm_register(&lcls_fsm) == 0);

View File

@ -293,7 +293,7 @@ static void handover_reset(struct gsm_subscriber_connection *conn)
};
}
void handover_fsm_init(void)
static __attribute__((constructor)) void handover_fsm_init(void)
{
OSMO_ASSERT(osmo_fsm_register(&ho_fsm) == 0);
}

View File

@ -461,12 +461,9 @@ void lchan_fsm_update_id(struct gsm_lchan *lchan)
osmo_fsm_inst_update_id_f(lchan->fi_rtp, lchan->fi->id);
}
extern void lchan_rtp_fsm_init();
void lchan_fsm_init(void)
static __attribute__((constructor)) void lchan_fsm_init(void)
{
OSMO_ASSERT(osmo_fsm_register(&lchan_fsm) == 0);
lchan_rtp_fsm_init();
}
static void lchan_reset(struct gsm_lchan *lchan);

View File

@ -70,7 +70,7 @@ struct osmo_tdef_state_timeout lchan_rtp_fsm_timeouts[32] = {
} while (0)
/* Called from lchan_fsm_init(), does not need to be visible in lchan_rtp_fsm.h */
void lchan_rtp_fsm_init(void)
static __attribute__((constructor)) void lchan_rtp_fsm_init(void)
{
OSMO_ASSERT(osmo_fsm_register(&lchan_rtp_fsm) == 0);
}

View File

@ -924,10 +924,6 @@ int main(int argc, char **argv)
/* seed the PRNG */
srand(time(NULL));
lchan_fsm_init();
bsc_subscr_conn_fsm_init();
assignment_fsm_init();
handover_fsm_init();
lb_init();
acc_ramp_global_init();
paging_global_init();

View File

@ -1687,11 +1687,6 @@ int main(int argc, char **argv)
bsc_vty_init(bsc_gsmnet);
ho_test_vty_init();
lchan_fsm_init();
bsc_subscr_conn_fsm_init();
handover_fsm_init();
assignment_fsm_init();
ho_set_algorithm(bsc_gsmnet->ho, 2);
ho_set_ho_active(bsc_gsmnet->ho, true);
ho_set_hodec2_as_active(bsc_gsmnet->ho, true);