Skip to content

Loading builds...

Changes

#1129 (Mar 30, 2026, 9:50:02 AM)

struct trx_power_params: fix inaccurate comment

Change-Id: I1bdb7fab24fee28dbeac0ed05e13f650e08c98e9
Fixes: 4c632421 ("bts_shutdown_fsm: fix spurious RAMP_COMPL events in WAIT_TRX_CLOSED")
Vadim Yanitskiy at

#1128 (Mar 29, 2026, 1:56:50 PM)

osmo-bts-trx: rx_data_fn(): fix copy-paste in comment

Change-Id: Ibf35c468310a690fd873cf968bb2c44b493ca5ea
Vadim Yanitskiy at

#1127 (Mar 29, 2026, 1:52:55 PM)

bts_shutdown_fsm: fix spurious RAMP_COMPL events in WAIT_TRX_CLOSED

With multiple TRXes ramping down in lockstep, both their final
ramp-timer callbacks fire back-to-back in the same event loop pass,
setting p_total_cur_mdBm to the target value for both before any async
hardware acknowledgement arrives.  When the first SETPOWER ack returns
and fires ramp_down_compl_cb() for TRX0, the remaining-TRX check in
st_wait_ramp_down_compl() inspects p_total_cur_mdBm for TRX1 and finds
it already at the target - concluding that all TRXes are done.  The FSM
then transitions to WAIT_TRX_CLOSED, and the second ack (for TRX1)
fires ramp_down_compl_cb() into the wrong state, producing:

  BTS_SHUTDOWN(...){WAIT_TRX_CLOSED}: Event BTS_SHUTDOWN_EV_TRX_RAMP_COMPL not permitted

The root cause is that p_total_cur_mdBm is a *requested* value set in
the timer callback, not a confirmed one.  The hardware confirmation
arrives asynchronously via power_trx_change_compl() ->
power_ramp_do_step(), which is also where compl_cb() is invoked.

Fix by adding a 'complete' flag to trx_power_params.ramp that is:

* cleared when _power_ramp_start() begins a new ramp, and
* set just before compl_cb() is called in power_ramp_do_step()

The shutdown FSM remaining-TRX count then checks !ramp.complete instead of
comparing p_total_cur_mdBm against the target, correctly reflecting which
TRXes have actually received hardware confirmation of ramp completion.

Change-Id: Ia71393e871187d6b44b7f520eb421bab354aafd1
Vadim Yanitskiy at

#1126 (Mar 29, 2026, 1:47:57 PM)

osmo-bts-trx: rx_rach_fn(): remove redundant fall-back

Condition `synch_seq != RACH_SYNCH_SEQ_TS0` is unlikely to be true,
given that no other synch. sequences are defined by 3GPP TS 45.002.
Even if this happens for whatever reason (e.g. a bug), assigning
`synch_seq` to `RACH_SYNCH_SEQ_TS0` is not needed, as `synch_seq`
is never read after the switch statement.  The logging message is
not useful either, since we already print the synch. seq. above.

Change-Id: I4cdc03dc6631ca17d13a3067ad03020e3e97eab1
Vadim Yanitskiy at

#1125 (Mar 27, 2026, 7:41:37 AM)

osmo-bts-trx: check sscanf() result in NOMTXPOWER/SETPOWER handlers

Both trx_ctrl_rx_rsp_nomtxpower() and trx_ctrl_rx_rsp_setpower() were
calling sscanf() without checking its return value.  On a parse failure
the local variable remained uninitialized and was passed directly to the
callback, resulting in a garbage power level.

Change-Id: I3dc399cfae70c450d53d66bb99f3832f160fca39
Vadim Yanitskiy at

#1124 (Mar 26, 2026, 10:17:29 PM)

l1sap: check_for_ciph_cmd(): add missing msgb length check

The function accesses msg->data[0..4] without first verifying that the
message is at least 5 bytes long, which would cause a buffer over-read
on a malformed (too short) LAPDm frame.

Change-Id: I47690f1a6357e42913bfa8100e36c05cb4f0607a
Vadim Yanitskiy at

#1123 (Mar 26, 2026, 10:13:51 PM)

osmo-bts-trx: clean up log messages in response handlers

Drop the redundant "transceiver" prefix from LOGPPHI() calls -
the macro already prepends the PHY instance name.

Change-Id: Iec722198f161621dd00ce3baabb732e1a1d91a37
Vadim Yanitskiy at

#1122 (Mar 26, 2026, 10:10:12 PM)

scheduler: trx_sched_is_sacch_fn(): fix returning non-bool

The function is declared `bool` but returns `-EINVAL` on an error path.
`-EINVAL` is `-22`, which in C implicitly converts to `bool true`.
Returning `false` makes more sense when we don't know the MF layout.

Change-Id: Ib2394687815aed4990c3880446176e4c97440667
Vadim Yanitskiy at

#1121 (Mar 26, 2026, 10:06:10 PM)

osmo-bts-trx: check sscanf() result in NOMTXPOWER/SETPOWER handlers

Both trx_ctrl_rx_rsp_nomtxpower() and trx_ctrl_rx_rsp_setpower() were
calling sscanf() without checking its return value.  On a parse failure
the local variable remained uninitialized and was passed directly to the
callback, resulting in a garbage power level.

Change-Id: I3dc399cfae70c450d53d66bb99f3832f160fca39
Vadim Yanitskiy at

#1120 (Mar 26, 2026, 10:00:59 PM)

measurement: is_meas_complete(): fix fn_mod variable type

`fn_mod` was declared as 'unsigned int' but initialized to -1, which
yields `UINT_MAX` via implicit conversion.  Use 'int' instead to make
the sentinel value unambiguous and match the `%d` format used in
the debug log.

Change-Id: I6b0bce9bc9fca1d6effbb2da2319132cdff4e9c7
Vadim Yanitskiy at

#1119 (Mar 26, 2026, 9:56:21 PM)

tx_power: get_pa_drive_level_mdBm(): assert on out-of-range ARFCN

The function previously returned `INT_MIN` as an error sentinel when
the ARFCN exceeded the calibration table size (1024 entries, covering
all valid GSM ARFCNs 0..1023).  None of the callers checked for this
value, so it would silently propagate through power calculations and
eventually be passed to `bts_model_change_power()`.

An out-of-range ARFCN indicates a serious misconfiguration;
replace the range check and `return INT_MIN` with an `OSMO_ASSERT`.

Change-Id: I70c54652e0b07d399363276bc60946aa8b195725
Vadim Yanitskiy at

#1118 (Mar 26, 2026, 9:52:38 PM)

bts_ctrl_commands: remove debugging leftover

Change-Id: I571a10f94482e3097aa915f192db6215f085dbcd
Vadim Yanitskiy at

#1117 (Mar 26, 2026, 9:48:55 PM)

phy_link: phy_instance_link_to_trx(): add missing semicolon

Change-Id: Ica33798adfdc5aad6b6aa9e252e9cc9294bad659
Vadim Yanitskiy at

#1116 (Mar 26, 2026, 9:42:47 PM)

phy_link: phy_{link,instance}_name(): fix shared static buffer

Both functions were writing into the same static buffer, so any caller
holding a pointer returned by one and then invoking the other would
silently end up with a stale/overwritten string.  Move name_buf into
each function as a local static, so the two buffers are independent.

Change-Id: I79e9d7f5b1e5c275911cf88854211f1ce8a28669
Vadim Yanitskiy at