summaryrefslogtreecommitdiffstats
path: root/src/host
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2011-06-26 10:40:56 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2011-07-17 09:50:36 +0200
commit599d922134fd48a2a576ad7640759d8f6c1fcd9b (patch)
tree29164b9c0163de080c2bbbd18f88c9a1f86f57e9 /src/host
parent74e7535ea2718d810a876bbc572c7fc2f99225a1 (diff)
[layer23] Detach SIM, if reading fails
This way the mobility management and cell selection process continues as if no SIM has been inserted.
Diffstat (limited to 'src/host')
-rw-r--r--src/host/layer23/src/mobile/subscriber.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/host/layer23/src/mobile/subscriber.c b/src/host/layer23/src/mobile/subscriber.c
index 9a2085a3..544d53fb 100644
--- a/src/host/layer23/src/mobile/subscriber.c
+++ b/src/host/layer23/src/mobile/subscriber.c
@@ -567,6 +567,7 @@ static void subscr_sim_query_cb(struct osmocom_ms *ms, struct msgb *msg)
uint16_t payload_len = msg->len - sizeof(*sh);
int rc;
struct subscr_sim_file *sf = &subscr_sim_files[subscr->sim_file_index];
+ struct msgb *nmsg;
/* error handling */
if (sh->job_type == SIM_JOB_ERROR) {
@@ -612,6 +613,13 @@ static void subscr_sim_query_cb(struct osmocom_ms *ms, struct msgb *msg)
vty_notify(ms, NULL);
vty_notify(ms, "SIM failed, replace SIM!\n");
+
+ /* detach simcard */
+ subscr->sim_valid = 0;
+ nmsg = gsm48_mmr_msgb_alloc(GSM48_MMR_NREG_REQ);
+ if (!nmsg)
+ return;
+ gsm48_mmr_downmsg(ms, nmsg);
}
msgb_free(msg);