Change in osmo-sgsn[master]: mm_state_{gb, iu}_fsm: Improve naming for detach event

pespin gerrit-no-reply at lists.osmocom.org
Wed Apr 14 11:30:21 UTC 2021


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/23750 )


Change subject: mm_state_{gb,iu}_fsm: Improve naming for detach event
......................................................................

mm_state_{gb,iu}_fsm: Improve naming for detach event

The E_(P)MM_IMPLICIT_DETACH event was actually sent and handled when the
UE was considered to be detached, no matter the reason, be it due to
implicit detach, or Detach Request received, etc.
So, let's properly name the event to avoid confusions in the code.

Related: SYS#5389
Change-Id: I224ea9db80b4d96696934cea06349dab036f919b
---
M include/osmocom/sgsn/gprs_mm_state_gb_fsm.h
M include/osmocom/sgsn/gprs_mm_state_iu_fsm.h
M src/sgsn/gprs_gmm.c
M src/sgsn/gprs_gmm_fsm.c
M src/sgsn/gprs_mm_state_gb_fsm.c
M src/sgsn/gprs_mm_state_iu_fsm.c
6 files changed, 18 insertions(+), 20 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/50/23750/1

diff --git a/include/osmocom/sgsn/gprs_mm_state_gb_fsm.h b/include/osmocom/sgsn/gprs_mm_state_gb_fsm.h
index 02dcac7..4237c2f 100644
--- a/include/osmocom/sgsn/gprs_mm_state_gb_fsm.h
+++ b/include/osmocom/sgsn/gprs_mm_state_gb_fsm.h
@@ -14,9 +14,8 @@
 
 enum mm_state_gb_fsm_events {
 	E_MM_GPRS_ATTACH,
-	/* E_GPRS_DETACH, TODO: not used */
+	E_MM_GPRS_DETACH,  /* MS becomes detached: due to Detach Req, RAU reject, implicit detach, etc. */
 	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 */
diff --git a/include/osmocom/sgsn/gprs_mm_state_iu_fsm.h b/include/osmocom/sgsn/gprs_mm_state_iu_fsm.h
index 7e11ac9..6dae759 100644
--- a/include/osmocom/sgsn/gprs_mm_state_iu_fsm.h
+++ b/include/osmocom/sgsn/gprs_mm_state_iu_fsm.h
@@ -13,10 +13,9 @@
 
 enum mm_state_iu_fsm_events {
 	E_PMM_PS_ATTACH,
-	/* E_PS_DETACH, TODO: not used */
+	E_PMM_PS_DETACH, /* UE becomes detached: due to Detach Req, RAU reject, implicit detach, etc. */
 	E_PMM_PS_CONN_RELEASE,
 	E_PMM_PS_CONN_ESTABLISH,
-	E_PMM_IMPLICIT_DETACH, /* = E_PS_ATTACH_REJECT, E_RAU_REJECT */
 	E_PMM_RA_UPDATE, /* = Serving RNC relocation */
 };
 
diff --git a/src/sgsn/gprs_gmm.c b/src/sgsn/gprs_gmm.c
index f05167f..edddd2d 100644
--- a/src/sgsn/gprs_gmm.c
+++ b/src/sgsn/gprs_gmm.c
@@ -197,10 +197,10 @@
 
 	switch(ctx->ran_type) {
 	case MM_CTX_T_UTRAN_Iu:
-		osmo_fsm_inst_dispatch(ctx->iu.mm_state_fsm, E_PMM_IMPLICIT_DETACH, NULL);
+		osmo_fsm_inst_dispatch(ctx->iu.mm_state_fsm, E_PMM_PS_DETACH, NULL);
 		break;
 	case MM_CTX_T_GERAN_Gb:
-		osmo_fsm_inst_dispatch(ctx->gb.mm_state_fsm, E_MM_IMPLICIT_DETACH, NULL);
+		osmo_fsm_inst_dispatch(ctx->gb.mm_state_fsm, E_MM_GPRS_DETACH, NULL);
 		break;
 	}
 
diff --git a/src/sgsn/gprs_gmm_fsm.c b/src/sgsn/gprs_gmm_fsm.c
index caec586..78946b5 100644
--- a/src/sgsn/gprs_gmm_fsm.c
+++ b/src/sgsn/gprs_gmm_fsm.c
@@ -199,9 +199,9 @@
 			gmm_fsm_state_chg(fi, ST_GMM_DEREGISTERED);
 		default:
 			if (mmctx->ran_type == MM_CTX_T_GERAN_Gb)
-				osmo_fsm_inst_dispatch(mmctx->gb.mm_state_fsm, E_MM_IMPLICIT_DETACH, NULL);
+				osmo_fsm_inst_dispatch(mmctx->gb.mm_state_fsm, E_MM_GPRS_DETACH, NULL);
 			else if (mmctx->ran_type == MM_CTX_T_UTRAN_Iu) {
-				osmo_fsm_inst_dispatch(mmctx->iu.mm_state_fsm, E_PMM_IMPLICIT_DETACH, NULL);
+				osmo_fsm_inst_dispatch(mmctx->iu.mm_state_fsm, E_PMM_PS_DETACH, NULL);
 				mmctx->gb.llme = rat_chg->llme;
 			}
 
diff --git a/src/sgsn/gprs_mm_state_gb_fsm.c b/src/sgsn/gprs_mm_state_gb_fsm.c
index f8653f6..6e812d3 100644
--- a/src/sgsn/gprs_mm_state_gb_fsm.c
+++ b/src/sgsn/gprs_mm_state_gb_fsm.c
@@ -71,7 +71,7 @@
 	case E_MM_READY_TIMER_EXPIRY:
 		mm_state_gb_fsm_state_chg(fi, ST_MM_STANDBY);
 		break;
-	case E_MM_IMPLICIT_DETACH:
+	case E_MM_GPRS_DETACH:
 		mm_state_gb_fsm_state_chg(fi, ST_MM_IDLE);
 		break;
 	case E_MM_PDU_RECEPTION:
@@ -90,7 +90,7 @@
 	case E_MM_PDU_RECEPTION:
 		mm_state_gb_fsm_state_chg(fi, ST_MM_READY);
 		break;
-	case E_MM_IMPLICIT_DETACH:
+	case E_MM_GPRS_DETACH:
 		mm_state_gb_fsm_state_chg(fi, ST_MM_IDLE);
 		break;
 	}
