aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-10-05 00:06:39 +0600
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-10-08 16:54:20 +0600
commit605cb85afd9b72d6e1ba9dcc0a136dae58990052 (patch)
tree9d456c837d070e1ac318abf65b7e6dcf65e245c6 /src/osmo-bts-trx
parent187e099c3ba7f6bbd663c528bd2e1391cbfb5f2b (diff)
osmo-bts-trx: report PDCH interference levels to L1SAP
Starting from [1], interference levels on PDCH timeslots are also reported over the A-bis/RSL. They may be useful for the BSC to determine whether dynamic PDCH timeslots might be better used for new circuit switched connections, or whether alternative PDCH slots should be allocated for interference reasons. * Handle GSM_LCHAN_PDTCH in lchan_report_interf_meas(). * Rework pcu_tx_interf_ind() to accept 'struct gsm_bts_trx'. * Call pcu_tx_interf_ind() from l1sap_interf_meas_report(). Regarding pcu_tx_interf_ind(), it's better to call this function from the upper layers once, rather than calling it from various places in the model specific code. [1] I5b4d1da0920e788ac8063cc765fe5b0223c76758 Change-Id: I3fbaad5dbc3bbd305b3ad4cb4bfb431a42cfbffc Related: SYS#5313
Diffstat (limited to 'src/osmo-bts-trx')
-rw-r--r--src/osmo-bts-trx/scheduler_trx.c103
1 files changed, 44 insertions, 59 deletions
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 0a907fba..6136b141 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -54,84 +54,69 @@
#define SCHED_FH_PARAMS_VALS(ts) \
(ts)->hopping.hsn, (ts)->hopping.maio, (ts)->hopping.arfcn_num
-static void ts_report_interf_meas(const struct gsm_bts_trx_ts *ts)
+static void lchan_report_interf_meas(const struct gsm_lchan *lchan)
{
+ const struct gsm_bts_trx_ts *ts = lchan->ts;
const struct l1sched_ts *l1ts = ts->priv;
- unsigned int ln;
+ enum trx_chan_type dcch, acch;
+ int interf_avg;
- for (ln = 0; ln < ARRAY_SIZE(ts->lchan); ln++) {
- const struct gsm_lchan *lchan = &ts->lchan[ln];
- enum trx_chan_type dcch, acch;
- int interf_avg;
-
- /* We're not interested in active channels */
- if (lchan->state == LCHAN_S_ACTIVE)
- continue;
+ /* We're not interested in active CS channels */
+ if (lchan->state == LCHAN_S_ACTIVE) {
+ if (lchan->type != GSM_LCHAN_PDTCH)
+ return;
+ }
- switch (lchan->type) {
- case GSM_LCHAN_SDCCH:
- if (ts->pchan == GSM_PCHAN_CCCH_SDCCH4 ||
- ts->pchan == GSM_PCHAN_CCCH_SDCCH4_CBCH) {
- dcch = TRXC_SDCCH4_0 + ln;
- acch = TRXC_SACCH4_0 + ln;
- } else { /* SDCCH/8 otherwise */
- dcch = TRXC_SDCCH8_0 + ln;
- acch = TRXC_SACCH8_0 + ln;
- }
- break;
- case GSM_LCHAN_TCH_F:
- dcch = TRXC_TCHF;
- acch = TRXC_SACCHTF;
- break;
- case GSM_LCHAN_TCH_H:
- dcch = TRXC_TCHH_0 + ln;
- acch = TRXC_SACCHTH_0 + ln;
- break;
- default:
- /* Skip other lchan types */
- continue;
+ switch (lchan->type) {
+ case GSM_LCHAN_SDCCH:
+ if (ts->pchan == GSM_PCHAN_CCCH_SDCCH4 ||
+ ts->pchan == GSM_PCHAN_CCCH_SDCCH4_CBCH) {
+ dcch = TRXC_SDCCH4_0 + lchan->nr;
+ acch = TRXC_SACCH4_0 + lchan->nr;
+ } else { /* SDCCH/8 otherwise */
+ dcch = TRXC_SDCCH8_0 + lchan->nr;
+ acch = TRXC_SACCH8_0 + lchan->nr;
}
+ break;
+ case GSM_LCHAN_TCH_F:
+ dcch = TRXC_TCHF;
+ acch = TRXC_SACCHTF;
+ break;
+ case GSM_LCHAN_TCH_H:
+ dcch = TRXC_TCHH_0 + lchan->nr;
+ acch = TRXC_SACCHTH_0 + lchan->nr;
+ break;
+ case GSM_LCHAN_PDTCH:
+ /* We use idle TDMA frames on PDCH */
+ dcch = TRXC_IDLE;
+ acch = TRXC_IDLE;
+ break;
+ default:
+ /* Skip other lchan types */
+ return;
+ }
- OSMO_ASSERT(dcch < ARRAY_SIZE(l1ts->chan_state));
- OSMO_ASSERT(acch < ARRAY_SIZE(l1ts->chan_state));
+ OSMO_ASSERT(dcch < ARRAY_SIZE(l1ts->chan_state));
+ OSMO_ASSERT(acch < ARRAY_SIZE(l1ts->chan_state));
- interf_avg = (l1ts->chan_state[dcch].meas.interf_avg +
- l1ts->chan_state[acch].meas.interf_avg) / 2;
+ interf_avg = (l1ts->chan_state[dcch].meas.interf_avg +
+ l1ts->chan_state[acch].meas.interf_avg) / 2;
- gsm_lchan_interf_meas_push((struct gsm_lchan *) lchan, interf_avg);
- }
+ gsm_lchan_interf_meas_push((struct gsm_lchan *) lchan, interf_avg);
}
static void bts_report_interf_meas(const struct gsm_bts *bts,
const uint32_t fn)
{
const struct gsm_bts_trx *trx;
+ unsigned int tn, ln;
llist_for_each_entry(trx, &bts->trx_list, list) {
- uint8_t pdch_interf[8] = { 0 };
- unsigned int tn, pdch_num = 0;
-
for (tn = 0; tn < ARRAY_SIZE(trx->ts); tn++) {
const struct gsm_bts_trx_ts *ts = &trx->ts[tn];
- const struct l1sched_ts *l1ts = ts->priv;
- const struct l1sched_chan_state *l1cs;
-
- /* PS interference reports for the PCU */
- if (ts_pchan(ts) == GSM_PCHAN_PDCH) {
- l1cs = &l1ts->chan_state[TRXC_IDLE];
- /* Interference value is encoded as -x dBm */
- pdch_interf[tn] = -1 * l1cs->meas.interf_avg;
- pdch_num++;
- continue;
- }
-
- /* CS interference reports for the BSC */
- ts_report_interf_meas(ts);
+ for (ln = 0; ln < ARRAY_SIZE(ts->lchan); ln++)
+ lchan_report_interf_meas(&ts->lchan[ln]);
}
-
- /* Report interference levels on PDCH to the PCU */
- if (pdch_num > 0)
- pcu_tx_interf_ind(bts->nr, trx->nr, fn, pdch_interf);
}
}