diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-08-30 16:14:22 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-09-02 11:44:58 +0200 |
commit | 02514bc592923b9c082942d64fcf06db2e4bfd44 (patch) | |
tree | 61a5ca23eec7da520d6876873939b5720c4ace4b /include/osmocom | |
parent | 9119d50849b8c4efa7a2074ff004c3a671e8c13f (diff) |
Introduce FSM mm_state_gb_fsm
Implement TS 23.060 6.1.1 Mobility Management States (A/Gb mode) using
osmocom FSM and drop old implementation.
Most of the logic on each state is still kept in gprs_gmm.c, will be
inserted into the FSM later.
Change-Id: I04004423e993107374d5a3549b8a93ac169251dd
Diffstat (limited to 'include/osmocom')
-rw-r--r-- | include/osmocom/sgsn/Makefile.am | 1 | ||||
-rw-r--r-- | include/osmocom/sgsn/gprs_gmm.h | 2 | ||||
-rw-r--r-- | include/osmocom/sgsn/gprs_mm_state_gb_fsm.h | 26 | ||||
-rw-r--r-- | include/osmocom/sgsn/gprs_sgsn.h | 11 |
4 files changed, 28 insertions, 12 deletions
diff --git a/include/osmocom/sgsn/Makefile.am b/include/osmocom/sgsn/Makefile.am index b91c9f19e..d6ee4451e 100644 --- a/include/osmocom/sgsn/Makefile.am +++ b/include/osmocom/sgsn/Makefile.am @@ -7,6 +7,7 @@ noinst_HEADERS = \ gprs_gb_parse.h \ gprs_gmm.h \ gprs_gmm_attach.h \ + gprs_mm_state_gb_fsm.h \ gprs_llc.h \ gprs_llc_xid.h \ gprs_ranap.h \ diff --git a/include/osmocom/sgsn/gprs_gmm.h b/include/osmocom/sgsn/gprs_gmm.h index 6c72cda3f..2fa12e597 100644 --- a/include/osmocom/sgsn/gprs_gmm.h +++ b/include/osmocom/sgsn/gprs_gmm.h @@ -50,8 +50,6 @@ void extract_subscr_hlr(struct sgsn_mm_ctx *ctx); void pdp_ctx_detach_mm_ctx(struct sgsn_pdp_ctx *pdp); void mmctx_set_pmm_state(struct sgsn_mm_ctx *ctx, enum gprs_mm_state_iu state); -void mmctx_state_timer_start(struct sgsn_mm_ctx *mm, unsigned int T); -void mmctx_set_mm_state(struct sgsn_mm_ctx *ctx, enum gprs_mm_state_gb state); void msgid2mmctx(struct sgsn_mm_ctx *mm, const struct msgb *msg); #endif /* _GPRS_GMM_H */ diff --git a/include/osmocom/sgsn/gprs_mm_state_gb_fsm.h b/include/osmocom/sgsn/gprs_mm_state_gb_fsm.h new file mode 100644 index 000000000..e69e1e11c --- /dev/null +++ b/include/osmocom/sgsn/gprs_mm_state_gb_fsm.h @@ -0,0 +1,26 @@ +#pragma once + +#include <osmocom/core/fsm.h> + +struct sgsn_mm_ctx; + + +/* TS 23.060 6.1.1 Mobility Management States (A/Gb mode) */ +enum mm_state_gb_fsm_states { + ST_MM_IDLE, + ST_MM_READY, + ST_MM_STANDBY +}; + +enum mm_state_gb_fsm_events { + E_MM_GPRS_ATTACH, + /* E_GPRS_DETACH, TODO: not used */ + E_MM_PDU_RECEPTION, + E_MM_IMPLICIT_DETACH, /* = E_MM_CANCEL_LOCATION */ + E_MM_READY_TIMER_EXPIRY, + /* E_FORCE_TO_STANDBY, TODO: not used */ + /* E_ABNSORMAL_RLC_CONDITION, TODO: not used */ + E_MM_RA_UPDATE, +}; + +extern struct osmo_fsm mm_state_gb_fsm; diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h index f64e07b18..382019c2d 100644 --- a/include/osmocom/sgsn/gprs_sgsn.h +++ b/include/osmocom/sgsn/gprs_sgsn.h @@ -32,12 +32,6 @@ enum gprs_gmm_state { GMM_DEREGISTERED_INIT, /* 4.1.3.3.1.4 */ }; -/* TS 23.060 6.1.1 Mobility Management States (A/Gb mode) */ -enum gprs_mm_state_gb { - MM_IDLE, - MM_READY, - MM_STANDBY -}; /* TS 23.060 6.1.2 Mobility Management States (Iu mode) */ enum gprs_mm_state_iu { PMM_DETACHED, @@ -161,10 +155,7 @@ struct sgsn_mm_ctx { uint32_t tlli_new; /* TS 23.060 6.1.1 Mobility Management States (A/Gb mode) */ - enum gprs_mm_state_gb mm_state; - /* timer for mm state. state=READY: T3314 (aka TS 23.060 "READY timer") */ - struct osmo_timer_list state_timer; - unsigned int state_T; /* Txxxx number but only used for mm_state */ + struct osmo_fsm_inst *mm_state_fsm; } gb; struct { int new_key; |