Commit Graph

34 Commits

Author SHA1 Message Date
Pau Espin 8971d6b98f Use new stat item/ctr getter APIs
Generated with  following and similar spatch snippets:
"""
@@
expression E1, E2;
@@
- &E2->ctr[E1]
+ rate_ctr_group_get_ctr(E2, E1)
"""

Change-Id: I0b43f922a595d694ac0aeda80107ef9bf4e755e7
2021-06-04 17:48:43 +02:00
Pau Espin b199851143 bsc: Use osmo_clock_gettime everywhere
Change-Id: I585910277f36d9d7950c9d7e435356eaf2a11ed7
2021-05-23 10:30:44 +00:00
Pau Espin fcffaf7bdb osmo-bsc: Avoid erroring every few secs about unconnected BTS
I know my 2nd BTS is not connected, no need to get an error about it
every few seconds.

Change-Id: I7c991b49b4f474d8b324ac7ff3ddb6a9ec59751d
2021-05-11 18:06:24 +02:00
Michael Iedema 858ac62b88 stats: add BTS uptime counter
Change-Id: Ib17674bbe95e828cebff12de9e0b30f06447ef6c
2021-05-04 16:09:46 +00:00
Pau Espin 8831160631 Revert "update neighbor ARFCNs on startup and config changes"
This patch caused major breakage in my setup, with BSC printing at
startup: "(bts=0,trx=0) Failed to generate System Information".

And bts-trx printing all the time:
"sysinfo.c:162 PH-RTS-IND: Unable to determine actual BS_AG_BLKS_RES
value as SI3 is not available yet, fallback to 1"

This reverts commit c1a5310a3e.

Change-Id: I5da365c93aedc6668a77b82ee9b68cbec64967e3
2021-04-23 13:38:58 +02:00
Neels Hofmeyr c1a5310a3e update neighbor ARFCNs on startup and config changes
The effects of the neighbor configuration depend on the LAC, Cell
Identity, ARFCN, BSIC configuration of neighbor cells. Make sure that
the neighbor ARFCN list in the System Information is updated.

This may seem rather aggressive: updating the SI of all BTS if only one
config item changed. But indeed even modifying one config item of one
BTS may cause a change in the neighbor relations that many other BTS may
have to the changed BTS. For example, if many BTS configure a
'neighbor lac-ci 42 23', and this cell's config changes to LAC 43, all
of those other BTS need to update their neighbor ARFCNs.

Also update the system information even before the BTS are connected and
started up. The main benefit here is that the VTY 'show bts N' command
then already lists the correct neighbor ARFCNs.

In gsm_bts_trx_set_system_infos(), make sure that the updated SI is only
sent to TRXes that are actually usable, otherwise abis_rsl_sendmsg()
spams the log with complaints that a message's dst == NULL. Still return
an error rc in case a TRX is not connected, so that the CTRL command
bts.N.send-new-system-informations accurately returns whether SI were
actually sent to all TRXes.

The desire to have the ARFCNs listed in the VTY before starting up BTSes
came during analysis for Ifb54d9a91e9bca032c721f12c873c6216733e7b1,
which fixes a bug that is now much easier to verify being fixed.

Change-Id: I2222e029fc225152e124ed1e8887f1ffd4a107ef
2021-04-22 18:50:32 +00:00
Vadim Yanitskiy 3fd19268ae vty: deprecate BTS type 'sysmobts' in favor of 'osmo-bts'
Change-Id: I60d5ff887a7c830180088904c2458f7e73ce3893
2021-04-12 18:54:40 +00:00
Alexander Chemeris e9a44fdedd stats: Count transitions from BORKEN state due to LCHAN_EV_TS_ERROR signal.
Change-Id: Ice3379020039dc3634aa3887939740729d720dee
2021-04-12 17:56:55 +00:00
Keith Whyte 1823f89c1e Ignore CHANnel ReQuireD with Access Delay IE > 63
It is observed that a CHANnel ReQuireD with access delay
greater than 63 can be received from the Ericsson RBS.
This results in osmo-bsc sending back a CHANnel ACTIVation with
a Timing Advance IE containing the access delay value.
The RBS NACKs this, leading to a BORKEN Channel.

This patch makes the maximum acceptable access delay vty-configurable
and Ignores CHANnel ReQuireD RSL Messages with Access Delay IE greater
than that configured. Default value is 63.

