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-litecell15/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-litecell15/l1_if.c')
-rw-r--r-- | src/osmo-bts-litecell15/l1_if.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 395ee0d8..2af24813 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -439,7 +439,7 @@ static int ph_tch_req(struct gsm_bts_trx *trx, struct msgb *msg, struct lc15l1_hdl *fl1 = trx_lc15l1_hdl(trx); struct gsm_lchan *lchan; uint32_t u32Fn; - uint8_t u8Tn, subCh, u8BlockNbr = 0, sapi, ss; + uint8_t u8Tn, subCh, u8BlockNbr = 0, sapi; uint8_t chan_nr; GsmL1_Prim_t *l1p; struct msgb *nmsg = NULL; @@ -449,15 +449,14 @@ static int ph_tch_req(struct gsm_bts_trx *trx, struct msgb *msg, u8Tn = L1SAP_CHAN2TS(chan_nr); u8BlockNbr = (u32Fn % 13) >> 2; if (L1SAP_IS_CHAN_TCHH(chan_nr)) { - ss = subCh = L1SAP_CHAN2SS_TCHH(chan_nr); + subCh = L1SAP_CHAN2SS_TCHH(chan_nr); sapi = GsmL1_Sapi_TchH; } else { subCh = 0x1f; - ss = 0; sapi = GsmL1_Sapi_TchF; } - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); /* create new message and fill data */ if (msg) { @@ -509,7 +508,6 @@ static int mph_info_req(struct gsm_bts_trx *trx, struct msgb *msg, struct osmo_phsap_prim *l1sap) { struct lc15l1_hdl *fl1 = trx_lc15l1_hdl(trx); - uint8_t u8Tn, ss; uint8_t chan_nr; struct gsm_lchan *lchan; int rc = 0; @@ -517,9 +515,7 @@ static int mph_info_req(struct gsm_bts_trx *trx, struct msgb *msg, switch (l1sap->u.info.type) { case PRIM_INFO_ACT_CIPH: chan_nr = l1sap->u.info.u.ciph_req.chan_nr; - u8Tn = L1SAP_CHAN2TS(chan_nr); - ss = l1sap_chan2ss(chan_nr); - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.u.ciph_req.uplink) { l1if_set_ciphering(fl1, lchan, 0); lchan->ciph_state = LCHAN_CIPH_RX_REQ; @@ -536,9 +532,7 @@ static int mph_info_req(struct gsm_bts_trx *trx, struct msgb *msg, case PRIM_INFO_DEACTIVATE: case PRIM_INFO_MODIFY: chan_nr = l1sap->u.info.u.act_req.chan_nr; - u8Tn = L1SAP_CHAN2TS(chan_nr); - ss = l1sap_chan2ss(chan_nr); - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) l1if_rsl_chan_act(lchan); else if (l1sap->u.info.type == PRIM_INFO_MODIFY) { |