Commit Graph

22 Commits

Author SHA1 Message Date
Vadim Yanitskiy c14f1641c6 Constify the 'trx' argument of trx_get_hlayer1() everywhere
Change-Id: I44523d26f2f564932ea95c17b1041d0ca9cc2828
2020-08-03 02:08:14 +07:00
Pau Espin 8090df2a81 bts_model: Convert bts_model_trx_close() to return asynchronously
Some backends like osmo-bts-trx require exchanging messages like
POWEROFF to close the TRX, and hence need some time. Switch the function
to expect result asynchronously by calling a callback.

This will be used later to wait until all TRX are really powered off
before exiting the process.

Change-Id: I7d76b600fc06e1114b35bf0c2d08eff5bbd1b69a
2020-06-23 14:53:37 +02:00
Pau Espin cec19e6324 Fix missing bts_model implementations in stubs.c and bts_model.c
These will be required by compiler/linker after next changes.

Change-Id: Icd20d64cf973f4cf4425b46d4102747db53d8990
2020-06-18 19:11:55 +02:00
Pau Espin 8712e1c827 tests/stubs.c: Add missing stub for bts_model_change_power
Change-Id: I16880fae32f60a83429cf5bbef796428c60a762c
2020-06-18 14:19:43 +02:00
Pau Espin 1212df69b8 handover_tests: Avoid redefining all bts_model stubs
Change-Id: I366f71474891d32e31dbba1a9fa1f9a510fa0952
2020-06-18 14:19:34 +02:00
Pau Espin e3cb8715f5 bts_model: Allow TS connect to be processed asynchronously
This commit doesn't change internal logic of any model, only the API to
be able to return result of connect TS asyncrhonously since some models
(like osmo-bts-trx) require some time to process the result. This way
PDCH ACT/DEACT (N)ACK can be sent once the result of this long process
is known. For instance, nowadays in osmo-bts-trx we PDCH (DE)ACT ACK
before getting the result from SETSLOT on the TRX iface.

With this new API, bts_model_ts_connect doesn't return any value
synchronously. Instead, it is expected to always end up calling
cb_ts_connected with the return code from the TS activation process. 0
is considered a successs, while any other value is considered an error.

Change-Id: Ie073a4397dd2f1a691968d12b15b8b42f1e1b0cf
2018-11-26 14:08:14 +01:00
Pau Espin eebb6a4216 bts: Allocate TRX for BTS dynamically, deprecate -t
No need to pass -t num_trx anymore to specify number of TRX to use. It
is calculated based on dynamic allocation from VTY config.
Using parameter -t is flagged as deprecated and is transformed into a
NOOP por backward compatibility.

As a result, TRX now are allocated after the BTS is allocated and
initial config (pre-VTY) is applied.
A new function bts_trx_init() is added, to set default config on each
TRX during allocation and before setting VTY config on it.
A new per BTS model function bts_model_trx_init() is added, to allow
per model specific default configuration of each TRX.

Change-Id: Iab1a754ab12a626759f9f90aa66f87bdce65ac9c
2018-11-18 20:29:40 +00:00
Max 36153239bf Remove duplicated code
Remove lchan deactivation related code duplication to facilitate future
use for dynamic CCCH re-activation.

Change-Id: Id0d3b19dbfaa16d1734321a07a6eb0355bfd77c9
2016-12-01 15:20:42 +00:00
Neels Hofmeyr 9375aa9a68 dyn PDCH: add bts_model_ts_connect() and _disconnect() stubs
Enhance bts_model_ API in preparation of dyn PDCH switching. These will be used
to re-connect a TCH/F_PDCH TS in a different mode: either as TCH/F or as PDCH.

All implementations so far return -ENOTSUP, and thus will cause a IPAC PDCH ACT
or DEACT *NACK* to be sent to the BSC as soon as these messages are handled.

Also add stubs in tests.

Change-Id: I21e60c028a1333431c3ed000f788b654d1170b0d
2016-06-17 15:50:47 +00:00
Neels Hofmeyr bfc9ff3118 fix two compiler warnings: add two opaque struct declarations
Change-Id: Ie12eeff753e399b28a816893ac4d23e1cd391025
2016-06-17 15:34:57 +00:00
Neels Hofmeyr 213db32e30 tests/stubs.c: remove unused stubs
Change-Id: I53a839a332980bca67ae0b7d3e36b97afe406e5b
2016-06-17 01:30:00 +00:00
Harald Welte 611ef23700 merge bts-specific main function into common/main.c:bts_main()
This removes a lot of copy+paste duplication between different BTS
models.
2016-01-22 09:09:09 +01:00
Andreas Eversberg 7a0d11dd68 ABIS: Introduce bts_model_abis_close to indicate ABIS link failure.
sysmocom-bts model shuts down on link loss, but other models may not want
this, so shutdown is moved tor bts_model_abis_close of osmo-bts-sysmo.
2015-09-22 16:41:25 +02:00
Andreas Eversberg 5e90f2a809 Add BCCH message to PH-/MPH-/TCH-SAP interface
This first part moves BCCH message primitives from osmo-bts-sysmo to common
part. A new file "common/l1sap.c" is introduced to implement handling of
layer 1 messages from/to BTS model.
2015-09-22 16:39:02 +02:00
Holger Hans Peter Freyther b631bd21d2 power: Make it possible to force a power level
Use the standard RSL commands to order a logical channel
to use a fixed power level.

The code is not fully verified and there was a last minute
change to invoke bts_model_adjst_ms_pwr.
2015-02-05 22:32:53 +01:00
Holger Hans Peter Freyther 8968b48643 sysmobts: Remove unused global variables
We do not need to have these variables anymore. Just remove them.
2014-12-16 15:12:56 +01:00
Holger Hans Peter Freyther b3d1779b96 tests: Move the "pcu_direct" symbol into the stubs to be shared 2014-07-31 14:55:03 +02:00
Holger Hans Peter Freyther eececf5fa9 sysmobts: Make it possible to slowly ramp up the output power
For systems with a bigger PA enabling the full output power at
once might draw more current than a power supply can provide. This
code will step up the output power in smaller steps to avoid this
situation.
2014-07-30 18:22:12 +02:00
Holger Hans Peter Freyther a276b98236 oml: Indicate the kind of object passed as the void*
These routines do not pass the gsm_abis_mo and parsing the FOM
header of the msg does not seem to be a good idea either. Pass
in the OML object so that the model code can determine what the
void pointer is.
2014-03-26 18:01:55 +01:00
Andreas Eversberg 00b4e064ff handover: Add generic handling for handover
The BTS layer needs to inform the handover code when an access
burst has been received. In turn the handover layer will ask the
bts to modify the channel, it will schedule the physical information
inform the BSC with the HANDOVER DETECTION and waits for the BTS
layer to inform it about the first received frame to stop a timer.
2014-03-10 13:38:07 +01:00
Harald Welte d92774b4ac abis: delay l1if_reset() until OML link is established 2013-10-06 15:50:36 +02:00
Holger Hans Peter Freyther dd2a51ed32 tests: Share the stub between the paging and ciphering tests 2013-02-27 10:44:43 +01:00