@@ -105,13 +105,13 @@
 		.action = st_mm_idle,
 	},
 	[ST_MM_READY] = {
-		.in_event_mask = X(E_MM_READY_TIMER_EXPIRY) | X(E_MM_RA_UPDATE) | X(E_MM_IMPLICIT_DETACH) | X(E_MM_PDU_RECEPTION),
+		.in_event_mask = X(E_MM_READY_TIMER_EXPIRY) | X(E_MM_RA_UPDATE) | X(E_MM_GPRS_DETACH) | X(E_MM_PDU_RECEPTION),
 		.out_state_mask = X(ST_MM_IDLE) | X(ST_MM_STANDBY),
 		.name = "Ready",
 		.action = st_mm_ready,
 	},
 	[ST_MM_STANDBY] = {
-		.in_event_mask = X(E_MM_PDU_RECEPTION) | X(E_MM_IMPLICIT_DETACH),
+		.in_event_mask = X(E_MM_PDU_RECEPTION) | X(E_MM_GPRS_DETACH),
 		.out_state_mask = X(ST_MM_IDLE) | X(ST_MM_READY),
 		.name = "Standby",
 		.action = st_mm_standby,
@@ -121,7 +121,7 @@
 const struct value_string mm_state_gb_fsm_event_names[] = {
 	OSMO_VALUE_STRING(E_MM_GPRS_ATTACH),
 	OSMO_VALUE_STRING(E_MM_PDU_RECEPTION),
-	OSMO_VALUE_STRING(E_MM_IMPLICIT_DETACH),
+	OSMO_VALUE_STRING(E_MM_GPRS_DETACH),
 	OSMO_VALUE_STRING(E_MM_READY_TIMER_EXPIRY),
 	OSMO_VALUE_STRING(E_MM_RA_UPDATE),
 	{ 0, NULL }
diff --git a/src/sgsn/gprs_mm_state_iu_fsm.c b/src/sgsn/gprs_mm_state_iu_fsm.c
index 3f1336b..b1604f8 100644
--- a/src/sgsn/gprs_mm_state_iu_fsm.c
+++ b/src/sgsn/gprs_mm_state_iu_fsm.c
@@ -61,7 +61,7 @@
 	case E_PMM_PS_ATTACH:
 		mm_state_iu_fsm_state_chg(fi, ST_PMM_CONNECTED);
 		break;
-	case E_PMM_IMPLICIT_DETACH:
+	case E_PMM_PS_DETACH:
 		break;
 	}
 }
