diff options
author | Pablo Neira Ayuso <pablo@gnumonks.org> | 2011-08-17 22:44:07 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-08-19 22:38:35 +0200 |
commit | ed5cacb240b846c106f0fc6a3ab8e8721f4c70a5 (patch) | |
tree | ba6bffbf0c95ecc0c50b5335bed77f3a2b29120f /openbsc/include/openbsc/subchan_demux.h | |
parent | 7abecfcfc9ef94c1367cd88ac858b79d20f75db0 (diff) |
src: port openBSC over libosmo-abisopenbsc/0.9.150.9.15
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.
Diffstat (limited to 'openbsc/include/openbsc/subchan_demux.h')
-rw-r--r-- | openbsc/include/openbsc/subchan_demux.h | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/openbsc/include/openbsc/subchan_demux.h b/openbsc/include/openbsc/subchan_demux.h deleted file mode 100644 index b71c856d9..000000000 --- a/openbsc/include/openbsc/subchan_demux.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef _SUBCH_DEMUX_H -#define _SUBCH_DEMUX_H -/* A E1 sub-channel (de)multiplexer with TRAU frame sync */ - -/* (C) 2009 by Harald Welte <laforge@gnumonks.org> - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ - -#include <stdint.h> -#include <osmocom/core/linuxlist.h> - -#define NR_SUBCH 4 -#define TRAU_FRAME_SIZE 40 -#define TRAU_FRAME_BITS (TRAU_FRAME_SIZE*8) - -/***********************************************************************/ -/* DEMULTIPLEXER */ -/***********************************************************************/ - -struct demux_subch { - uint8_t out_bitbuf[TRAU_FRAME_BITS]; - uint16_t out_idx; /* next bit to be written in out_bitbuf */ - /* number of consecutive zeros that we have received (for sync) */ - unsigned int consecutive_zeros; - /* are we in TRAU frame sync or not? */ - unsigned int in_sync; -}; - -struct subch_demux { - /* bitmask of currently active subchannels */ - uint8_t chan_activ; - /* one demux_subch struct for every subchannel */ - struct demux_subch subch[NR_SUBCH]; - /* callback to be called once we have received a complete - * frame on a given subchannel */ - int (*out_cb)(struct subch_demux *dmx, int ch, uint8_t *data, int len, - void *); - /* user-provided data, transparently passed to out_cb() */ - void *data; -}; - -/* initialize one demultiplexer instance */ -int subch_demux_init(struct subch_demux *dmx); - -/* feed 'len' number of muxed bytes into the demultiplexer */ -int subch_demux_in(struct subch_demux *dmx, uint8_t *data, int len); - -/* activate decoding/processing for one subchannel */ -int subch_demux_activate(struct subch_demux *dmx, int subch); - -/* deactivate decoding/processing for one subchannel */ -int subch_demux_deactivate(struct subch_demux *dmx, int subch); - -/***********************************************************************/ -/* MULTIPLEXER */ -/***********************************************************************/ - -/* one element in the tx_queue of a muxer sub-channel */ -struct subch_txq_entry { - struct llist_head list; - - unsigned int bit_len; /* total number of bits in 'bits' */ - unsigned int next_bit; /* next bit to be transmitted */ - - uint8_t bits[0]; /* one bit per byte */ -}; - -struct mux_subch { - struct llist_head tx_queue; -}; - -/* structure representing one instance of the subchannel muxer */ -struct subch_mux { - struct mux_subch subch[NR_SUBCH]; -}; - -/* initialize a subchannel muxer instance */ -int subchan_mux_init(struct subch_mux *mx); - -/* request the output of 'len' multiplexed bytes */ -int subchan_mux_out(struct subch_mux *mx, uint8_t *data, int len); - -/* enqueue some data into one sub-channel of the muxer */ -int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const uint8_t *data, - int len); - -#endif /* _SUBCH_DEMUX_H */ |