Commit Graph

2650 Commits

Author SHA1 Message Date
Neels Hofmeyr be06aad8cc add timers.vty test
Change-Id: I3df99909d754cf513b5c909d626055b205b02f83
2021-08-16 17:06:09 +00:00
Neels Hofmeyr b25aa7e8d8 add VTY transcript testing
Change-Id: I730daf548a3a9bb116aa8b6d5772ca9af0ada08f
2021-08-16 17:05:51 +00:00
Philipp Maier 6611e7f305 allow to configure multiple oml remote-ip addresses
At the moment we can only configure a single BSC in the BTS
configuration. This also means that if this single BSC fails for some
reason the BTS has no alternate BSC to connect to. Lets extend the
remote-ip parameter so that it can be used multiple times so that an
operater can configure any number of BSCs that are tried one after
another during BTS startup.

Change-Id: I205f68a3a7f35fee4c38a7cfba2b014237df2727
Related: SYS#4971
2021-07-19 10:39:06 +02:00
Pau Espin ace4e500ed Make gcc 11.1.0 false positivies happy
Make gcc 11.1.0 false positivies happy

After my system's gcc was upgraded, I get false positivies in a couple
places. Let's initialize those to make gcc happy.

"""
//git/osmo-bts/src/common/vty.c: In function ‘lchan_summary’:
//git/osmo-bts/src/common/vty.c:1881:23: error: ‘ts’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
 1881 |                 lchan = &ts->lchan[lchan_nr];
      |                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~
//git/osmo-bts/src/common/vty.c:1869:20: error: ‘trx’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
 1869 |                 ts = &trx->ts[ts_nr];
      |                 ~~~^~~~~~~~~~~~~~~~~
//git/osmo-bts/src/common/vty.c:1852:34: error: ‘bts’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
 1852 |                 if (trx_nr >= bts->num_trx) {
"""

Change-Id: I93477142a5a4b3f3829b7398d6e564c127263596
2021-07-15 13:51:38 +02:00
Philipp Maier dda5cf4bb7 paging: prioritize CS related paging over PS related pagings.
When the paging queue is filled up to a critical level, pagings from the
PCU should be dropped as each immediate assignment paging from the PCU
is worth 4 normal CS pagings. Also the PCU may still issue pagings if the
paginging queue is already full and CS pagings are dropped. In a
congestion situation it is more important to get the CS rather than PS
pagings through.

Change-Id: I30f97672d7a0c369c4a656e878ab8cbbd83e31ea
Related: SYS#5306
2021-07-06 11:35:50 +02:00
Vadim Yanitskiy a5602d593c gsm_lchan_interf_meas_calc_band(): also print number of AVG samples
Change-Id: I4cebb0c5eef16f7e20fce85c506fc271127d7259
2021-07-05 12:07:55 +00:00
Vadim Yanitskiy 454a2516f2 rsl: use tlvp_val16be() in rsl_rx_ipac_XXcx()
Instead of using tlvp_val16_unal() and then doing ntohs() here
and there, convert the remote port to the host byte order once.

Change-Id: Id883a976a03fd3022ed9d66f703b01244df2d9db
2021-07-05 12:07:55 +00:00
Vadim Yanitskiy 471df615e2 manuals/abis/rsl.adoc: clarify RF Resource Indication conformance
Change-Id: Ia582c55c3c20f1f91993b3113d77ef2f34ca2eda
Related: SYS#5313, OS#1569
2021-07-05 12:07:55 +00:00
Pau Espin ae783bcb0e Support SDCCH8 in osmo dyn ts
Change-Id: Id541dee6c224d2b8d97c07b916085883354cecbc
2021-07-05 08:03:08 +00:00
Pau Espin a4b9073989 Rename osmo dyn ts enums to contain SDCCH8
They will gain support to be activated as SDCCH/8 soon too.

Related: SYS#5309
Depends: libosmocore.git I56dcfe4d17899630b17f80145c3ced72f1e91e68
Change-Id: Ia617d20fc52f09dbab8f4516c06fa1efac08e898
2021-07-05 08:03:08 +00:00
Vadim Yanitskiy 30aea88c2c power_control: constrain BS power reduction on BCCH carrier
BS Power Control is not allowed on the BCCH/CCCH carrier, unless
the BTS is operating in the BCCH carrier power reduction mode.