@@ -75,7 +75,7 @@
 		sgsn_ranap_iu_free(ctx);
 		mm_state_iu_fsm_state_chg(fi, ST_PMM_IDLE);
 		break;
-	case E_PMM_IMPLICIT_DETACH:
+	case E_PMM_PS_DETACH:
 		sgsn_ranap_iu_release_free(ctx, NULL);
 		mm_state_iu_fsm_state_chg(fi, ST_PMM_DETACHED);
 		break;
@@ -98,7 +98,7 @@
 	case E_PMM_PS_CONN_ESTABLISH:
 		mm_state_iu_fsm_state_chg(fi, ST_PMM_CONNECTED);
 		break;
-	case E_PMM_IMPLICIT_DETACH:
+	case E_PMM_PS_DETACH:
 		mm_state_iu_fsm_state_chg(fi, ST_PMM_DETACHED);
 		break;
 	}
@@ -106,7 +106,7 @@
 
 static struct osmo_fsm_state mm_state_iu_fsm_states[] = {
 	[ST_PMM_DETACHED] = {
-		.in_event_mask = X(E_PMM_PS_ATTACH) | X(E_PMM_IMPLICIT_DETACH),
+		.in_event_mask = X(E_PMM_PS_ATTACH) | X(E_PMM_PS_DETACH),
 		.out_state_mask = X(ST_PMM_CONNECTED),
 		.name = "Detached",
 		.action = st_pmm_detached,
@@ -115,14 +115,14 @@
 		.in_event_mask =
 			X(E_PMM_PS_CONN_RELEASE) |
 			X(E_PMM_RA_UPDATE) |
-			X(E_PMM_IMPLICIT_DETACH),
+			X(E_PMM_PS_DETACH),
 		.out_state_mask = X(ST_PMM_DETACHED) | X(ST_PMM_IDLE),
 		.name = "Connected",
 		.action = st_pmm_connected,
 	},
 	[ST_PMM_IDLE] = {
 		.in_event_mask =
-			X(E_PMM_IMPLICIT_DETACH) |
+			X(E_PMM_PS_DETACH) |
 			X(E_PMM_PS_CONN_ESTABLISH) |
 			X(E_PMM_PS_ATTACH),
 		.out_state_mask = X(ST_PMM_DETACHED) | X(ST_PMM_CONNECTED),
@@ -136,7 +136,7 @@
 	OSMO_VALUE_STRING(E_PMM_PS_ATTACH),
 	OSMO_VALUE_STRING(E_PMM_PS_CONN_RELEASE),
 	OSMO_VALUE_STRING(E_PMM_PS_CONN_ESTABLISH),
-	OSMO_VALUE_STRING(E_PMM_IMPLICIT_DETACH),
+	OSMO_VALUE_STRING(E_PMM_PS_DETACH),
 	OSMO_VALUE_STRING(E_PMM_RA_UPDATE),
 	{ 0, NULL }
 };

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/23750
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I224ea9db80b4d96696934cea06349dab036f919b
Gerrit-Change-Number: 23750
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210414/551f1c5c/attachment.htm>


More information about the gerrit-log mailing list