aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmo-bts/bts.h
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-03-04 14:05:20 +0100
committerHarald Welte <laforge@gnumonks.org>2011-03-04 14:05:20 +0100
commit4b45ae1636990a15934f77f37033cf8ed5804b57 (patch)
tree892d687a5c689fdb7813a3f94dd9a0926d80b892 /include/osmo-bts/bts.h
Import all C and Header files from jolly/bts branch of osmocom-bb.git
The BTS code shall reside in a separate git repository, thus I'm importing the C and H files here.
Diffstat (limited to 'include/osmo-bts/bts.h')
-rw-r--r--include/osmo-bts/bts.h133
1 files changed, 133 insertions, 0 deletions
diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h
new file mode 100644
index 00000000..3e37e0bf
--- /dev/null
+++ b/include/osmo-bts/bts.h
@@ -0,0 +1,133 @@
+#ifndef _BTS_H
+#define _BTS_H
+
+#define BTS_SI_NUM 23 /* MUAR match the entries in BTS_SI_LIST */
+
+#define BTS_SI_LIST { \
+ RSL_SYSTEM_INFO_8, \
+ RSL_SYSTEM_INFO_1, \
+ RSL_SYSTEM_INFO_2, \
+ RSL_SYSTEM_INFO_3, \
+ RSL_SYSTEM_INFO_4, \
+ RSL_SYSTEM_INFO_5, \
+ RSL_SYSTEM_INFO_6, \
+ RSL_SYSTEM_INFO_7, \
+ RSL_SYSTEM_INFO_16, \
+ RSL_SYSTEM_INFO_17, \
+ RSL_SYSTEM_INFO_2bis, \
+ RSL_SYSTEM_INFO_2ter, \
+ RSL_SYSTEM_INFO_5bis, \
+ RSL_SYSTEM_INFO_5ter, \
+ RSL_SYSTEM_INFO_10, \
+ REL_EXT_MEAS_ORDER, \
+ RSL_MEAS_INFO, \
+ RSL_SYSTEM_INFO_13, \
+ RSL_SYSTEM_INFO_2quater, \
+ RSL_SYSTEM_INFO_9, \
+ RSL_SYSTEM_INFO_18, \
+ RSL_SYSTEM_INFO_19, \
+ RSL_SYSTEM_INFO_20, \
+}
+
+#define BTS_SI_NAME char *bts_si_name[] = { \
+ "RSL_SYSTEM_INFO_8", \
+ "RSL_SYSTEM_INFO_1", \
+ "RSL_SYSTEM_INFO_2", \
+ "RSL_SYSTEM_INFO_3", \
+ "RSL_SYSTEM_INFO_4", \
+ "RSL_SYSTEM_INFO_5", \
+ "RSL_SYSTEM_INFO_6", \
+ "RSL_SYSTEM_INFO_7", \
+ "RSL_SYSTEM_INFO_16", \
+ "RSL_SYSTEM_INFO_17", \
+ "RSL_SYSTEM_INFO_2bis", \
+ "RSL_SYSTEM_INFO_2ter", \
+ "RSL_SYSTEM_INFO_5bis", \
+ "RSL_SYSTEM_INFO_5ter", \
+ "RSL_SYSTEM_INFO_10", \
+ "REL_EXT_MEAS_ORDER", \
+ "RSL_MEAS_INFO", \
+ "RSL_SYSTEM_INFO_13", \
+ "RSL_SYSTEM_INFO_2quater", \
+ "RSL_SYSTEM_INFO_9", \
+ "RSL_SYSTEM_INFO_18", \
+ "RSL_SYSTEM_INFO_19", \
+ "RSL_SYSTEM_INFO_20", \
+}
+
+#define BTS_SI_USE 1
+#define BTS_SI_NEW 2
+
+/* store sysinfos of a BTS */
+struct osmobts_sysinfo {
+ uint8_t flags[BTS_SI_NUM];
+ uint8_t si[BTS_SI_NUM][23];
+ struct timer_list timer;
+};
+
+struct osmobts_slot;
+
+/* one physical radio */
+struct osmobts_ms {
+ struct llist_head entry;
+ struct osmobts_trx *trx;
+ struct osmocom_ms ms;
+};
+
+/* one logical channel instance */
+struct osmobts_lchan {
+ struct osmobts_slot *slot;
+ uint8_t lchan_nr;
+ uint8_t chan_nr; /* CBITS+TN */
+ struct osmol2_entity l2_entity;
+ struct osmobts_rtp rtp;
+};
+
+/* one timeslot instance */
+struct osmobts_slot {
+ struct osmobts_trx *trx;
+ uint8_t slot_nr;
+ uint8_t acch_type; /* TS 08.58 9.3.1 (bits 8..4) */
+ uint8_t has_bcch;
+ uint8_t chan_comb;
+ struct osmobts_lchan *lchan[8];
+ struct osmobts_ms *tx_ms, *rx_ms;
+};
+
+/* one TRX instance */
+struct osmobts_trx {
+ struct osmocom_bts *bts;
+ uint8_t trx_nr;
+ struct osmobts_slot slot[8];
+ struct llist_head ms_list;
+ struct ipabis_link link;
+ struct osmobts_sysinfo si;
+ uint8_t rf_red;
+ uint16_t arfcn_list[128];
+ int arfcn_num;
+};
+
+/* the BTS instance */
+struct osmocom_bts {
+ char *id;
+ uint8_t num_trx;
+ struct osmobts_trx *trx[8];
+ struct ipabis_link link;
+ uint8_t max_ta;
+ uint16_t bcch_arfcn;
+ uint8_t bcc, ncc;
+ uint16_t start_time;
+};
+
+struct osmocom_bts *create_bts(uint8_t num_trx, char *id);
+int create_ms(struct osmobts_trx *trx, int maskc, uint8_t *maskv_tx,
+ uint8_t *maskv_rx);
+void destroy_bts(struct osmocom_bts *bts);
+int work_bts(struct osmocom_bts *bts);
+int bts_link_estab(struct osmocom_bts *bts);
+int trx_link_estab(struct osmobts_trx *trx);
+void bts_new_si(void *arg);
+void bts_setup_slot(struct osmobts_slot *slot, uint8_t comb);
+
+#endif /* _BTS_H */
+