Allow constrained BS power reduction (up to 6 dB) on active logical
channels iff BCCH carrier power reduction mode is enabled.

Change-Id: I3299b6cdd230d3767321c3d6c64d468b7f5e1d02
Related: SYS#4919, SYS#4918
2021-07-01 02:01:22 +02:00
Vadim Yanitskiy 0e8d68437a 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
2021-07-01 02:01:22 +02:00
Vadim Yanitskiy f50b684594 osmo-bts-omldummy: indicate BTS_FEAT_BCCH_POWER_RED as supported
This is required for ttcn3-bsc-test, see change [1].

Change-Id: I765d5e38cb0746e0458773abf3717ee9bf1cb7d1
Related: [1] I084f7736cd7d09b68ed49f8ba52a14de928d4c01
Related: SYS#4919
2021-06-30 23:45:12 +02:00
Vadim Yanitskiy c3b3ca358a Revert "power_control: BS power shall not be reduced on C0"
This reverts commit cd30a40be1.

As a part of SYS#4919 "BTS energy saving", we want to support
constrained (up to 6 dB) BS power control on BCCH carriers.

Change-Id: I0d2b48c4b2af2d8e94f4ad02fa4774dbd0a0a654
Related: SYS#4919
2021-06-30 23:45:12 +02:00
Pau Espin 8bf5cbea49 Support forwarding proto IPAC_PROTO_EXT_PCU BSC<->PCU
This new extension protocol is used to forward Osmocom PCUIF messages
BSC<->BTS<->PCU.
It will be sent re-using the IPA multiplex of the OML link between
BSC and BTS. BTS is responsible for forwarding the message over the unix
socket to the PCU.

PCUIF existing RX path needs to be reworked in order to accept
variable-size messages, in order to be able to transparently forward
messages without knowing about them (the new container message is
variable-length).

Related: SYS#5303
Change-Id: I73fdb17107494ade9263a62d1f729e67303fce87
2021-06-30 08:13:21 +00:00
Pau Espin 80ce85295b pcuif_proto.h: Add new container messages
Related: SYS#5303
Change-Id: I8deef11f9ec191475c99133629cd5cd9048c4bcb
2021-06-30 08:13:21 +00:00
Pau Espin 1fe9a89308 gsm_data: Drop unused function gsm_pchan_parse()
Change-Id: I8f49811c1b694c5ef1fb9178d5ff4558172089b0
2021-06-29 16:09:15 +02:00
Pau Espin b53a84ac75 doc: rsl.adoc: Fix trailing whitespace
Change-Id: Ibc93a87ad51c77fff08ecc54dcc01784756fb39f
2021-06-29 12:13:59 +02:00
Eric Wild 4d845ccbb6 osmo-bts-trx: indicate A5/4 support, handle Kc128
Change-Id: Ib8e04fe79f30b443a54c38f395a7a3626ff97c45
Related: SYS#5324
2021-06-23 21:59:31 +02:00
Vadim Yanitskiy f1bdf605b5 scheduler: fix: use ts_pchan() in trx_sched_set_cipher()
Properly handle dynamic timeslots, do not access 'pchan' directly.

Change-Id: Iccb8794253face54164af1ba344204eadab8f98b
Fixes: [1] I7c4379e43a25e9d858d582a99bf6c4b65c9af481
2021-06-22 19:03:47 +02:00
Vadim Yanitskiy a6af31cd44 scheduler: fix wrong union field in trx_sched_tch_req()
I introduced this regression in [1] during a massive refactoring.
Basically, I copy-pasted a chunk from trx_sched_ph_data_req(), but
forgot to change the union field.  This broke voice calls, because
all TCH.req primitives would be enqueued to wrong timeslot.

Change-Id: If841e6ac40a3c6344c304ab970755d6a2d292156
Fixes: [1] I7c4379e43a25e9d858d582a99bf6c4b65c9af481
2021-06-22 18:59:16 +02:00
Vadim Yanitskiy f47fa70b9f osmo-bts-trx: report PDCH interference levels to the PCU
The PDCH multiframe contains 48 data slots, 2 PTCCH slots, and
2 IDLE slots.  The later two can be used for the interference
measurements, since the UEs shall not transmit on them.

