aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/bts.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-06-25 19:16:06 +0200
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-07-01 02:01:22 +0200
commit0e8d68437af4a99dc99d11d4e1f441246bd3ec00 (patch)
tree5f33b62ca5a83636b5a542bd07ddb5ab539168f0 /src/common/bts.c
parentf50b684594335c82aa7cc596f8641a87f7d2963b (diff)
osmo-bts-trx: implement BCCH carrier power reduction mode
The BCCH carrier (sometimes called C0) of a BTS shall maintain discontinuous Downlink transmission at full power in order to stay 'visible' to the mobile stations. Because of that, early versions of 3GPP TS 45.008 prohibited BS power reduction on C0. However, in the recent 3GPP TS 45.008 there is a feature called 'BCCH carrier power reduction operation'. This is a special mode of operation, where the variation of RF level for some timeslots is relaxed for the purpose of energy saving. In BCCH carrier power reduction operation, for timeslots on the C0 carrier, except timeslots carrying BCCH/CCCH, the output power may be lower than the output power used for timeslots carrying BCCH/CCCH. In this case the maximum allowed difference in output power actually transmitted by the BTS is 6 dB. The power reduction operation can be controlled by the BSC by sending BS POWER CONTROL on the A-bis/RSL with the Channel Number IE set to 0x80 (RSL_CHAN_BCCH). This makes osmo-bts reduce the transmission power on inactive timeslots of the BCCH carrier. This is a non-standard, Osmocom specific extension, so indicate support of this feature to the BSC in the feature vector. Also add a VTY command to allow enabling/disabling the power reduction locally. Add some signalling notes to the A-bis/RSL manual. For more details, see 3GPP TS 45.008, section 7.1. Change-Id: I3dcee6e910ccc61c5c63c728db9ea04327e2fc98 Depends: I69283b3f35988fc7a1a1dcf1a1ad3b67f08ec716 Related: SYS#4919
Diffstat (limited to 'src/common/bts.c')
-rw-r--r--src/common/bts.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/common/bts.c b/src/common/bts.c
index 7d5732b3..09d9b88a 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -948,3 +948,58 @@ struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts)
return lchan;
}
+
+/* BCCH carrier power reduction (see 3GPP TS 45.008, section 7.1) */
+int bts_set_c0_pwr_red(struct gsm_bts *bts, const uint8_t red)
+{
+ struct gsm_bts_trx *c0 = bts->c0;
+ unsigned int tn;
+
+ if (!osmo_bts_has_feature(bts->features, BTS_FEAT_BCCH_POWER_RED)) {
+ LOGPTRX(c0, DRSL, LOGL_ERROR, "BCCH carrier power reduction "
+ "is not supported by this BTS model\n");
+ return -ENOTSUP;
+ }
+
+ if (red > 6 || red % 2 != 0) {
+ LOGPTRX(c0, DRSL, LOGL_ERROR, "BCCH carrier power reduction "
+ "value (%u dB) is incorrect or out of range\n", red);
+ return -EINVAL;
+ }
+
+ LOGPTRX(c0, DRSL, LOGL_NOTICE, "BCCH carrier power reduction: "
+ "%u dB (%s)\n", red, red ? "enabled" : "disabled");
+
+ /* Timeslot 0 is always transmitting BCCH/CCCH */
+ c0->ts[0].c0_power_red_db = 0;
+
+ for (tn = 1; tn < ARRAY_SIZE(c0->ts); tn++) {
+ struct gsm_bts_trx_ts *ts = &c0->ts[tn];
+ struct gsm_bts_trx_ts *prev = ts - 1;
+
+ switch (ts_pchan(ts)) {
+ /* Not allowed on CCCH/BCCH */
+ case GSM_PCHAN_CCCH:
+ /* Preceeding timeslot shall not exceed 2 dB */
+ if (prev->c0_power_red_db > 0)
+ prev->c0_power_red_db = 2;
+ /* fall-through */
+ /* Not recommended on SDCCH/8 */
+ case GSM_PCHAN_SDCCH8_SACCH8C:
+ case GSM_PCHAN_SDCCH8_SACCH8C_CBCH:
+ ts->c0_power_red_db = 0;
+ break;
+ default:
+ ts->c0_power_red_db = red;
+ break;
+ }
+ }
+
+ /* Timeslot 7 is always preceding BCCH/CCCH */
+ if (c0->ts[7].c0_power_red_db > 0)
+ c0->ts[7].c0_power_red_db = 2;
+
+ bts->c0_power_red_db = red;
+
+ return 0;
+}