summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/src/mobile/gsm322.c
diff options
context:
space:
mode:
authorAndreas.Eversberg <jolly@eversberg.eu>2010-11-13 18:45:09 +0000
committerAndreas.Eversberg <jolly@eversberg.eu>2010-11-13 18:45:09 +0000
commit6f2b172780195e0af780ecd0a4fff0fac9b8438b (patch)
tree44423a4d31fa2767e26c988a258a960e7e51e5a1 /src/host/layer23/src/mobile/gsm322.c
parent4df881932c30c2d3deb88c53a55a21fd342068d8 (diff)
[layer23] Added support for multiple MS instances
To create another instance: 'ms <name> create' To remove an instance: 'no ms <name>' If no instance exists, 'ms 1' is created automatically on startup. Each instance can be enabled / disabled by using 'shutdown' or 'no shutdown'. Multiple instances may share the same layer2 socket (same phone hardware), but in this case only one instance can be enabled at the same time. This makes it much easier to select different settings without modifying them. A 'shutdown' initiates the IMSI detach procedure before shutdown is completed. A 'shutdown force' will immidiately shutdown. There is no need to restart the software anymore, if fundamental settings are changed. In this case, a 'shutdown' followed by a 'no shutdown' will do the job. If you already have an old osmocom.cfg, you need to "no shutdown" it. Everything else behaves as before.
Diffstat (limited to 'src/host/layer23/src/mobile/gsm322.c')
-rw-r--r--src/host/layer23/src/mobile/gsm322.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/host/layer23/src/mobile/gsm322.c b/src/host/layer23/src/mobile/gsm322.c
index 0b45f605..751b8b4b 100644
--- a/src/host/layer23/src/mobile/gsm322.c
+++ b/src/host/layer23/src/mobile/gsm322.c
@@ -33,12 +33,12 @@
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/common/l1ctl.h>
-#include <osmocom/bb/common/l23_app.h>
#include <osmocom/bb/common/osmocom_data.h>
#include <osmocom/bb/common/networks.h>
#include <osmocom/bb/mobile/vty.h>
extern void *l23_ctx;
+extern int (*l23_app_exit) (struct osmocom_ms *ms, int force);
static void gsm322_cs_timeout(void *arg);
static void gsm322_cs_loss(void *arg);
@@ -2376,7 +2376,7 @@ static int gsm322_cs_powerscan(struct osmocom_ms *ms)
return l1ctl_tx_pm_req_range(ms, s, e);
}
-static int gsm322_l1_signal(unsigned int subsys, unsigned int signal,
+int gsm322_l1_signal(unsigned int subsys, unsigned int signal,
void *handler_data, void *signal_data)
{
struct osmocom_ms *ms;
@@ -2489,8 +2489,8 @@ static int gsm322_l1_signal(unsigned int subsys, unsigned int signal,
case S_L1CTL_RESET:
ms = signal_data;
if (ms->mmlayer.power_off_idle) {
- l23_app_exit(ms);
- exit(0);
+ l23_app_exit(ms, 1);
+ return 0;
}
break;
}
@@ -3525,8 +3525,6 @@ int gsm322_init(struct osmocom_ms *ms)
} else
LOGP(DCS, LOGL_INFO, "No stored BA list\n");
- register_signal_handler(SS_L1CTL, &gsm322_l1_signal, NULL);
-
return 0;
}
@@ -3545,8 +3543,6 @@ int gsm322_exit(struct osmocom_ms *ms)
LOGP(DPLMN, LOGL_INFO, "exit PLMN process\n");
LOGP(DCS, LOGL_INFO, "exit Cell Selection process\n");
- unregister_signal_handler(SS_L1CTL, &gsm322_l1_signal, NULL);
-
/* stop cell selection process (if any) */
new_c_state(cs, GSM322_C0_NULL);