aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/bts.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/bts.c')
-rw-r--r--src/common/bts.c75
1 files changed, 10 insertions, 65 deletions
diff --git a/src/common/bts.c b/src/common/bts.c
index 27c7f74c..86140ba0 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -128,7 +128,7 @@ static const struct rate_ctr_group_desc cbch_ctrg_desc = {
cbch_ctr_desc
};
-static struct osmo_tdef bts_T_defs[] = {
+struct osmo_tdef bts_T_defs[] = {
/* T-1: FIXME: Ideally should be dynamically calculated per trx at
* shutdown start based on params below, and highest trx value taken:
* + VTY's power-ramp step-interval.
@@ -143,6 +143,11 @@ static struct osmo_tdef bts_T_defs[] = {
{}
};
+struct osmo_tdef abis_T_defs[] = {
+ { .T=-15, .default_val=0, .unit=OSMO_TDEF_MS, .desc="Time to wait between Channel Activation and dispatching a cached early Immediate Assignment" },
+ {}
+};
+
static const uint8_t bts_nse_timer_default[] = { 3, 3, 3, 3, 30, 3, 10 };
static const uint8_t bts_cell_timer_default[] =
{ 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 };
@@ -234,6 +239,7 @@ struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num)
bts->T_defs = bts_T_defs;
osmo_tdefs_reset(bts->T_defs);
+ osmo_tdefs_reset(abis_T_defs);
bts->shutdown_fi = osmo_fsm_inst_alloc(&bts_shutdown_fsm, bts, bts,
LOGL_INFO, NULL);
osmo_fsm_inst_update_id_f(bts->shutdown_fi, "bts%d", bts->nr);
@@ -334,12 +340,11 @@ int bts_init(struct gsm_bts *bts)
bts->rtp_priority = -1;
/* Default (fall-back) MS/BS Power control parameters */
- bts->bs_dpc_params = power_ctrl_params_def;
- bts->ms_dpc_params = power_ctrl_params_def;
+ power_ctrl_params_def_reset(&bts->bs_dpc_params, true);
+ power_ctrl_params_def_reset(&bts->ms_dpc_params, false);
/* configurable via OML */
bts->load.ccch.load_ind_period = 112;
- load_timer_start(bts);
bts->rtp_jitter_buf_ms = 100;
bts->max_ta = 63;
bts->ny1 = 4;
@@ -401,7 +406,7 @@ int bts_init(struct gsm_bts *bts)
bts->smscb_queue_tgt_len = 2;
bts->smscb_queue_hyst = 2;
- INIT_LLIST_HEAD(&bts->oml_queue);
+ INIT_LLIST_HEAD(&bts->bsc_oml_hosts);
/* register DTX DL FSM */
rc = osmo_fsm_register(&dtx_dl_amr_fsm);
@@ -449,66 +454,6 @@ int bts_link_estab(struct gsm_bts *bts)
return bts_model_oml_estab(bts);
}
-/* prepare the per-SAPI T200 arrays for a given lchan */
-static int t200_by_lchan(int *t200_ms_dcch, int *t200_ms_acch, struct gsm_lchan *lchan)
-{
- struct gsm_bts *bts = lchan->ts->trx->bts;
-
- /* we have to compensate for the "RTS advance" due to the asynchronous interface between
- * the BTS (LAPDm) and the PHY/L1 (OsmoTRX or DSP in case of osmo-bts-{sysmo,lc15,oc2g,octphy} */
- int32_t fn_advance = bts_get_avg_fn_advance(bts);
- int32_t fn_advance_us = fn_advance * 4615;
- int fn_advance_ms = fn_advance_us / 1000;
-
- t200_ms_acch[DL_SAPI0] = bts->t200_ms[T200_SACCH_SDCCH] + fn_advance_ms;
- t200_ms_acch[DL_SAPI3] = bts->t200_ms[T200_SACCH_SDCCH] + fn_advance_ms;
-
- if (lchan->repeated_acch_capability.dl_facch_all && (lchan->type == GSM_LCHAN_TCH_F || lchan->type == GSM_LCHAN_TCH_H)) {
- t200_ms_acch[DL_SAPI0] *= 2;
- t200_ms_acch[DL_SAPI3] *= 2;
- }
-
- switch (lchan->type) {
- case GSM_LCHAN_SDCCH:
- t200_ms_dcch[DL_SAPI0] = bts->t200_ms[T200_SDCCH] + fn_advance_ms;
- t200_ms_dcch[DL_SAPI3] = bts->t200_ms[T200_SDCCH_SAPI3] + fn_advance_ms;
- break;
- case GSM_LCHAN_TCH_F:
- t200_ms_dcch[DL_SAPI0] = bts->t200_ms[T200_FACCH_F] + fn_advance_ms;
- t200_ms_dcch[DL_SAPI3] = bts->t200_ms[T200_FACCH_F] + fn_advance_ms;
- break;
- case GSM_LCHAN_TCH_H:
- t200_ms_dcch[DL_SAPI0] = bts->t200_ms[T200_FACCH_H] + fn_advance_ms;
- t200_ms_dcch[DL_SAPI3] = bts->t200_ms[T200_FACCH_H] + fn_advance_ms;
- break;
- default:
- /* Channels such as CCCH don't use lapdm DL, and hence no T200 is needed */
- return -1;
- }
- return 0;
-}
-
-int lchan_init_lapdm(struct gsm_lchan *lchan)
-{
- struct lapdm_channel *lc = &lchan->lapdm_ch;
- int t200_ms_dcch[_NR_DL_SAPI], t200_ms_acch[_NR_DL_SAPI];
-
- if (t200_by_lchan(t200_ms_dcch, t200_ms_acch, lchan) == 0) {
- LOGPLCHAN(lchan, DLLAPD, LOGL_DEBUG,
- "Setting T200 D0=%u, D3=%u, S0=%u, S3=%u (all in ms)\n",
- t200_ms_dcch[DL_SAPI0], t200_ms_dcch[DL_SAPI3],
- t200_ms_acch[DL_SAPI0], t200_ms_acch[DL_SAPI3]);
- lapdm_channel_init3(lc, LAPDM_MODE_BTS, t200_ms_dcch, t200_ms_acch, lchan->type,
- gsm_lchan_name(lchan));
- lapdm_channel_set_flags(lc, LAPDM_ENT_F_POLLING_ONLY);
- lapdm_channel_set_l1(lc, NULL, lchan);
- }
- /* We still need to set Rx callback to receive RACH requests: */
- lapdm_channel_set_l3(lc, lapdm_rll_tx_cb, lchan);
-
- return 0;
-}
-
#define CCCH_RACH_RATIO_COMBINED256 (256*1/9)
#define CCCH_RACH_RATIO_SEPARATE256 (256*10/55)