diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2017-11-15 12:25:47 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2017-11-27 17:54:03 +0800 |
commit | eddf339871559f282fe615f9c618a1220bd97743 (patch) | |
tree | b8fd59a2eb1b45cde02c6cb34ae26f7d89e07e56 /src/host/layer23/src/mobile/gsm48_mm.c | |
parent | 65774d447d8623257e1cbf3694542f4a421017d7 (diff) |
mobile: Instead of putting semantic in a comment, use an enum
The enum was created to understand the different states during
the shutdown and find places where it is used. The normal
transitions are like.
Idle -> Imsi Detach -> L1 Reset -> Done
Idle -> L1 Reset -> Done
The shutdown can get stuck in case:
* Out of memory situation while handling IMSI detach (timeout)
* Never receiving l1 reset acknnowledgment.
The code could benefit from the move to osmo fsm to deal with
proper timeouts.
Change-Id: Iee1140e4848923c7270495c381bf87b7e3fddee1
Diffstat (limited to 'src/host/layer23/src/mobile/gsm48_mm.c')
-rw-r--r-- | src/host/layer23/src/mobile/gsm48_mm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/host/layer23/src/mobile/gsm48_mm.c b/src/host/layer23/src/mobile/gsm48_mm.c index 4b1db1e5..f32d57ab 100644 --- a/src/host/layer23/src/mobile/gsm48_mm.c +++ b/src/host/layer23/src/mobile/gsm48_mm.c @@ -1849,7 +1849,7 @@ static int gsm48_mm_imsi_detach_end(struct osmocom_ms *ms, struct msgb *msg) subscr->sim_valid = 0; /* wait for RR idle and then power off when IMSI is detached */ - if (ms->shutdown) { + if (ms->shutdown != MS_SHUTDOWN_NONE) { if (mm->state == GSM48_MM_ST_MM_IDLE) { mobile_exit(ms, 1); return 0; @@ -1944,7 +1944,7 @@ static int gsm48_mm_imsi_detach_release(struct osmocom_ms *ms, struct msgb *msg) new_mm_state(mm, GSM48_MM_ST_WAIT_NETWORK_CMD, 0); /* power off */ - if (ms->shutdown) { + if (ms->shutdown != MS_SHUTDOWN_NONE) { mobile_exit(ms, 1); return 0; } |