From ed5cacb240b846c106f0fc6a3ab8e8721f4c70a5 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 17 Aug 2011 22:44:07 +0200 Subject: src: port openBSC over libosmo-abis This is a big patch that ports openBSC over libosmo-abis. Sorry, the changes that are included here are all dependent of libosmo-abis, splitting them into smaller pieces would leave the repository in some intermediate state, which is not desired. The main changes are: - The directory libabis/ has been removed as it now lives in libosmo-abis. - new configuration file format for nanoBTS and HSL femto, we need to define the virtual e1_line and attach it to the OML link. - all the existing BTS drivers (nanoBTS, hsl femto, Nokia site, BS11 and rbs2000) now use the new libosmo-abis framework. - use r232 input driver available in libosmo-abis for bs11_config. - use ipa_msg_recv instead of old ipaccess_read_msg function. - delete definition of gsm_e1_subslot and input_signal_data. These structures now lives in libosmo-abis. Most of this patch are deletions of libabis/ which has been moved to libosmo-abis. This patch also modifies openBSC to use all the new definitions available in libosmocore and libosmo-abis. In order to do that, we have replaced the following: - DINP, DMI, DMIB and DMUX by their respective DL* correspondences. - SS_GLOBAL by SS_L_GLOBAL - SS_INPUT by SS_L_INPUT - S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN - SS_INPUT by SS_L_INPUT - S_INP_* by S_L_INP_* sub-signals - E1INP_NODE by L_E1INP_NODE vty node This patch has been tested with: - one nanoBTS - the HSL femto with the examples available under libosmo-abis - BS11 with both dahdi and misdn drivers. --- openbsc/include/openbsc/e1_input.h | 200 ------------------------------------- 1 file changed, 200 deletions(-) delete mode 100644 openbsc/include/openbsc/e1_input.h (limited to 'openbsc/include/openbsc/e1_input.h') diff --git a/openbsc/include/openbsc/e1_input.h b/openbsc/include/openbsc/e1_input.h deleted file mode 100644 index 4a375ed82..000000000 --- a/openbsc/include/openbsc/e1_input.h +++ /dev/null @@ -1,200 +0,0 @@ -#ifndef _E1_INPUT_H -#define _E1_INPUT_H - -#include -#include - -#include -#include -#include -#include -#include -#include - -#define NUM_E1_TS 32 - -enum e1inp_sign_type { - E1INP_SIGN_NONE, - E1INP_SIGN_OML, - E1INP_SIGN_RSL, -}; -const char *e1inp_signtype_name(enum e1inp_sign_type tp); - -enum e1inp_ctr { - E1I_CTR_HDLC_ABORT, - E1I_CTR_HDLC_BADFCS, - E1I_CTR_HDLC_OVERR, - E1I_CTR_ALARM, - E1I_CTR_REMOVED, -}; - -struct e1inp_ts; - -struct e1inp_sign_link { - /* list of signalling links */ - struct llist_head list; - - /* to which timeslot do we belong? */ - struct e1inp_ts *ts; - - enum e1inp_sign_type type; - - /* trx for msg->trx of received msgs */ - struct gsm_bts_trx *trx; - - /* msgb queue of to-be-transmitted msgs */ - struct llist_head tx_list; - - /* SAPI and TEI on the E1 TS */ - uint8_t sapi; - uint8_t tei; - - union { - struct { - uint8_t channel; - } misdn; - } driver; -}; - -enum e1inp_ts_type { - E1INP_TS_TYPE_NONE, - E1INP_TS_TYPE_SIGN, - E1INP_TS_TYPE_TRAU, -}; -const char *e1inp_tstype_name(enum e1inp_ts_type tp); - -/* A timeslot in the E1 interface */ -struct e1inp_ts { - enum e1inp_ts_type type; - int num; - - /* to which line do we belong ? */ - struct e1inp_line *line; - - union { - struct { - /* list of all signalling links on this TS */ - struct llist_head sign_links; - /* delay for the queue */ - int delay; - /* timer when to dequeue next frame */ - struct osmo_timer_list tx_timer; - } sign; - struct { - /* subchannel demuxer for frames from E1 */ - struct subch_demux demux; - /* subchannel muxer for frames to E1 */ - struct subch_mux mux; - } trau; - }; - union { - struct { - /* mISDN driver has one fd for each ts */ - struct osmo_fd fd; - } misdn; - struct { - /* ip.access driver has one fd for each ts */ - struct osmo_fd fd; - } ipaccess; - struct { - /* DAHDI driver has one fd for each ts */ - struct osmo_fd fd; - struct lapd_instance *lapd; - } dahdi; - } driver; -}; - -struct e1inp_driver { - struct llist_head list; - const char *name; - int (*want_write)(struct e1inp_ts *ts); - int (*line_update)(struct e1inp_line *line); - int default_delay; -}; - -struct e1inp_line { - struct llist_head list; - unsigned int num; - const char *name; - struct rate_ctr_group *rate_ctr; - - /* array of timestlots */ - struct e1inp_ts ts[NUM_E1_TS]; - - struct e1inp_driver *driver; - void *driver_data; -}; - -/* register a driver with the E1 core */ -int e1inp_driver_register(struct e1inp_driver *drv); - -/* fine a previously registered driver */ -struct e1inp_driver *e1inp_driver_find(const char *name); - -/* register a line with the E1 core */ -int e1inp_line_register(struct e1inp_line *line); - -/* get a line by its ID */ -struct e1inp_line *e1inp_line_get(uint8_t e1_nr); - -/* create a line in the E1 input core */ -struct e1inp_line *e1inp_line_create(uint8_t e1_nr, const char *driver_name); - -/* find a sign_link for given TEI and SAPI in a TS */ -struct e1inp_sign_link * -e1inp_lookup_sign_link(struct e1inp_ts *ts, uint8_t tei, - uint8_t sapi); - -/* create a new signalling link in a E1 timeslot */ -struct e1inp_sign_link * -e1inp_sign_link_create(struct e1inp_ts *ts, enum e1inp_sign_type type, - struct gsm_bts_trx *trx, uint8_t tei, - uint8_t sapi); - -/* configure and initialize one e1inp_ts */ -int e1inp_ts_config(struct e1inp_ts *ts, struct e1inp_line *line, - enum e1inp_ts_type type); - -/* Call from the Stack: configuration of this TS has changed */ -int e1inp_update_ts(struct e1inp_ts *ts); - -/* Receive a packet from the E1 driver */ -int e1inp_rx_ts(struct e1inp_ts *ts, struct msgb *msg, - uint8_t tei, uint8_t sapi); - -/* called by driver if it wants to transmit on a given TS */ -struct msgb *e1inp_tx_ts(struct e1inp_ts *e1i_ts, - struct e1inp_sign_link **sign_link); - -/* called by driver in case some kind of link state event */ -int e1inp_event(struct e1inp_ts *ts, int evt, uint8_t tei, uint8_t sapi); - -/* Write LAPD frames to the fd. */ -void e1_set_pcap_fd(int fd); - -/* called by TRAU muxer to obtain the destination mux entity */ -struct subch_mux *e1inp_get_mux(uint8_t e1_nr, uint8_t ts_nr); - -void e1inp_sign_link_destroy(struct e1inp_sign_link *link); -int e1inp_line_update(struct e1inp_line *line); - -/* e1_config.c */ -int e1_reconfig_ts(struct gsm_bts_trx_ts *ts); -int e1_reconfig_trx(struct gsm_bts_trx *trx); -int e1_reconfig_bts(struct gsm_bts *bts); - -int ia_config_connect(struct gsm_bts *bts, struct sockaddr_in *sin); -int ipaccess_setup(struct gsm_network *gsmnet); -int hsl_setup(struct gsm_network *gsmnet); - -extern struct llist_head e1inp_driver_list; -extern struct llist_head e1inp_line_list; - -int e1inp_vty_init(void); -void e1inp_init(void); - -int _abis_nm_sendmsg(struct msgb *msg, int to_trx_oml); - -int abis_sendmsg(struct msgb *msg); - -#endif /* _E1_INPUT_H */ -- cgit v1.2.3