blob: 070606da59f09019060a603605c76b6349e3e8a7 [file] [log] [blame]
Holger Hans Peter Freytherec32b582010-03-23 07:40:46 +01001/* GSM 08.08 like API for OpenBSC. The bridge from MSC to BSC */
2
3/* (C) 2010 by Holger Hans Peter Freyther
Holger Hans Peter Freyther2a9285c2010-06-14 18:03:06 +08004 * (C) 2009 by Harald Welte <laforge@gnumonks.org>
Holger Hans Peter Freytherec32b582010-03-23 07:40:46 +01005 *
6 * All Rights Reserved
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 *
22 */
23
24#include <openbsc/bsc_api.h>
25#include <openbsc/abis_rsl.h>
26
27
28int gsm0808_submit_dtap(struct gsm_subscriber_connection *conn,
29 struct msgb *msg, int link_id)
30{
31 msg->lchan = conn->lchan;
32 msg->trx = msg->lchan->ts->trx;
33 return rsl_data_request(msg, link_id);
34}
Holger Hans Peter Freyther2a9285c2010-06-14 18:03:06 +080035
36/* dequeue messages to layer 4 */
37int bsc_upqueue(struct gsm_network *net)
38{
39 struct gsm_mncc *mncc;
40 struct msgb *msg;
41 int work = 0;
42
43 if (net)
44 while ((msg = msgb_dequeue(&net->upqueue))) {
45 mncc = (struct gsm_mncc *)msg->data;
46 if (net->mncc_recv)
47 net->mncc_recv(net, mncc->msg_type, mncc);
48 work = 1; /* work done */
49 talloc_free(msg);
50 }
51
52 return work;
53}