summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/include/osmocom
diff options
context:
space:
mode:
Diffstat (limited to 'src/host/layer23/include/osmocom')
-rw-r--r--src/host/layer23/include/osmocom/Makefile.am3
l---------src/host/layer23/include/osmocom/debug.h1
-rw-r--r--src/host/layer23/include/osmocom/l1ctl.h25
-rw-r--r--src/host/layer23/include/osmocom/lapdm.h60
-rw-r--r--src/host/layer23/include/osmocom/layer3.h10
-rw-r--r--src/host/layer23/include/osmocom/osmocom_data.h19
-rw-r--r--src/host/layer23/include/osmocom/rslms.h23
7 files changed, 141 insertions, 0 deletions
diff --git a/src/host/layer23/include/osmocom/Makefile.am b/src/host/layer23/include/osmocom/Makefile.am
new file mode 100644
index 0000000..6014195
--- /dev/null
+++ b/src/host/layer23/include/osmocom/Makefile.am
@@ -0,0 +1,3 @@
+# headers from OpenBSC
+noinst_HEADERS = debug.h
+noinst_HEADERS += l1ctl.h osmocom_data.h lapdm.h rslms.h layer3.h
diff --git a/src/host/layer23/include/osmocom/debug.h b/src/host/layer23/include/osmocom/debug.h
new file mode 120000
index 0000000..ae7c52c
--- /dev/null
+++ b/src/host/layer23/include/osmocom/debug.h
@@ -0,0 +1 @@
+../../../libosmocom/include/osmocom/debug.h \ No newline at end of file
diff --git a/src/host/layer23/include/osmocom/l1ctl.h b/src/host/layer23/include/osmocom/l1ctl.h
new file mode 100644
index 0000000..0d5cba6
--- /dev/null
+++ b/src/host/layer23/include/osmocom/l1ctl.h
@@ -0,0 +1,25 @@
+#ifndef osmocom_l1ctl_h
+#define osmocom_l1ctl_h
+
+#include <osmocore/msgb.h>
+#include <osmocom/osmocom_data.h>
+
+struct osmocom_ms;
+
+/* Receive incoming data from L1 using L1CTL format */
+int l1ctl_recv(struct osmocom_ms *ms, struct msgb *msg);
+
+/* Transmit L1CTL_DATA_REQ */
+int tx_ph_data_req(struct osmocom_ms *ms, struct msgb *msg,
+ uint8_t chan_nr, uint8_t link_id);
+
+/* Transmit L1CTL_RACH_REQ */
+int tx_ph_rach_req(struct osmocom_ms *ms);
+
+/* Transmit L1CTL_DM_EST_REQ */
+int tx_ph_dm_est_req(struct osmocom_ms *ms, uint16_t band_arfcn, uint8_t chan_nr);
+
+extern int osmo_send_l1(struct osmocom_ms *ms, struct msgb *msg);
+
+
+#endif
diff --git a/src/host/layer23/include/osmocom/lapdm.h b/src/host/layer23/include/osmocom/lapdm.h
new file mode 100644
index 0000000..f3967a9
--- /dev/null
+++ b/src/host/layer23/include/osmocom/lapdm.h
@@ -0,0 +1,60 @@
+#ifndef _OSMOCOM_LAPDM_H
+#define _OSMOCOM_LAPDM_H
+
+#include <stdint.h>
+
+#include <osmocore/timer.h>
+#include <osmocore/msgb.h>
+
+#include <l1a_l23_interface.h>
+
+enum lapdm_state {
+ LAPDm_STATE_IDLE,
+ LAPDm_STATE_SABM_SENT,
+ LAPDm_STATE_MF_EST,
+ LAPDm_STATE_TIMER_RECOV,
+ LAPDm_STATE_OWN_RCVR_BUSY,
+ LAPDm_STATE_NULL,
+};
+
+struct lapdm_entity;
+struct osmocom_ms;
+
+/* TS 04.06 / Section 3.5.2 */
+struct lapdm_datalink {
+ uint8_t V_send; /* seq nr of next I frame to be transmitted */
+ uint8_t V_ack; /* last frame ACKed by peer */
+ uint8_t N_send; /* ? set to V_send at Tx time*/
+ uint8_t V_recv; /* seq nr of next I frame expected to be received */
+ uint8_t N_recv; /* expected send seq nr of the next received I frame */
+ enum lapdm_state state;
+ struct timer_list t200;
+ uint8_t retrans_ctr;
+
+ struct lapdm_entity *entity;
+};
+
+enum lapdm_dl_sapi {
+ DL_SAPI0 = 0,
+ DL_SAPI3 = 1,
+ _NR_DL_SAPI
+};
+
+struct lapdm_entity {
+ struct lapdm_datalink datalink[_NR_DL_SAPI];
+ struct osmocom_ms *ms;
+};
+
+/* initialize a LAPDm entity */
+void lapdm_init(struct lapdm_entity *le, struct osmocom_ms *ms);
+
+/* input into layer2 (from layer 1) */
+int l2_ph_data_ind(struct msgb *msg, struct lapdm_entity *le, struct l1ctl_info_dl *l1i);
+
+/* input into layer2 (from layer 3) */
+int rslms_recvmsg(struct msgb *msg, struct osmocom_ms *ms);
+
+/* sending messages up from L2 to L3 */
+int rslms_sendmsg(struct msgb *msg, struct osmocom_ms *ms);
+
+#endif /* _OSMOCOM_LAPDM_H */
diff --git a/src/host/layer23/include/osmocom/layer3.h b/src/host/layer23/include/osmocom/layer3.h
new file mode 100644
index 0000000..1b4af07
--- /dev/null
+++ b/src/host/layer23/include/osmocom/layer3.h
@@ -0,0 +1,10 @@
+#ifndef _OSMOCOM_L3_H
+#define _OSMOCOM_L3_H
+
+#include <osmocore/msgb.h>
+#include <osmocom/osmocom_data.h>
+
+int gsm48_rx_ccch(struct msgb *msg, struct osmocom_ms *ms);
+int gsm48_rx_dcch(struct msgb *msg, struct osmocom_ms *ms);
+
+#endif
diff --git a/src/host/layer23/include/osmocom/osmocom_data.h b/src/host/layer23/include/osmocom/osmocom_data.h
new file mode 100644
index 0000000..48c5579
--- /dev/null
+++ b/src/host/layer23/include/osmocom/osmocom_data.h
@@ -0,0 +1,19 @@
+#ifndef osmocom_data_h
+#define osmocom_data_h
+
+#include <osmocore/select.h>
+#include <osmocore/gsm_utils.h>
+
+#include <osmocom/lapdm.h>
+
+/* One Mobilestation for osmocom */
+struct osmocom_ms {
+ struct bsc_fd bfd;
+ enum gsm_band band;
+ int arfcn;
+
+ struct lapdm_entity lapdm_dcch;
+ struct lapdm_entity lapdm_acch;
+};
+
+#endif
diff --git a/src/host/layer23/include/osmocom/rslms.h b/src/host/layer23/include/osmocom/rslms.h
new file mode 100644
index 0000000..7327c11
--- /dev/null
+++ b/src/host/layer23/include/osmocom/rslms.h
@@ -0,0 +1,23 @@
+#ifndef _OSMOCOM_RSLMS_H
+#define _OSMOCOM_RSLMS_H
+
+#include <osmocore/msgb.h>
+#include <osmocom/osmocom_data.h>
+
+/* From L3 into RSLMS (direction -> L2) */
+
+/* Send a 'simple' RLL request to L2 */
+int rslms_tx_rll_req(struct osmocom_ms *ms, uint8_t msg_type,
+ uint8_t chan_nr, uint8_t link_id);
+
+/* Send a RLL request (including L3 info) to L2 */
+int rslms_tx_rll_req_l3(struct osmocom_ms *ms, uint8_t msg_type,
+ uint8_t chan_nr, uint8_t link_id, struct msgb *msg);
+
+
+/* From L2 into RSLMS (direction -> L3) */
+
+/* input function that L2 calls when sending messages up to L3 */
+int rslms_sendmsg(struct msgb *msg, struct osmocom_ms *ms);
+
+#endif /* _OSMOCOM_RSLMS_H */