Related: OS#5096
Change-Id: Ie8987bcc0e43921bc753162b77a0efc68799b3ce
2021-04-04 15:39:53 +02:00
Neels Hofmeyr 764449ec2e fix/refactor neighbor config
The neighbor configuration storage is fundamentally broken: it requires
all local cells to be configured before being able to list them as
neighbors of each other. Upon config write-back, the neighbor config
however is placed back inline with the other config, and hence a
written-out neighbor config no longer works on program restart.

The cause of this problem is that the config is stored as explicit
pointers between local cells (struct gsm_bts), which of course requires
the pointer to exist before being able to reference it.

Instead, store the actual configuration that the user entered as-is,
without pointers or references to objects that need to be ready. Resolve
the neighbors every time a neighbor is needed.

Hence the user may enter any config at any place in the config file,
even non-working config (like a BTS number that doesn't exist), and the
relation to actual local or remote neighbor cells is made at runtime.

Abort program startup if the initial neighbor configuration contains
errors.

Related: OS#5018
Change-Id: I9ed992f8bfff888b3933733c0576f92d50f2625b
2021-03-24 21:22:21 +01:00
Neels Hofmeyr d88f9a5384 refactor handover penalty timers
So far the list of penalty timers was stored for an opaque target
pointer. That was either a gsm_bts pointer for a local BTS, or a cell
identifier list pointer for a remote-BSS cell.

Reasons to refactor penalty timers:

- The cell identifier list pointer came from the neighbor configuration
  storage, but the way cell neighbor config is stored will change in a
  subsequent patch. There will be no more cell identifier lists there.

- Storing object pointers is inherently unsafe -- if an object gets
  removed and another gets allocated, the penalty timer could
  theoretically remain in force for an unrelated object.

Rather store penalty timers for specific Cell IDs. Since remote-BSS
neighbors can be requested by a cell identifier *list*, use a
gsm0808_cell_id_list2 as key in the list of penalty timers.

Fix handover_test.c: have different CI for each local BTS. So far it was
the same LAC+CI for all BTSes, which now would make the test fail,
because any penalty timer would appear to apply to all local cells.

Related: OS#5018
Change-Id: I72dd6226a6d69c3f653a3174c6f55bf4eecc6885
2021-03-24 10:02:29 +01:00
Oliver Smith 3ac1278dcf stats: T3122 related: num_values 16 -> 60
Increase the number of values saved in the FIFO from 16 to 60, so there
is more time to read them out.

Related: SYS#4877
Change-Id: Ic5fd7c0fa030004fd88fee74f0028fb93c9f2d10
2021-03-17 16:21:21 +01:00
Keith Whyte e4b52dff39 Disallow changing the type of an existing BTS from the vty
Changing the BTS type is not supported, so don't allow it.

For example, Changing from type sysmobts to type rbs2000
may hit an OSMO_ASSERT in om2k_bts_fsm_alloc()

The default BTS type if osmo-bsc is started with an empty
configuration and the operator issues config terminal->network->bts 0
will be "unknown". This type and only this type can be
changed from the vty config node.

Change-Id: I0df97ef128a1bbd84c787654d1d842dce4dad819
2021-02-19 08:29:32 +01:00
Michael Iedema 456a962c7e stats: add SIGN/SPEECH assignment subcategories
Change-Id: I73f4dab6edb0951180f2bbcfc352ff34de647679
2021-02-17 15:13:25 +00:00
Vadim Yanitskiy e1d2691e69 power_control: enable Uplink DPC by default if format is known
So far osmo-bsc would enable Uplink DPC (Dynamic Power Control) only
for osmo-bts, and the 'static' mode for all other BTS models.  This
decision dates back to the time when ip.access specific encoding for
dynamic power control parameters was not implemented, and the MS
Power Parameters IE was sent empty in the RSL messages.

Let's make a step forward by enabling Uplink DPC by default for
all BTS models which declare the API for vendor-specific encoding
of the power control parameters.  Currently this includes osmo-bts
and nanoBTS, both supporting ip.access specific format.

Change-Id: If86d27d4332af3d82f862737340d061e42e34eba
Related: SYS#4918
2021-02-07 04:38:15 +01:00
Michael Iedema e3d0b93986 stats: Add granularity to chan:rf_fail stat.
Add additional counters to track TCH and SDCCH RF failures in separate subcategories.

Change-Id: I91fe6659fe9df33763f4070b4f505561b2005d38
2021-01-30 14:15:16 +00:00
Michael Iedema e42208c6ea stats: Add granularity to SDCCH/TCH/LU activity.
Change-Id: I4df275e4770c5ff3643c79ba828e736986f8bb47
2021-01-18 10:59:02 +00:00
Pau Espin Pedrol 55a015dddf Introduce Neighbor Resolution Service
This new CTRL interface allows users of this BSC (such as attached PCU)
to gather neighbor information.

This interface is needed for PCU to translate ARFCN+BSIC keys provided
by MS in the Um side into CGI + RAC keys used to identify target cells
in RIM procedures against SGSNs on the Gb interface.

This patch extends the already existing neighbor information storage in
the VTY by allowing storage of CGI + RAC (RAC couldn't be stored
beforehand).

Related: SYS#4909
Depends: libosmocore.git Change-Id If48f412c32e8e5a3e604a78d12b74787a4786374
Change-Id: Ib07c9d23026332a207d4b7a0f7b4e76c0094e379
2021-01-13 17:14:09 +01:00
Harald Welte c57333e158 Add a bts_model->bts_init() and trx_init() call-back function
This allows a given BTS model driver to initialize data structures
specific cor this BTS instance (or a TRX for this BTS instance).

Change-Id: Icbad9cdc12221c9ad997267d77e5414edcbac538
2020-12-29 17:30:52 +00:00
Vadim Yanitskiy ade9435fa1 power_control: enable dynamic MS power control for osmo-bts
Before the recent changes, the MS Power Parameters IE would always
be included empty in RSL CHANnel ACTIVation messages iff the BTS
type is 'osmo-bts'.  Then this behavior was changed, so the user
would need to enable dynamic power control explicitly.

This is a regression, let's revert it back to the old behaviour.

Change-Id: Idb453fc894584ccf4f5f8b45a24421db958e9478
Related: SYS#4918
2020-12-29 17:02:27 +01:00
Vadim Yanitskiy 8bde75c91d power_control: add new structures and default parameters
Change-Id: I7fb8ccb997490b40a061d09c241359aaabc37c4a
Related: SYS#4918
2020-12-19 22:54:48 +01:00
Pau Espin aab54b44e4 Introduce NM GPRS CELL FSM
Related: OS#4870
Change-Id: I074f4496aa153b5f84e6ce85f413754efe64d831
2020-12-03 19:56:19 +01:00
Pau Espin 64c422858d Store GPRS MOs directly under BTS SiteMgr object
The only real 1-1 relationship between BTS NM objects is the one between
GPRS Cell and BTS (which is actually a BTS cell).
In our current osmo-bts implementation we don't care much since we only
handle 1-cell BTSses, but let's make the data structure organization
more generic.

Implementation notes:
The gsm_bts_sm is moved to its own file, APIs to allocate are added and
the new public object is hooked correctly in the allocation process of
osmo-bsc.

Change-Id: I06461b7784fa2a78de37383406e35beae85fbad8
2020-12-03 16:31:36 +01:00
Philipp Maier ca878ff4df bts: add repeated acch mode flags + vty config
To be able to control the FACCH/SACCH repetition behavior inside the
BTS a one byte flag is sent to the BTS together with the
RSL_IE_OSMO_REP_ACCH_CAP IE. This patch adds the necessary VTY commands.
The sending of the flag is implemented in a follow-up patch.

See also: I39ae439d05562b35b2e47774dc92f8789fea1a57

Related: SYS#5114, OS#4796, OS#4794, OS#4795
Depends: libosmocore I6dda239e9cd7033297bed1deb5eb1d9f87b8433f
Change-Id: I083eaa2c30478912426e9c24a506f0b88836e190
2020-12-01 11:58:24 +00:00
Vadim Yanitskiy 218b3753f1 bts: move rate counter / stat item definitions from *.h to *.c
A header file should only contain declarations, not entire definitions.
The fact that we have 'static const struct ...' definitions in a header
file means that very C file including this header file will get its own
private copy of the entire definition.

The header file should only include declarations, while the actual
non-static definitions should go to a *.c file.  Let's fix this.

Also, take a chance to improve readability and apply more consistent
formatting (similar to 'struct hf_register_info[]' in Wireshark).

Change-Id: Ib5949879902acbe1edda577477d9d51a2cc425d1
Closes: OS#4816
2020-10-19 01:07:24 +07:00
Pau Espin 6adeb607d0 Introduce NM BTS FSM
Change-Id: I7756a8ce90b6cc8a502b5665889a7987d7f749cb
2020-10-15 05:55:36 +00:00
Pau Espin 4338de5f51 Introduce NM BTS Site Manager FSM
Change-Id: Ic001ce6ebeff6f51470ef58140b0235f4a30265e
2020-10-15 05:55:36 +00:00
Philipp Maier cc6d35d788 abis_rsl: prioritize emergency calls over regular calls
when an emergency call arrives while all TCH are busy, the BSC should
pick an arbitrary (preferably the longest lasting) call / lchan and
release it in favor of the incoming emergancy call.

The release of the existing call is a process that can not be done
synchronously while the ChanRQD is handled sonce multiple messages are
exchanged between BTS and MSC and multiple FSMs need to do their work.

To be able to release one lchan while handling a ChanRQD a queue is
implemented in which the incomming channel requests are collected. If
an emergency call is established while all channels are busy, an
arbitrary lchan is picked and freed. When freeing the lchan is done,
the queue is checked again and the emergency call is put on the free
lchan (TCH/H or TCH/F).

Change-Id: If8651265928797dbda9f528b544931dcfa4a0b36
Related: OS#4549
2020-09-07 12:44:41 +02:00
Daniel Willmann bf2a4b69d8 Count intra-cell and intra-bsc handover separately
Currently the counters don't distinguish between intra-cell and
intra-bsc handover.

Add _CTR_INTRA_CELL_HO_ and _CTR_INTRA_BSC_HO_ counters to track
intra-cell/bsc handover separately.

Change-Id: I3a1195640b99813036c9f1426ee5f07548e26547
Related: SYS#4877
2020-08-24 07:41:43 +00:00
Pau Espin deaa6fd624 Introduce support for ACC subset rotation
See updated documentation section in manuals/chapters/bts.adoc regarding
an explanation on how the system works.

Related: SYS#4911
Change-Id: I952c9eeae02809c7184078c655574ec817902e06
2020-07-29 20:09:47 +00:00
Pau Espin bd5b92fa7d Move acc_ramp_init inside gsm_bts_alloc
The function initializes the struct owned by a bts, so it makes sense to
have it done there instead of somewhere else later.

It was most probably put in bsc_vty when it was initially introduced
because of all the data structure and object file mess I untangled
during last set of patches.

Change-Id: I66c4b208583e92070793183b83b3a7b7edf6ba00
2020-07-18 21:45:32 +00:00
Pau Espin 8d4f94a176 Move gsm_bts_{trx_}set_system_infos APIs to bts{_trx}.*
Change-Id: I2aa83b499d6e5d06a0fa1001fee3111f7e639c94
2020-07-18 21:45:32 +00:00
Pau Espin e2f1c95774 bts: Drop duplicated function to get trx by number
In the big mess of gsm_data we reached a point where we have multiple
functions doing the same thing, most probably because it's hard finding
stuff in there. Let's drop one of them (the one which less callers) and
move it to bts.*, where it belongs.

Change-Id: I9071a0ab250844619280fbe2be63ed99f2c87eb1
2020-07-18 21:45:32 +00:00
Pau Espin 388ed58482 Move struct gsm_bts: gsm_data.* => bts.*
Place all code related to the object into the related file.

Having all the data model in one file made sense in early stage of
development to make progress quickly, but nowadays it hurts more than
helps, due to constantly growing size and more and more bits being
added to the model, gaining in complexity.

Currently, having lots of different objects mixed up in gsm_data.h is a hole
of despair, where nobody can make any sense were to properly put new stuff
in, ending up with functions related to same object in different files
or with wrong prefixes, declarations of non-existing functions, etc.
because people cannot make up their mind on strict relation to objects
in the data model.
Splitting them in files really helps finding code operating on a
specific object and helping with logically splitting in the future.

Change-Id: I00c15f5285b5c1a0109279b7ab192d5467a04ece
2020-07-18 21:45:32 +00:00