nacc_fsm: Move logic checking if SI is being waited for to a func helper

We already have a similar function for Neighbor Address Resolution.
This way we keep as much as possible internal state related logic into
the nacc_fsm.c file.

Change-Id: I7378939825cc3ec3280f76bc51233c0a172d8a27
changes/05/25405/4
Pau Espin 1 year ago
parent 5557c0af80
commit 6c81adda45
  1. 9
      src/gprs_bssgp_rim.c
  2. 8
      src/nacc_fsm.c
  3. 3
      src/nacc_fsm.h

@ -158,13 +158,8 @@ static int handle_ran_info_response_nacc(const struct bssgp_ran_inf_app_cont_nac
llist_for_each(tmp, bts_ms_list(bts)) {
struct GprsMs *ms = llist_entry(tmp, typeof(*ms), list);
if (!ms->nacc)
continue;
if (ms->nacc->fi->state != NACC_ST_WAIT_REQUEST_SI)
continue;
if (osmo_cgi_ps_cmp(&nacc->reprt_cell, &ms->nacc->cgi_ps) != 0)
continue;
osmo_fsm_inst_dispatch(ms->nacc->fi, NACC_EV_RX_SI, entry);
if (ms->nacc && nacc_fsm_is_waiting_si_resolution(ms->nacc, &nacc->reprt_cell))
osmo_fsm_inst_dispatch(ms->nacc->fi, NACC_EV_RX_SI, entry);
}
return 0;
}

@ -887,3 +887,11 @@ bool nacc_fsm_is_waiting_addr_resolution(const struct nacc_fsm_ctx *ctx,
return false;
return neigh_cache_entry_key_eq(&ctx->neigh_key, neigh_key);
}
bool nacc_fsm_is_waiting_si_resolution(const struct nacc_fsm_ctx *ctx,
const struct osmo_cell_global_id_ps *cgi_ps)
{
if (ctx->fi->state != NACC_ST_WAIT_REQUEST_SI)
return false;
return !osmo_cgi_ps_cmp(&ctx->cgi_ps, cgi_ps);
}

@ -72,3 +72,6 @@ struct nacc_fsm_ctx *nacc_fsm_alloc(struct GprsMs* ms);
bool nacc_fsm_is_waiting_addr_resolution(const struct nacc_fsm_ctx *ctx,
const struct neigh_cache_entry_key *neigh_key);
bool nacc_fsm_is_waiting_si_resolution(const struct nacc_fsm_ctx *ctx,
const struct osmo_cell_global_id_ps *cgi_ps);

Loading…
Cancel
Save