aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/e1_config.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/e1_config.c')
-rw-r--r--openbsc/src/e1_config.c44
1 files changed, 29 insertions, 15 deletions
diff --git a/openbsc/src/e1_config.c b/openbsc/src/e1_config.c
index 9c9f40cff..addc9fe50 100644
--- a/openbsc/src/e1_config.c
+++ b/openbsc/src/e1_config.c
@@ -24,6 +24,7 @@ int e1_config(struct gsm_bts *bts, int cardnr, int release_l2)
struct e1inp_line *line;
struct e1inp_ts *sign_ts;
struct e1inp_sign_link *oml_link, *rsl_link;
+ struct gsm_bts_trx *trx = bts->c0;
line = talloc_zero(tall_bsc_ctx, struct e1inp_line);
if (!line)
@@ -37,13 +38,13 @@ int e1_config(struct gsm_bts *bts, int cardnr, int release_l2)
/* create signalling links for TS1 */
sign_ts = &line->ts[1-1];
oml_link = e1inp_sign_link_create(sign_ts, E1INP_SIGN_OML,
- bts->c0, TEI_OML, SAPI_OML);
+ trx, TEI_OML, SAPI_OML);
rsl_link = e1inp_sign_link_create(sign_ts, E1INP_SIGN_RSL,
- bts->c0, TEI_RSL, SAPI_RSL);
+ trx, TEI_RSL, SAPI_RSL);
/* create back-links from bts/trx */
bts->oml_link = oml_link;
- bts->c0->rsl_link = rsl_link;
+ trx->rsl_link = rsl_link;
/* enable subchannel demuxer on TS2 */
subch_demux_activate(&line->ts[2-1].trau.demux, 1);
@@ -56,18 +57,31 @@ int e1_config(struct gsm_bts *bts, int cardnr, int release_l2)
subch_demux_activate(&line->ts[3-1].trau.demux, 2);
subch_demux_activate(&line->ts[3-1].trau.demux, 3);
-#ifdef HAVE_TRX1
- /* create E1 timeslots for TRAU frames of TRX1 */
- e1inp_ts_config(&line->ts[4-1], line, E1INP_TS_TYPE_TRAU);
- e1inp_ts_config(&line->ts[5-1], line, E1INP_TS_TYPE_TRAU);
-
- /* create RSL signalling link for TRX1 */
- sign_ts = &line->ts[1-1];
- rsl_link = e1inp_sign_link_create(sign_ts, E1INP_SIGN_RSL,
- &bts->trx[1], TEI_RSL+1, SAPI_RSL);
- /* create back-links from trx */
- bts->trx[1].rsl_link = rsl_link;
-#endif
+ trx = gsm_bts_trx_num(bts, 1);
+ if (trx) {
+ /* create E1 timeslots for TRAU frames of TRX1 */
+ e1inp_ts_config(&line->ts[4-1], line, E1INP_TS_TYPE_TRAU);
+ e1inp_ts_config(&line->ts[5-1], line, E1INP_TS_TYPE_TRAU);
+
+ /* create RSL signalling link for TRX1 */
+ sign_ts = &line->ts[1-1];
+ rsl_link = e1inp_sign_link_create(sign_ts, E1INP_SIGN_RSL,
+ trx, TEI_RSL+1, SAPI_RSL);
+ /* create back-links from trx */
+ trx->rsl_link = rsl_link;
+
+ /* enable subchannel demuxer on TS2 */
+ subch_demux_activate(&line->ts[4-1].trau.demux, 0);
+ subch_demux_activate(&line->ts[4-1].trau.demux, 1);
+ subch_demux_activate(&line->ts[4-1].trau.demux, 2);
+ subch_demux_activate(&line->ts[4-1].trau.demux, 3);
+
+ /* enable subchannel demuxer on TS3 */
+ subch_demux_activate(&line->ts[5-1].trau.demux, 0);
+ subch_demux_activate(&line->ts[5-1].trau.demux, 1);
+ subch_demux_activate(&line->ts[5-1].trau.demux, 2);
+ subch_demux_activate(&line->ts[5-1].trau.demux, 3);
+ }
return mi_setup(cardnr, line, release_l2);
}