diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-06-27 11:25:35 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-06-27 11:25:35 +0200 |
commit | c6b4c87e5d57b91b29894835e7ac8e42f6e67f32 (patch) | |
tree | 2dfca5a61c881e88e6f29d03c29bb26e1c643332 /include/osmo-bts/bts.h | |
parent | 8e47fb89bfd0e2b54b714393ac2a80ca76df56a9 (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 'include/osmo-bts/bts.h')
-rw-r--r-- | include/osmo-bts/bts.h | 137 |
1 files changed, 17 insertions, 120 deletions
diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h index 70642207..0d0a0b44 100644 --- a/include/osmo-bts/bts.h +++ b/include/osmo-bts/bts.h @@ -1,132 +1,29 @@ #ifndef _BTS_H #define _BTS_H -#define BTS_SI_NUM 23 /* MUAR match the entries in BTS_SI_LIST */ +#include <osmo-bts/gsm_data.h> -#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, \ -} +extern void *tall_bts_ctx; -#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", \ -} +int bts_init(struct gsm_bts *bts); -#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 osmo_timer_list timer; -}; - -struct osmobts_slot; - -/* one physical radio */ -struct osmobts_ms { - struct llist_head entry; - struct osmobts_trx *trx; -}; - -/* one logical channel instance */ -struct osmobts_lchan { - struct osmobts_slot *slot; - uint8_t lchan_nr; - uint8_t chan_nr; /* CBITS+TN */ - struct lapdm_channel lapdm_channel; - 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; -}; +struct gsm_bts *create_bts(uint8_t num_trx, char *id); +int create_ms(struct gsm_bts_trx *trx, int maskc, uint8_t *maskv_tx, + uint8_t *maskv_rx); +void destroy_bts(struct gsm_bts *bts); +int work_bts(struct gsm_bts *bts); +int bts_link_estab(struct gsm_bts *bts); +int trx_link_estab(struct gsm_bts_trx *trx); +void bts_new_si(void *arg); +void bts_setup_slot(struct gsm_bts_trx_ts *slot, uint8_t comb); -/* 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; -}; +int lchan_init_lapdm(struct gsm_lchan *lchan); -/* 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; -}; +int bts_agch_enqueue(struct gsm_bts *bts, struct msgb *msg); +struct msgb *bts_agch_dequeue(struct gsm_bts *bts); -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); +uint8_t *bts_sysinfo_get(struct gsm_bts *bts, struct gsm_time *g_time); +uint8_t *lchan_sacch_get(struct gsm_lchan *lchan, struct gsm_time *g_time); #endif /* _BTS_H */ |