diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2011-11-17 09:17:10 +0100 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2011-11-17 21:01:26 +0100 |
commit | 07309078409181f491ea7625f871cab2700d93c8 (patch) | |
tree | 42eb0da296afd183701d7d8f013834ef75851b7b /src/host | |
parent | 24a7d31d71e9b1f3ef1cb53a78779f1986c8fcbe (diff) |
mobile/MM: Fixed handling of T3220 (IMSI detach timeout)
If network will not terminate radio connection, the timeout will abort
the radio connection.
Diffstat (limited to 'src/host')
-rw-r--r-- | src/host/layer23/src/mobile/gsm48_mm.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/host/layer23/src/mobile/gsm48_mm.c b/src/host/layer23/src/mobile/gsm48_mm.c index 0208d466..ba06eafc 100644 --- a/src/host/layer23/src/mobile/gsm48_mm.c +++ b/src/host/layer23/src/mobile/gsm48_mm.c @@ -1841,7 +1841,6 @@ static int gsm48_mm_imsi_detach_end(struct osmocom_ms *ms, struct msgb *msg) /* stop IMSI detach timer (if running) */ stop_mm_t3220(mm); - /* SIM invalid */ subscr->sim_valid = 0; @@ -1868,6 +1867,24 @@ static int gsm48_mm_imsi_detach_end(struct osmocom_ms *ms, struct msgb *msg) return gsm48_mm_return_idle(ms, NULL); } +/* abort radio connection */ +static int gsm48_mm_imsi_detach_abort(struct osmocom_ms *ms, struct msgb *msg) +{ + struct msgb *nmsg; + struct gsm48_rr_hdr *nrrh; + + /* abort RR if timer fired */ + nmsg = gsm48_rr_msgb_alloc(GSM48_RR_ABORT_REQ); + if (!nmsg) + return -ENOMEM; + nrrh = (struct gsm48_rr_hdr *) nmsg->data; + nrrh->cause = GSM48_RR_CAUSE_NORMAL; + gsm48_rr_downmsg(ms, nmsg); + + /* imsi detach has ended now */ + return gsm48_mm_imsi_detach_end(ms, msg); +} + /* start an IMSI detach in MM IDLE */ static int gsm48_mm_imsi_detach_start(struct osmocom_ms *ms, struct msgb *msg) { @@ -4233,8 +4250,8 @@ static struct eventstate { {ALL_STATES, ALL_STATES, GSM48_MM_EVENT_IMSI_DETACH, gsm48_mm_imsi_detach_delay}, - {GSM48_MM_ST_IMSI_DETACH_INIT, ALL_STATES, - GSM48_MM_EVENT_TIMEOUT_T3220, gsm48_mm_imsi_detach_end}, + {SBIT(GSM48_MM_ST_IMSI_DETACH_INIT), ALL_STATES, + GSM48_MM_EVENT_TIMEOUT_T3220, gsm48_mm_imsi_detach_abort}, /* location update in other cases */ {SBIT(GSM48_MM_ST_MM_IDLE), ALL_STATES, |