Actions
Feature #4336
openConvert vlr_lu_fsm.c to use osmo_tdef (and drop vlr_timer())
Status:
New
Priority:
Normal
Assignee:
-
Category:
VLR
Target version:
-
Start date:
12/17/2019
Due date:
% Done:
0%
Resolution:
Spec Reference:
Description
vlr.h:
enum vlr_timer { VLR_T_3250, VLR_T_3260, VLR_T_3270, _NUM_VLR_TIMERS }; struct vlr_instance { ... uint32_t timer[_NUM_VLR_TIMERS]; } struct vlr_instance *vlr_alloc(void *ctx, const struct vlr_ops *ops); uint32_t vlr_timer(struct vlr_instance *vlr, uint32_t timer);
vlr.c:
uint32_t vlr_timer(struct vlr_instance *vlr, uint32_t timer) { uint32_t tidx = 0xffffffff; switch (timer) { case 3270: tidx = VLR_T_3270; break; case 3260: tidx = VLR_T_3260; break; case 3250: tidx = VLR_T_3250; break; } OSMO_ASSERT(tidx < sizeof(vlr->cfg.timer)); return vlr->cfg.timer[tidx]; }
vlr_lu_fsm.c:
osmo_fsm_inst_state_chg(fi, LU_COMPL_VLR_S_WAIT_TMSI_CNF, vlr_timer(vlr, 3250), 3250);
I could not see those values in timer ever being set to something different than 0 during vlr_alloc()....
The idea is to drop those and use interation with osmo_tdef instead. Something similar to what is done in ran_infra.c and msc_a.c:
#define RAN_TDEFS \ { .T = -1, .default_val = 5, .desc = "RAN connection Complete Layer 3, Authentication and Ciphering timeout" }, \ { .T = -2, .default_val = 30, .desc = "RAN connection release sanity timeout" }, \ { .T = -3, .default_val = 10, .desc = "Timeout to find a target BSS after Handover Required" }, \ struct osmo_tdef msc_tdefs_geran[] = { RAN_TDEFS {} }; static const struct osmo_tdef_state_timeout msc_a_fsm_timeouts[32] = { [MSC_A_ST_VALIDATE_L3] = { .T = -1 }, [MSC_A_ST_AUTH_CIPH] = { .keep_timer = true }, [MSC_A_ST_WAIT_CLASSMARK_UPDATE] = { .keep_timer = true }, [MSC_A_ST_AUTHENTICATED] = { .keep_timer = true }, [MSC_A_ST_RELEASING] = { .T = -2 }, [MSC_A_ST_RELEASED] = { .T = -2 }, }; /* Transition to a state, using the T timer defined in msc_a_fsm_timeouts. * The actual timeout value is in turn obtained from network->T_defs. * Assumes local variable fi exists. */ #define msc_a_state_chg_always(msc_a, state) \ osmo_tdef_fsm_inst_state_chg((msc_a)->c.fi, state, msc_a_fsm_timeouts, (msc_a)->c.ran->tdefs, 5)
BTW, similar stuff is currently done by SGs code, grep for "sgs->cfg.timer" and it can be spotted easily.
Related issues
Actions