aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-09-16 00:47:32 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-09-16 02:16:01 +0800
commita2aedad00541a020b2083fb31ba14d8670a5c26f (patch)
treebcdb275a353537cf5854d3d5829489a54e7c0fd8 /openbsc
parent1502ddefac7b2b1611693f167528aceb34fb8983 (diff)
bsc: Move the subscriber_con code into the bsc_api
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/bsc_api.c41
-rw-r--r--openbsc/src/chan_alloc.c40
2 files changed, 41 insertions, 40 deletions
diff --git a/openbsc/src/bsc_api.c b/openbsc/src/bsc_api.c
index 44ec42092..6c2a467e4 100644
--- a/openbsc/src/bsc_api.c
+++ b/openbsc/src/bsc_api.c
@@ -36,6 +36,47 @@
static void rll_ind_cb(struct gsm_lchan *, uint8_t, void *, enum bsc_rllr_ind);
static void send_sapi_reject(struct gsm_subscriber_connection *conn, int link_id);
+struct gsm_subscriber_connection *subscr_con_allocate(struct gsm_lchan *lchan)
+{
+ struct gsm_subscriber_connection *conn;
+
+ conn = talloc_zero(lchan->ts->trx->bts->network, struct gsm_subscriber_connection);
+ if (!conn)
+ return NULL;
+
+ /* Configure the time and start it so it will be closed */
+ conn->lchan = lchan;
+ conn->bts = lchan->ts->trx->bts;
+ lchan->conn = conn;
+ return conn;
+}
+
+/* TODO: move subscriber put here... */
+void subscr_con_free(struct gsm_subscriber_connection *conn)
+{
+ struct gsm_lchan *lchan;
+
+
+ if (!conn)
+ return;
+
+
+ if (conn->subscr) {
+ subscr_put(conn->subscr);
+ conn->subscr = NULL;
+ }
+
+
+ if (conn->ho_lchan)
+ LOGP(DNM, LOGL_ERROR, "The ho_lchan should have been cleared.\n");
+
+ lchan = conn->lchan;
+ talloc_free(conn);
+
+ if (lchan)
+ lchan->conn = NULL;
+}
+
int bsc_api_init(struct gsm_network *network, struct bsc_api *api)
{
network->bsc_api = api;
diff --git a/openbsc/src/chan_alloc.c b/openbsc/src/chan_alloc.c
index 3c8082da6..2cdd9927b 100644
--- a/openbsc/src/chan_alloc.c
+++ b/openbsc/src/chan_alloc.c
@@ -509,43 +509,3 @@ void network_chan_load(struct pchan_load *pl, struct gsm_network *net)
bts_chan_load(pl, bts);
}
-struct gsm_subscriber_connection *subscr_con_allocate(struct gsm_lchan *lchan)
-{
- struct gsm_subscriber_connection *conn;
-
- conn = talloc_zero(lchan->ts->trx->bts->network, struct gsm_subscriber_connection);
- if (!conn)
- return NULL;
-
- /* Configure the time and start it so it will be closed */
- conn->lchan = lchan;
- conn->bts = lchan->ts->trx->bts;
- lchan->conn = conn;
- return conn;
-}
-
-/* TODO: move subscriber put here... */
-void subscr_con_free(struct gsm_subscriber_connection *conn)
-{
- struct gsm_lchan *lchan;
-
-
- if (!conn)
- return;
-
-
- if (conn->subscr) {
- subscr_put(conn->subscr);
- conn->subscr = NULL;
- }
-
-
- if (conn->ho_lchan)
- LOGP(DNM, LOGL_ERROR, "The ho_lchan should have been cleared.\n");
-
- lchan = conn->lchan;
- talloc_free(conn);
-
- if (lchan)
- lchan->conn = NULL;
-}