[layer23] WAIT for IDLE and layer 1 reset before power off after IMSI detach

This commit is contained in:
Andreas.Eversberg 2010-07-14 10:21:35 +00:00
parent abdb8ca464
commit 0a18f742d4
3 changed files with 14 additions and 5 deletions

View File

@ -191,6 +191,7 @@ struct gsm48_mmlayer {
/* other */
int mr_substate; /* rem most recent substate */
uint8_t power_off; /* set, if power off after detach */
uint8_t power_off_idle; /* waits for IDLE before po */
};
/* MM connection entry */

View File

@ -33,6 +33,7 @@
#include <osmocom/logging.h>
#include <osmocom/l1ctl.h>
#include <osmocom/l23_app.h>
#include <osmocom/osmocom_data.h>
#include <osmocom/networks.h>
#include <osmocom/vty.h>
@ -2430,6 +2431,11 @@ static int gsm322_l1_signal(unsigned int subsys, unsigned int signal,
gsm322_cs_timeout(cs);
break;
case S_L1CTL_RESET:
ms = signal_data;
if (ms->mmlayer.power_off_idle) {
l23_app_exit(ms);
exit(0);
}
break;
}

View File

@ -36,6 +36,7 @@
#include <osmocom/gsm48_cc.h>
#include <osmocom/l23_app.h>
#include <osmocom/networks.h>
#include <osmocom/l1ctl.h>
extern void *l23_ctx;
@ -1753,10 +1754,11 @@ static int gsm48_mm_imsi_detach_end(struct osmocom_ms *ms, struct msgb *msg)
/* SIM invalid */
subscr->sim_valid = 0;
/* power off when IMSI is detached */
/* wait for RR idle and then power off when IMSI is detached */
if (mm->power_off) {
l23_app_exit(ms);
exit (0);
mm->power_off_idle = 1;
return 0;
}
/* send SIM remove event to gsm322 */
@ -1823,10 +1825,10 @@ static int gsm48_mm_imsi_detach_release(struct osmocom_ms *ms, struct msgb *msg)
LOGP(DMM, LOGL_INFO, "IMSI detach not required.\n");
new_mm_state(mm, GSM48_MM_ST_WAIT_NETWORK_CMD, 0);
/* power off when IMSI is detached */
/* power off */
if (mm->power_off) {
l23_app_exit(ms);
exit (0);
exit(0);
}
return 0;