Replace magic number with define
SDCCH occupy lchan 0..3 in combined configuration so for CCCH we've always used lchan[4] - replace it with CCCH_LCHAN define and add comment. Change-Id: Ic5d742c292d638f119c6b4672120c1950adeb7f0
This commit is contained in:
parent
b0c1d21581
commit
ebb483b69a
|
@ -8,6 +8,9 @@
|
|||
#include <osmo-bts/paging.h>
|
||||
#include <osmo-bts/tx_power.h>
|
||||
|
||||
/* lchans 0..3 are SDCCH in combined channel configuration: */
|
||||
#define CCCH_LCHAN 4
|
||||
|
||||
#define GSM_FR_BITS 260
|
||||
#define GSM_EFR_BITS 244
|
||||
|
||||
|
|
|
@ -947,7 +947,7 @@ static int l1sap_ph_rach_ind(struct gsm_bts_trx *trx,
|
|||
|
||||
DEBUGP(DL1P, "Rx PH-RA.ind");
|
||||
|
||||
lc = &trx->ts[0].lchan[4].lapdm_ch;
|
||||
lc = &trx->ts[0].lchan[CCCH_LCHAN].lapdm_ch;
|
||||
|
||||
/* check for under/overflow / sign */
|
||||
if (!check_acc_delay(rach_ind, btsb, &acc_delay)) {
|
||||
|
|
|
@ -727,7 +727,7 @@ int conf_lchans_as_pchan(struct gsm_bts_trx_ts *ts,
|
|||
}
|
||||
/* fallthrough */
|
||||
case GSM_PCHAN_CCCH:
|
||||
lchan = &ts->lchan[4];
|
||||
lchan = &ts->lchan[CCCH_LCHAN];
|
||||
lchan->type = GSM_LCHAN_CCCH;
|
||||
break;
|
||||
case GSM_PCHAN_TCH_F:
|
||||
|
|
|
@ -287,8 +287,9 @@ static int opstart_compl(struct gsm_abis_mo *mo, struct msgb *l1_msg)
|
|||
mo->obj_inst.ts_nr == 0) {
|
||||
struct gsm_lchan *cbch = gsm_bts_get_cbch(mo->bts);
|
||||
DEBUGP(DL1C, "====> trying to activate lchans of BCCH\n");
|
||||
mo->bts->c0->ts[0].lchan[4].rel_act_kind = LCHAN_REL_ACT_OML;
|
||||
lchan_activate(&mo->bts->c0->ts[0].lchan[4]);
|
||||
mo->bts->c0->ts[0].lchan[CCCH_LCHAN].rel_act_kind =
|
||||
LCHAN_REL_ACT_OML;
|
||||
lchan_activate(&mo->bts->c0->ts[0].lchan[CCCH_LCHAN]);
|
||||
if (cbch) {
|
||||
cbch->rel_act_kind = LCHAN_REL_ACT_OML;
|
||||
lchan_activate(cbch);
|
||||
|
|
|
@ -183,8 +183,9 @@ static int opstart_compl(struct gsm_abis_mo *mo)
|
|||
if (mo->obj_class == NM_OC_CHANNEL && mo->obj_inst.trx_nr == 0 &&
|
||||
mo->obj_inst.ts_nr == 0) {
|
||||
struct gsm_lchan *cbch = gsm_bts_get_cbch(mo->bts);
|
||||
mo->bts->c0->ts[0].lchan[4].rel_act_kind = LCHAN_REL_ACT_OML;
|
||||
lchan_activate(&mo->bts->c0->ts[0].lchan[4]);
|
||||
mo->bts->c0->ts[0].lchan[CCCH_LCHAN].rel_act_kind =
|
||||
LCHAN_REL_ACT_OML;
|
||||
lchan_activate(&mo->bts->c0->ts[0].lchan[CCCH_LCHAN]);
|
||||
if (cbch) {
|
||||
cbch->rel_act_kind = LCHAN_REL_ACT_OML;
|
||||
lchan_activate(cbch);
|
||||
|
|
|
@ -286,8 +286,9 @@ static int opstart_compl(struct gsm_abis_mo *mo, struct msgb *l1_msg)
|
|||
mo->obj_inst.ts_nr == 0) {
|
||||
struct gsm_lchan *cbch = gsm_bts_get_cbch(mo->bts);
|
||||
DEBUGP(DL1C, "====> trying to activate lchans of BCCH\n");
|
||||
mo->bts->c0->ts[0].lchan[4].rel_act_kind = LCHAN_REL_ACT_OML;
|
||||
lchan_activate(&mo->bts->c0->ts[0].lchan[4]);
|
||||
mo->bts->c0->ts[0].lchan[CCCH_LCHAN].rel_act_kind =
|
||||
LCHAN_REL_ACT_OML;
|
||||
lchan_activate(&mo->bts->c0->ts[0].lchan[CCCH_LCHAN]);
|
||||
if (cbch) {
|
||||
cbch->rel_act_kind = LCHAN_REL_ACT_OML;
|
||||
lchan_activate(cbch);
|
||||
|
|
|
@ -267,7 +267,7 @@ static int trx_init(struct gsm_bts_trx *trx)
|
|||
}
|
||||
|
||||
if (trx == trx->bts->c0)
|
||||
lchan_init_lapdm(&trx->ts[0].lchan[4]);
|
||||
lchan_init_lapdm(&trx->ts[0].lchan[CCCH_LCHAN]);
|
||||
|
||||
/* Set to Operational State: Enabled */
|
||||
oml_mo_state_chg(&trx->mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK);
|
||||
|
@ -288,7 +288,7 @@ int bts_model_trx_close(struct gsm_bts_trx *trx)
|
|||
|
||||
/* deactivate lchan for CCCH */
|
||||
if (pchan == GSM_PCHAN_CCCH || pchan == GSM_PCHAN_CCCH_SDCCH4) {
|
||||
lchan_set_state(&trx->ts[0].lchan[4], LCHAN_S_INACTIVE);
|
||||
lchan_set_state(&trx->ts[0].lchan[CCCH_LCHAN], LCHAN_S_INACTIVE);
|
||||
}
|
||||
|
||||
/* power off transceiver, if not already */
|
||||
|
@ -408,8 +408,8 @@ static uint8_t trx_set_ts_as_pchan(struct gsm_bts_trx_ts *ts,
|
|||
|
||||
/* activate lchan for CCCH */
|
||||
if (pchan == GSM_PCHAN_CCCH || pchan == GSM_PCHAN_CCCH_SDCCH4) {
|
||||
ts->lchan[4].rel_act_kind = LCHAN_REL_ACT_OML;
|
||||
lchan_set_state(&ts->lchan[4], LCHAN_S_ACTIVE);
|
||||
ts->lchan[CCCH_LCHAN].rel_act_kind = LCHAN_REL_ACT_OML;
|
||||
lchan_set_state(&ts->lchan[CCCH_LCHAN], LCHAN_S_ACTIVE);
|
||||
}
|
||||
|
||||
slottype = transceiver_chan_types[pchan];
|
||||
|
|
Loading…
Reference in New Issue