diff options
author | Max <msuraev@sysmocom.de> | 2016-06-23 15:39:31 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-06-23 20:00:44 +0000 |
commit | 5c0d88e69d16426d8e7af5bf4b7866aa33132064 (patch) | |
tree | fbaecee280b714d79e394e1d8b75da8a73d6a441 /src/osmo-bts-trx/l1_if.c | |
parent | 4fa641d7b22116c7b1af0bf80ebe6ab78a06cee9 (diff) |
Make get_lchan_by_chan_nr globally available
* Remove static qualifier
* Remove duplicated code - use generic function instead
Change-Id: I37a312648771f58d3087471083cfcebbd97ccf1d
Diffstat (limited to 'src/osmo-bts-trx/l1_if.c')
-rw-r--r-- | src/osmo-bts-trx/l1_if.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index 59442d99..0a3e48dc 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -527,7 +527,6 @@ int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) struct trx_l1h *l1h = pinst->u.osmotrx.hdl; struct msgb *msg = l1sap->oph.msg; uint8_t chan_nr; - uint8_t tn, ss; int rc = 0; struct gsm_lchan *lchan; @@ -546,9 +545,7 @@ int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) switch (l1sap->u.info.type) { case PRIM_INFO_ACT_CIPH: chan_nr = l1sap->u.info.u.ciph_req.chan_nr; - tn = L1SAP_CHAN2TS(chan_nr); - ss = l1sap_chan2ss(chan_nr); - lchan = &trx->ts[tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.u.ciph_req.uplink) l1if_set_ciphering(l1h, lchan, chan_nr, 0); if (l1sap->u.info.u.ciph_req.downlink) @@ -558,9 +555,7 @@ int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) case PRIM_INFO_DEACTIVATE: case PRIM_INFO_MODIFY: chan_nr = l1sap->u.info.u.act_req.chan_nr; - tn = L1SAP_CHAN2TS(chan_nr); - ss = l1sap_chan2ss(chan_nr); - lchan = &trx->ts[tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) { if ((chan_nr & 0x80)) { LOGP(DL1C, LOGL_ERROR, "Cannot activate" |