summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-05-20 18:16:09 +0200
committerHarald Welte <laforge@gnumonks.org>2011-06-21 19:48:20 +0200
commitddb20b8b4e39e7342350ed5b34a2b64029fce7b0 (patch)
tree5bbad98bba3661f6c5d153946d66e72e41418696
parenta2f615e522907f45398973d31225f9c5d379914d (diff)
remove osmocom_ms reference from lapdm_init()
... yet another step in making lapdm code independent of osmocom_ms
-rw-r--r--src/host/layer23/include/osmocom/bb/common/lapdm.h2
-rw-r--r--src/host/layer23/src/common/lapdm.c7
-rw-r--r--src/host/layer23/src/common/main.c9
-rw-r--r--src/host/layer23/src/mobile/app_mobile.c8
4 files changed, 16 insertions, 10 deletions
diff --git a/src/host/layer23/include/osmocom/bb/common/lapdm.h b/src/host/layer23/include/osmocom/bb/common/lapdm.h
index b610564c..1214f0fc 100644
--- a/src/host/layer23/include/osmocom/bb/common/lapdm.h
+++ b/src/host/layer23/include/osmocom/bb/common/lapdm.h
@@ -75,7 +75,7 @@ const char *get_rsl_name(int value);
extern const char *lapdm_state_names[];
/* initialize a LAPDm entity */
-void lapdm_init(struct lapdm_entity *le, struct osmocom_ms *ms);
+void lapdm_init(struct lapdm_entity *le);
/* deinitialize a LAPDm entity */
void lapdm_exit(struct lapdm_entity *le);
diff --git a/src/host/layer23/src/common/lapdm.c b/src/host/layer23/src/common/lapdm.c
index a2a9d5ff..d062ee35 100644
--- a/src/host/layer23/src/common/lapdm.c
+++ b/src/host/layer23/src/common/lapdm.c
@@ -1,6 +1,6 @@
/* GSM LAPDm (TS 04.06) implementation */
-/* (C) 2010 by Harald Welte <laforge@gnumonks.org>
+/* (C) 2010-2011 by Harald Welte <laforge@gnumonks.org>
* (C) 2010 by Andreas Eversberg <jolly@eversberg.eu>
*
* All Rights Reserved
@@ -186,15 +186,12 @@ static void lapdm_dl_init(struct lapdm_datalink *dl,
dl->entity = entity;
}
-void lapdm_init(struct lapdm_entity *le, struct osmocom_ms *ms)
+void lapdm_init(struct lapdm_entity *le)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(le->datalink); i++)
lapdm_dl_init(&le->datalink[i], le);
-
- le->l1_ctx = ms;
- le->l3_ctx = ms;
}
static void lapdm_dl_flush_send(struct lapdm_datalink *dl)
diff --git a/src/host/layer23/src/common/main.c b/src/host/layer23/src/common/main.c
index a307222c..9705af59 100644
--- a/src/host/layer23/src/common/main.c
+++ b/src/host/layer23/src/common/main.c
@@ -254,8 +254,13 @@ int main(int argc, char **argv)
if (rc < 0)
fprintf(stderr, "Failed during sap_open(), no SIM reader\n");
- lapdm_init(&ms->l2_entity.lapdm_dcch, ms);
- lapdm_init(&ms->l2_entity.lapdm_acch, ms);
+ ms->l2_entity.lapdm_dcch.l1_ctx = ms;
+ ms->l2_entity.lapdm_dcch.l3_ctx = ms;
+ lapdm_init(&ms->l2_entity.lapdm_dcch);
+
+ ms->l2_entity.lapdm_acch.l1_ctx = ms;
+ ms->l2_entity.lapdm_acch.l3_ctx = ms;
+ lapdm_init(&ms->l2_entity.lapdm_acch);
rc = l23_app_init(ms);
if (rc < 0)
diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c
index 1dc585a5..5bb580a3 100644
--- a/src/host/layer23/src/mobile/app_mobile.c
+++ b/src/host/layer23/src/mobile/app_mobile.c
@@ -160,8 +160,12 @@ int mobile_init(struct osmocom_ms *ms)
int rc;
gsm_settings_arfcn(ms);
- lapdm_init(&ms->l2_entity.lapdm_dcch, ms);
- lapdm_init(&ms->l2_entity.lapdm_acch, ms);
+ ms->l2_entity.lapdm_dcch.l1_ctx = ms;
+ ms->l2_entity.lapdm_dcch.l3_ctx = ms;
+ lapdm_init(&ms->l2_entity.lapdm_dcch);
+ ms->l2_entity.lapdm_acch.l1_ctx = ms;
+ ms->l2_entity.lapdm_acch.l3_ctx = ms;
+ lapdm_init(&ms->l2_entity.lapdm_acch);
gsm_sim_init(ms);
gsm48_cc_init(ms);
gsm_subscr_init(ms);