bts_report_interf_meas() is called every 104 TDMA frames, what
corresponds to 2 PDCH multiframe periods.  Report interference
levels on PDCH timeslots from this function.

Change-Id: I56f83db5264c246ec1b4b8a973105a4fc09931fb
Related: SYS#5313, OS#1569
2021-06-18 18:56:57 +02:00
Vadim Yanitskiy 54d0931330 osmo-bts-trx: measure interference levels on TRXC_IDLE
We already do the intereference measurements on inactive logical
channels.  For the active channels we can still use the IDLE
slots, on which the UEs shall not transmit Uplink bursts.

Change-Id: Ic3030dba5eb223177298aa4e43559a93dc3d1392
Related: SYS#5313, OS#1569
2021-06-18 18:56:57 +02:00
Vadim Yanitskiy c126870c5f osmo-bts-trx: print timeslot brief info in 'show transceiver'
Change-Id: Ibe624e4b801cae2dc00feb99441b7d606005b846
2021-06-18 18:56:57 +02:00
Vadim Yanitskiy 8a1a74e6ca scheduler: unset TRX_CHAN_FLAG_AUTO_ACTIVE for TRXC_IDLE
Neither we expect any Uplink bursts on IDLE channels, nor we need
to send any Downlink bursts.  Automatic activation of TRXC_IDLE
channels does not make sense.

Change-Id: Ifade0eab0605154196322ff20b1b3a44495f8a2e
2021-06-18 18:56:57 +02:00
Vadim Yanitskiy dded16c4c9 osmo-bts-{trx,virtual}: get rid of dummy tx_idle_fn()
This logical channel handler does nothing more than just logging.

Change-Id: I438705f8dd902193e6c7b499d8ee55c56b6a1c2e
2021-06-18 18:56:57 +02:00
Vadim Yanitskiy 6fd4f77243 osmo-bts-trx: report interference levels to the upper layers
In trx_sched_ul_burst(), treat all BURST.ind and NOPE.ind mapped
to inactive logical channels as interference.  Average the RSSI
values on the fly using a sliding average with constant a=0.5.

Report averaged values for each logical channel every 104 TDMA
frames (SACCH period) by calling gsm_lchan_interf_meas_push().

Change-Id: I4686448e42a40df56c1d27a14fd0a4d43fd144a5
Related: I78b6d8beffa5228a28231b75728e7aebdd3cb23c
Related: SYS#5313, OS#1569
2021-06-18 18:56:57 +02:00
Vadim Yanitskiy a484742793 scheduler: reorder enum trx_chan_type, add TRX_CHAN_IS_DEDIC()
With the new ordering, all TRXC_* values starting from TRXC_TCHF
belong to dedicated channels.  This is useful for the interference
reporting logic, where we're not interested in broadcast channels.

Change-Id: I7148f4d0bd1abbfe309bc5477e32a56d884533ea
Related: SYS#5313, OS#1569
2021-06-18 18:56:57 +02:00
Vadim Yanitskiy d4efc3f9c5 Report interference levels in RSL RF RESource INDication
This change implements general interference averaging logic for
the higher layers.  In l1sap_info_time_ind(), where we receive
TDMA time updates from BTS model, call rsl_tx_rf_res() for each
transceiver according to the interval defined by the Intave
parameter received from the BSC.  In rsl_tx_rf_res() perform
the actual averaging for each inactive logical channel, and
then send everything to the BSC over the A-bis/RSL.

The BTS model specific code needs to report the measurements
for each logical channel every 104 TDMA frames (SACCH period)
by calling gsm_lchan_interf_meas_push().

Change-Id: Id80fdbef087de625149755165c025c0a9563dc85
Related: SYS#5313, OS#1569
2021-06-18 18:56:57 +02:00
Vadim Yanitskiy 64e1c1222e oml: fix handling of NM_ATT_INTERF_BOUND attribute
Looks like this part of the code has never been tested.  The old
code would dereference the same value in the loop and assign it
to all members in array 'bts->interference.boundary'.

