aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo/l1_if.h
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-06-27 11:25:35 +0200
committerHarald Welte <laforge@gnumonks.org>2011-06-27 11:25:35 +0200
commitc6b4c87e5d57b91b29894835e7ac8e42f6e67f32 (patch)
tree2dfca5a61c881e88e6f29d03c29bb26e1c643332 /src/osmo-bts-sysmo/l1_if.h
parent8e47fb89bfd0e2b54b714393ac2a80ca76df56a9 (diff)
re-work original osmo-bts with support for sysmocom femtobts
This code re-works osmo-bts to add support for the upcoming sysmocom BTS. It also tries to add some level of abstraction between the generic part of a BTS (A-bis, RSL, OML, data structures, paging scheduling, BCCH/AGCH scheduling, etc.) and the actual hardware-specific bits. The hardware-specific bits are currently only implemented for the sysmocom femtobts, but should be (re-)added for osmocom-bb, as well as a virtual BTS for simulation purpose later. The sysmocom bts specific parts require hardware-specific header files which are (at least currently) not publicly distributed.
Diffstat (limited to 'src/osmo-bts-sysmo/l1_if.h')
-rw-r--r--src/osmo-bts-sysmo/l1_if.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h
new file mode 100644
index 00000000..7dcae537
--- /dev/null
+++ b/src/osmo-bts-sysmo/l1_if.h
@@ -0,0 +1,50 @@
+#ifndef _FEMTO_L1_H
+#define _FEMTO_L1_H
+
+#include <osmocom/core/select.h>
+#include <osmocom/core/write_queue.h>
+#include <osmocom/gsm/gsm_utils.h>
+
+enum {
+ MQ_SYS_READ,
+ MQ_L1_READ,
+ _NUM_MQ_READ
+};
+
+enum {
+ MQ_SYS_WRITE,
+ MQ_L1_WRITE,
+ _NUM_MQ_WRITE
+};
+
+struct femtol1_hdl {
+ struct gsm_time gsm_time;
+ uint32_t hLayer1; /* handle to the L1 instance in the DSP */
+ struct llist_head wlc_list;
+
+ void *priv; /* user reference */
+
+ struct osmo_fd read_ofd[_NUM_MQ_READ]; /* osmo file descriptors */
+ struct osmo_wqueue write_q[_NUM_MQ_WRITE];
+};
+
+#define msgb_l1prim(msg) ((GsmL1_Prim_t *)(msg)->l1h)
+#define msgb_sysprim(msg) ((FemtoBts_Prim_t *)(msg)->l1h)
+
+typedef int l1if_compl_cb(struct msgb *l1_msg, void *data);
+
+/* send a request primitive to the L1 and schedule completion call-back */
+int l1if_req_compl(struct femtol1_hdl *fl1h, struct msgb *msg,
+ int is_system_prim, l1if_compl_cb *cb, void *data);
+
+struct femtol1_hdl *l1if_open(void *priv);
+int l1if_close(struct femtol1_hdl *hdl);
+int l1if_reset(struct femtol1_hdl *hdl);
+
+struct msgb *l1p_msgb_alloc(void);
+struct msgb *sysp_msgb_alloc(void);
+
+uint32_t l1if_lchan_to_hLayer2(struct gsm_lchan *lchan);
+struct gsm_lchan *l1if_hLayer2_to_lchan(struct gsm_bts_trx *trx, uint32_t hLayer2);
+
+#endif /* _FEMTO_L1_H */