summaryrefslogtreecommitdiffstats
path: root/include/osmocom
diff options
context:
space:
mode:
authorPablo Neira Ayuso2011-07-05 14:53:37 +0200
committerPablo Neira Ayuso2011-07-05 14:53:37 +0200
commit355ce696611b6484f6368035bf84c1051acead75 (patch)
tree786332a515d86fe02ba33855c57ca9adeb631014 /include/osmocom
parentinclude: remove unused ipaccess_read_msg definition from internal.h (diff)
downloadlibosmo-abis-355ce696611b6484f6368035bf84c1051acead75.tar.gz
libosmo-abis-355ce696611b6484f6368035bf84c1051acead75.tar.xz
libosmo-abis-355ce696611b6484f6368035bf84c1051acead75.zip
include: export lapd.h since openBSC needs it
More specifically, the unfinished ericsson rbs2000 BTS.
Diffstat (limited to 'include/osmocom')
-rw-r--r--include/osmocom/abis/Makefile.am1
-rw-r--r--include/osmocom/abis/lapd.h46
2 files changed, 47 insertions, 0 deletions
diff --git a/include/osmocom/abis/Makefile.am b/include/osmocom/abis/Makefile.am
index 85c77b7..ea1eded 100644
--- a/include/osmocom/abis/Makefile.am
+++ b/include/osmocom/abis/Makefile.am
@@ -1,5 +1,6 @@
osmoabis_HEADERS = abis.h \
e1_input.h \
+ lapd.h \
logging.h \
subchan_demux.h \
ipa_proxy.h \
diff --git a/include/osmocom/abis/lapd.h b/include/osmocom/abis/lapd.h
new file mode 100644
index 0000000..fb980d1
--- /dev/null
+++ b/include/osmocom/abis/lapd.h
@@ -0,0 +1,46 @@
+#ifndef OPENBSC_LAPD_H
+#define OPENBSC_LAPD_H
+
+#include <stdint.h>
+
+#include <osmocom/core/linuxlist.h>
+
+typedef enum {
+ LAPD_MPH_NONE = 0,
+
+ LAPD_MPH_ACTIVATE_IND,
+ LAPD_MPH_DEACTIVATE_IND,
+
+ LAPD_DL_DATA_IND,
+ LAPD_DL_UNITDATA_IND,
+
+} lapd_mph_type;
+
+struct lapd_instance {
+ struct llist_head list; /* list of LAPD instances */
+ int network_side;
+
+ void (*transmit_cb)(uint8_t *data, int len, void *cbdata);
+ void *cbdata;
+
+ struct llist_head tei_list; /* list of TEI in this LAPD instance */
+};
+
+extern uint8_t *lapd_receive(struct lapd_instance *li, uint8_t *data, unsigned int len,
+ int *ilen, lapd_mph_type *prim);
+
+extern void lapd_transmit(struct lapd_instance *li, uint8_t tei, uint8_t sapi,
+ uint8_t *data, unsigned int len);
+
+struct lapd_instance *lapd_instance_alloc(int network_side,
+ void (*tx_cb)(uint8_t *data, int len,
+ void *cbdata), void *cbdata);
+
+
+/* Start a (user-side) SAP for the specified TEI/SAPI on the LAPD instance */
+int lapd_sap_start(struct lapd_instance *li, uint8_t tei, uint8_t sapi);
+
+/* Stop a (user-side) SAP for the specified TEI/SAPI on the LAPD instance */
+int lapd_sap_stop(struct lapd_instance *li, uint8_t tei, uint8_t sapi);
+
+#endif /* OPENBSC_LAPD_H */