Change-Id: I7f83d8e6eb6cc19e3e9529ba06617a902de23e35
Related: SYS#5313, OS#1569
2021-06-18 18:56:57 +02:00
Vadim Yanitskiy 4e8d4d5bb8 osmo-bts-trx: fix copy-pasted comment: s/sysmoBTS/osmo-bts-trx/
Change-Id: If796a8d55f1ad0642e5a81689161c7e7b70f4b5e
2021-06-18 16:48:36 +00:00
Vadim Yanitskiy a556c49114 osmo-bts-trx: fix typo: s/bisc/bsic/ in 'show transceiver'
Change-Id: I39c6138e950ca7d3cda9c52d4e1cdaa218624641
2021-06-18 18:40:53 +02:00
Pau Espin b04ffc11fb pcu_sock: Transmit SI2
OsmoPCU will need this SI2 in order to gain knowledge of the BCCH
Frequency List being broadcasted, in order to build a per-MS specific
Neighbour List using NC_FREQUENCY_LIST bits in Packet Measurement Order.

Related: SYS#5303
Change-Id: If70c64f941f621a9a68aef2c846639b5c7f2f74b
2021-06-11 23:19:59 +02:00
Vadim Yanitskiy ef4a6a0f43 l1sap: fix TDMA frame number arithmetic in fn_ms_adj()
Using the normal arithmetic for TDMA frame numbers is wrong.

Change-Id: Ie17670d150489014a4a2e140cede42086100bbc0
2021-06-10 21:50:48 +00:00
Vadim Yanitskiy 4590b099bf osmo-bts-octphy: drop talloc_replace(), use osmo_talloc_replace_string()
Change-Id: Ied39cc594fedc712d751ab1c7b636bbbff527bd6
2021-06-10 21:50:48 +00:00
Pau Espin 52f6fc5aab rsl: Use switch statement in rsl_rx_bcch_info()
This is a preparation for new commit, which makes it easier to add new
SIs being sent.

Change-Id: I27774ca36d1e740b6a502cfb280aba0ea82b9dbe
2021-06-10 12:58:18 +00:00
Vadim Yanitskiy 5acd0102e4 vty: ensure all warning messages are prefixed with '%%'
Change-Id: I23fc1cd8aa5725de06651f061c9fce6a022adfa8
2021-06-10 11:53:24 +00:00
Vadim Yanitskiy 85c2d641d5 common/vty: facilitate finding duplicate PHY/TRX associations
In cfg_trx_phy_cmd(), use phy_instance_link_to_trx() and ensure
that a PHY instance can be bound to a transceiver only once.

Change-Id: I132e08fc496abef278b94254cebfac7a4285a7c2
2021-06-10 11:53:24 +00:00
Vadim Yanitskiy bd49fd2492 [VAMOS] trx_sched_init_ts(): assign names to per-timeslot counters
Thanks to [1], it's now possible to associate a human-readable
name with a rate counter group.  Before this API, we had to use
weird index values for each timeslot, and with introduction
of the shadow timeslots the situation got even worse.

Change-Id: Ie872ab37661fa5d44f219f59c7daaa1033113289
Depends: [1] I0dc510783dd9ae8436dae8005a7b3330e80d36f3
Related: SYS#4895, OS#4941
2021-06-09 22:45:10 +02:00
Vadim Yanitskiy 43adbe200c measurement: remove over-defensive checks in is_meas_complete()
The timeslot number ts->nr is set in gsm_bts_trx_alloc() and can
never be greater than 7.  Regarding the physical channel type
returned by ts_pchan(), it's also unlikely to be greater than
_GSM_PCHAN_MAX.

Change-Id: I6d20d7cba49cc8b6d1dc2192598ca372b7d2c5bf
2021-06-09 20:20:42 +00:00
Vadim Yanitskiy fc8c9880d9 conf_lchans_as_pchan(): initialize all lchans with GSM_LCHAN_NONE
This function is called during the OML bootstrapping, and also
when a dynamic timeslot switches between PDCH and TCH/{F,H}.
In the later case, after switching from TCH/{F,H} to PDCH, some
lchans might still have the old type assigned.

Let's ensure that all logical channels are properly updated.

Change-Id: I44726f2bfb979c2fa2f5f30c5b11700cf4b3399d
Related: SYS#5313, OS#1569
2021-06-08 02:04:53 +02:00
Vadim Yanitskiy 628853de74 conf_lchans_as_pchan(): fix GSM_LCHAN_{CCCH->CBCH} regression
This regression was introduced (by me) in [1] and broke CCCH.

Change-Id: I403ad06574a8505b69dd06781f7fe0f7cabf416f
Fixes: [1] I1c5a033e89d9ca5fb01ebe9ffb521fd67d159bee
Related: SYS#4895, OS#4941
2021-06-08 01:53:14 +02:00
Vadim Yanitskiy 177799fe7e l1sap: fix TDMA frame number wrap in l1sap_info_time_ind()
Using the normal arithmetic for TDMA frame numbers may result
in getting wrong values.  Consider the following situation:

  'info_time_ind->fn' is 0 (beginning of period)
   'bts->gsm_time.fn' is 2715647 (end of period)

With these input values the following expression:

  info_time_ind->fn - bts->gsm_time.fn

will be equal to:

  0 - 2715647 or -2715647

In this case osmo-bts does not log an error, because:

  if (-2715647 > 0) // is false

As a consequence, we do not increment number of RACH slots that
have passed by since the last time indication:

  for (i = 0; i < -2715647; i++) // is false

This is why we introduced GSM_TDMA_FN_{SUB,SUM,DIFF,INC} API.

Change-Id: I6168dd75daea50bbe2e19338e637185ac9ac87ef
2021-06-07 01:49:16 +02:00
Neels Hofmeyr 68671291f3 [VAMOS] osmo-bts-omldummy: allocate shadow timeslots
Change-Id: I4aa9a8bb35bd828d6f25d5690297e727dace5974
Related: SYS#4895, OS#4941, SYS#5316, OS#4940
2021-06-05 00:34:36 +02:00
Vadim Yanitskiy 6d20a49806 [VAMOS] osmo-bts-trx: schedule bursts on 'shadow' timeslots
Change-Id: I3e0bdf8c03273f66991aa1764029ab1dd3528d7e
Related: SYS#4895, OS#4941
2021-06-05 00:34:36 +02:00
Vadim Yanitskiy 0686ae6128 [VAMOS] Implement the concept of 'shadow' timeslots
Change-Id: I48b44b4df9ffb1cca105aebbd868c29b21f3b1d6
Depends: Ia0bd8695a3f12331b696fe69117189cdd48b584d
Related: SYS#4895, OS#4941
2021-06-05 00:34:36 +02:00
Vadim Yanitskiy d9daa3fd9e [VAMOS] conf_lchans_as_pchan(): improve readability
Change-Id: I1c5a033e89d9ca5fb01ebe9ffb521fd67d159bee
2021-06-05 00:34:36 +02:00
Vadim Yanitskiy b99db695a7 [VAMOS] scheduler: drop meaningless channel number checks
Change-Id: Icc57e58feece51c2d1c421454352bc821e338973
2021-06-05 00:34:36 +02:00
Vadim Yanitskiy 28cd8a318f trx_sched_is_sacch_fn(): fix handling of dynamic timeslots
There is no GSM_PCHAN_TCH_F{_TCH_H}_PDCH in trx_sched_multiframes[],
so find_sched_mframe_idx() would always return -1 for these.  Fix
this by using ts_pchan(), which returns currently active pchan type.

Change-Id: Ia5e337e897b595e7de6e504664c969b583cc02a1
2021-06-04 20:06:58 +00:00
Vadim Yanitskiy 5b8080208a osmo-bts-trx: fix NULL pointer dereference in trx_if_send_burst()
Starting from TRXDv2 [1], trx_if_send_burst() would keep batching
PDUs to the static buffer, unless it's called with br = NULL, so
we cannot dereference br in the logging statement.

Of course, we could also store TDMA frame number in a static
variable, but I don't think it's worth it just for logging.

Change-Id: I4a361777fc40bdedcebbe54df6274bc5573f77a8
Fixes: [1] I9b4cc8e10cd683b28d22e32890569484cd20372d
Fixes: CID#236232
2021-06-04 20:06:58 +00:00