Commit Graph

7623 Commits

Author SHA1 Message Date
Harald Welte 1a7bdb2e0d [cosmetic] abis_om2000: Re-format to use longer lines
For several years now we are using line lengths longer than 80chars,
let's re-format this code more in-line with our new style.

Change-Id: I8143280358c0e23ca7e32b882e952eac991e105b
2020-12-29 17:30:52 +00:00
Harald Welte a34ced0cc2 abis_om2000: make om2k_mo_name() an exported function
Change-Id: Idb05bcad8059ab2b2be6c7057495d0279a4b62c7
2020-12-29 17:30:52 +00: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 f4674e3f7a power_control: fix swapped lower/upper RxQual threshold values
According to 3GPP TS 45.008, section A.3.2.1:

  c) Comparison of RXQUAL_XX with L_RXQUAL_XX_P (XX = DL or UL):

     Increase XX_TXPWR if at least P3 averaged values out of N3
     averaged values are greater (worse quality) than L_RXQUAL_XX_P.

  d) Comparison of RXQUAL_XX with U_RXQUAL_XX_P (XX = DL or UL):

     Decrease XX_TXPWR if at least P4 averaged values out of N4
     averaged values are lower (better quality) than U_RXQUAL_XX_P.

Given that RxQual is a value in range 0 .. 7, where 0 is the best
and 7 is the worst: L_RXQUAL_XX_P must define the worst quality,
while U_RXQUAL_XX_P must define the best quality value.

Change-Id: I0f37b23ed360782f3c1f4275234c4e18a17aa89b
Related: SYS#4918
2020-12-27 12:56:34 +00:00
Vadim Yanitskiy 06b8a78e61 power_control: encoding of H_REQAVE and H_REQT for ip.access
Change-Id: I761401d13b72e8f7c07f3a4ed5002dffc735a210
Related: SYS#4918
2020-12-25 16:17:41 +00:00
Vadim Yanitskiy 598ed062f4 vty: cosmetic: make all 'struct cmd_node' definitions static
Change-Id: I7bc8fcb53aef8dbee120e8a6457d8ce4227c7698
2020-12-23 19:49:54 +00:00
Vadim Yanitskiy f2adcd4487 power_control: reflect MS/BS Power difference in the VTY prompt
Change-Id: I66d414a5f761eeec042a47207fc7d295e073cd10
Related: SYS#4918
2020-12-23 19:49:54 +00:00
Neels Hofmeyr 3410f6e0c4 handover_test: rename test scripts from numbers to names
The meaningful names expose that some of those tests are apparently
quite similar.

With names like this it is far easier to see whether a specific scenario
is already tested or not, and find a test when looking for a specific
scenario.

Change-Id: I6f6d65d818fd1265e8ff94a2e0afba6392c50eb9
2020-12-23 01:59:08 +00:00
Neels Hofmeyr 1adf0386d3 handover_test: set a fake osmo_mgcpc_ep_ci pointer
The handover_fsm activates voice on a target lchan only when the source
lchan has an osmo_mgcpc_ep_ci pointer for the BTS side. Since that
struct is opaque, set a fake pointer and override the
osmo_mgcpc_ep_ci_name() function so that the pointer is never
dereferenced.

This more accurately models the RTP stream setup events during handover.

Change-Id: Ibc22001bf9e9874dd3f44f0acac8b6a4c1069aa7
2020-12-23 01:59:08 +00:00
Neels Hofmeyr edf3359205 handover_test: adjust logging for reproducability
Do not show source file and line numbers in the log, so that the log
output remains unchanged for unrelated changes.

Also show the log level.

Change-Id: I8ebcaf16cd14881a3a41616dcff175e173db9ae8
2020-12-23 01:59:08 +00:00
Neels Hofmeyr e0dfe96662 handover_test: send ho detection
So far we skipped the HO Detection message, because the FSM also accepts
a handover when the Handover Complete arrives without a Detection.
Rather model the real behavior.

Also send the EST IND message and RTP-ready events from the ho
detection.

Change-Id: Ib676e74f23ef9cd1b55262117822b0e110013bdc
2020-12-23 01:59:08 +00:00
Neels Hofmeyr 64982dda42 handover_test: log sending ho complete
Change-Id: I540e880f9aafb92be03c35086340de1968b26836
2020-12-23 01:59:08 +00:00
Neels Hofmeyr 1a3eaeff2e handover_test: implement as VTY shell
Drop the string arrays, and move the 32 handover tests to separate
script files. Instead of the peculiar implementation and instead of
cryptic commands, implement the handover test scripts as a VTY.

handover_test.c now sets up a VTY with handover testing VTY commands. It
also features the complete and unabridged VTY configuration nodes of
osmo-bsc itself. That allows dropping various ho script commands.

Before:

  static char *test_case_14[] = {
      "Handover to congested cell, if RX level is below minimum\n\n"
      "The better neighbor cell is congested, so no handover is performed.\n"
      "If the RX level of the current cell drops below minimum acceptable\n"
      "level, the handover is performed.\n",

      "create-n-bts", "2",
      "create-ms", "0", "TCH/F", "AMR",
      "expect-ts-use", "0", "0", "*", "TCH/F", "-", "-", "-", "-", "-", "-",
      "set-min-free", "1", "TCH/F", "4",
      "set-min-free", "1", "TCH/H", "4",
      "meas-rep", "0","0","1","0", "10","0", "1","0","30",
      "expect-no-chan",
      "meas-rep", "0","0","1","0", "9","0", "1","0","30",
      "expect-chan", "1", "1",
      "ack-chan",
      "expect-ho", "0", "1",
      "ho-complete",
      "expect-ts-use", "0", "0", "*", "-", "-", "-", "-", "-", "-", "-",
      "expect-ts-use", "1", "0", "*", "TCH/F", "-", "-", "-", "-", "-", "-",
  }

After:

  # Handover to congested cell, if RX level is below minimum
  # The better neighbor cell is congested, so no handover is performed.
  # If the RX level of the current cell drops below minimum acceptable
  # level, the handover is performed.

  create-n-bts 2
  set-ts-use trx 0 0 states * TCH/F - - - - - -
  network
   bts 1
    handover2 min-free-slots tch/f 4
    handover2 min-free-slots tch/h 4
  meas-rep lchan 0 0 1 0 rxlev 10 rxqual 0 ta 0 neighbors 30
  expect-no-chan
  meas-rep lchan 0 0 1 0 rxlev 9 rxqual 0 ta 0 neighbors 30
  expect-ho from lchan 0 0 1 0 to lchan 1 0 1 0
  expect-ts-use trx 0 0 states * - - - - - - -
  expect-ts-use trx 1 0 states * TCH/F - - - - - -

Note how osmo-bsc's stock vty config nodes seamlessly integrate in the
test steps: just enter a configuration node, modify some values, and
indenting trivially takes care of exiting nodes correctly.

Running a test manually:
	./handover_test test_0123.ho_vty

Instead of calling each test separately in testsuite.at, have a
handover_tests.sh script that picks up new tests just by presence of
files named test*.ho_vty.

Rationale:

It was considered to move handover tests to the TTCN suite, but there is
an advantage in having these C tests: they run super fast and catch bugs
even in the gerrit verification job, potentially saving a lot of time.

It is a reality that I need more of these tests, for dynamic timeslots
and TCH/F <-> TCH/H switches. The way the handover tests are written, as
arrays of strings containing cryptic fixed-argument script commands, has
been a pain to work with from the start, and now I am no longer willing
to endure that pain.

Change-Id: Ie238ebe41039d3fa44c9699937589e000883e052
2020-12-23 01:59:08 +00:00
Vadim Yanitskiy 53866d3bf7 power_control: add VTY command to set static / maximum BS Power
Change-Id: I11ca856aba46aaf84d94cbbdf4c39a01ee8289b9
Related: SYS#4918
2020-12-22 11:11:07 +00:00
Vadim Yanitskiy 040d220a01 power_control: add VTY command for re-sending default parameters
Change-Id: I35e9147d5536f9901ac63f605d87ae112c024401
Related: SYS#4918
2020-12-22 11:11:07 +00:00
Vadim Yanitskiy 0ce12e7a37 power_control: add VTY commands for per-BTS configuration
Change-Id: Ifd6ea29c3b9dbaccf92856131d5fb2e352b84eb2
Related: SYS#4918
2020-12-22 11:11:07 +00:00
Harald Welte c551583fee OM2K: Skip the entire CON MO if there are no connection groups
If the user doesn't specify any CON connection groups in the config
file, then the CON is not used.  The current code runs into an error
condition, as abis_om2k_tx_con_conf_req() never sends the CON CONF REQ
if the groups list is empty, but we still wait in the FSM for the
arrival of a CFG REQ ACCEPT.  The CON FSM eventually times out in T10
and we proceed with the IS, ignoring the error.

With this patch, we simply skip the entire CON MO in case there is no
related configuration.

Change-Id: Ia4d5bd96734686381f04aa3b380b17a161a31174
2020-12-21 16:50:18 +01:00
Harald Welte 65c02aeb1d OM2K: Permit transition from WAIT_CONF_RES -> WAIT_ENABLE_ACCEPT
This is how the DP MO FSM is doing, so let's permit it.

Change-Id: I9df44f840a2818ebc877453c74bde127dce9b3e9
2020-12-21 16:50:18 +01:00
Harald Welte 3731302e90 osmobsc-usermanual: Add Chapter with AoIP message flow examples
Change-Id: I001d5f85c95098269b5f129b0c53c3544b96ffb0
2020-12-21 16:50:18 +01:00
Harald Welte 2d5fa294bd abis_om2000: Force TRX NM state to UNLOCKED once TRX is up
In I68ae0bc51a565f903b47cf72f3e3dd6f1a2d2651 we started to
initialize all (TS 12.21) NM MO state to LOCKED by default,
which means BTSs  not using TS 12.21 are stumbling across
a general check in bts_isdn_sign_link() and will fail to
process and uplink RSL messages.

Change-Id: I4450cc47ede4005bf4bbd4af8d5a22c78377d4cd
Related: OSE4914
2020-12-21 16:50:18 +01:00
Vadim Yanitskiy 7887dc2fc9 power_control: make use of MS/BS parameters in RSL messages
Change-Id: I586b1c9e16390757b015c2871a36abc3975e0fc4
Related: SYS#4918
2020-12-19 22:54:49 +01:00
Vadim Yanitskiy 2d7c2ce589 power_control: add encoder for ip.access nanoBTS and OsmoBTS
Change-Id: I3798a6a02132bafe8f1fef6e93bbb42036d76ac9
Related: SYS#4918
2020-12-19 22:54:49 +01:00
Vadim Yanitskiy f31c42e7eb power_control: send default parameters from bootstrap_rsl()
Thanks to this message, there is no need to include MS/BS Power
Control parameters in every RSL CHANnel ACTIvation message.
Instead, we send them only once, and then send empty IEs.

Change-Id: I46ae4e6003a1839ee57f8e941a54bf479f7e532d
Related: SYS#4918
2020-12-19 22:54:48 +01:00
Vadim Yanitskiy 8a2907e646 power_control: add encoding/init API to 'struct gsm_bts_model'
This change introduces two optional function pointers:

  - power_ctrl_enc_rsl_params() - this function will be called by the
    A-bis/RSL code in order to encode MS/BS Power control parameters
    for CHANnel ACTIVation and MS/BS POWER CONTROL messages.

  - power_ctrl_send_def_params() - this function will be called for
    each transceiver on A-bis/RSL link establishment in order to
    send default MS/BS Power control parameters.

Change-Id: Iba3ad5d8d549a6676050272f85b21c9b4c219d21
Related: SYS#4918
2020-12-19 22:54:48 +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
Vadim Yanitskiy e0adb24100 abis_rsl: turn rsl_msgb_alloc() a macro and move it to header
Also, take a chance to make talloc chunk names more informative.

Change-Id: Id25c4bf1e06f697328d10777d6449c83006e8466
2020-12-19 00:04:51 +01:00
Philipp Maier 6e27ce6ec4 bsc_vty: mark repeated ACCH value of 1.9% to 2.7% BER as default
Change-Id: I40fdc3df6448bcac9d3bd531f7a7d0ded33d98d4
Related: SYS#5114, OS#4796, OS#4794, OS#4795
2020-12-16 16:02:34 +01:00
Pau Espin Pedrol 0597745ac7 Use rest_octets functionalities from libosmocore
libosmocore > 1.4.0 is required (master, not yet released) since some
fixes done in osmo-bsc code where not cherry-picked to libosmocore APIs.

Depends: libosmocore.git I2bf5635b8536b11d69774d17ac1908019633e3af
Change-Id: I7d5e5ddd174463c2a3d957c8245d2911ce013681
2020-12-15 19:21:44 +00:00
Vadim Yanitskiy 027b506c27 vty: add new attribute for vendor-specific commands
Change-Id: I2254cdf8c4be85c89819d0f831102ee71349b188
Related: SYS#4918
2020-12-15 06:54:34 +00:00
Vadim Yanitskiy 626b7a0be2 NM FSMs: fix DISABLED_NOTINSTALLED -> DISABLED_NOTINSTALLED
This state transaction does not make sense, let's avoid it.

Change-Id: I24a78905bb684f8501dc5ade0605662ec283febc
Related: OS#4901
2020-12-13 12:08:45 +00:00
Pau Espin Pedrol 7c5b7ad633 gsm_lchan_name: assert on NULL lchan
Steve Langasek <steve.langasek@ubuntu.com> submitted some patches
against downstream osmo-bsc 1.3.0 because some possible null derefences
were detected by the compiler on Ubuntu s390x. Code has eveolved since
then and patch doesn't apply directly anymore, since related code
changed (we now use osmo_count in bsc_subscr_get).
The compiled allegedly claimed some null dereference in gsm_lchan_name.
In general code using that function seems to be doing checks for
existing lchan before calling it, or assuming the lchan pointer is not
null, so I couldn't find any major issue.
However, let's add a OSMO_ASSERT to make sure we can easily identify the
issue if an issue ever happens there, since the gsm_lchan_name should
clearly only be called on non null pointers.

Change-Id: If4d12cb1d95ee2a89244bb8f27df839871667387
2020-12-10 15:28:05 +00:00
Neels Hofmeyr ef65d3ddb4 hodec 2: prefer moving TCH/H from half-used dyn TS
Change-Id: I427dc9faa3790c24119127ae227d8cc802dd50e6
2020-12-09 11:35:16 +00:00
Pau Espin Pedrol 44a0e0fc08 oml: Delay configuring NSVC until BTS features are negotiated
This is needed in order to to proper feature support verification for
IPv6 when configuring the NSVC.
Before this patch, there could be a race condition where NSVC FSM
checked for BTS feature BTS_FEAT_IPV6_NSVC before it was negotiated
through BTS Get Attributes (Ack).

Fixes: OS#4870
Change-Id: I7c207eee0e331995ae04acec014fbd13d4d16280
2020-12-04 15:54:34 +01:00
Pau Espin Pedrol 396eb76fcd Fix typo in function nanobts_attr_nsvc_get
Change-Id: I50235ba7b045ab7fba2112e61191d2756a67dfdc
2020-12-04 14:44:43 +01:00
Pau Espin 10364c8999 Handle BTS/BBTRANSC Get Attributes (Ack) in NM FSMs
Before this patch, Get Attributes was sent quicklyafter the OML link
became up, even if the BTS/BB_TRANSC objects were still powered off,
which is wrong since attributes should only be available after the
objects transition out of the Power off state.

Furthermore, information about get attr response already received will
be required in future patches to delay NSVC setting.

Related: OS#4870
Change-Id: I8ec39c7e1f956ffce9aecd58a5590c43200ba086
2020-12-04 14:44:43 +01:00
Pau Espin dd6af77e44 abis_nm: Simplify param passing to abis_nm_rx_get_attr_resp()
There's no real need to retrieve the trx before passing it to the
function, we can do that in the function itself and hence also simplify
the function itself.

Related: OS#4870
Change-Id: I7181510c5021ff2712c09ebc6ec8b13fdd8e8dc2
2020-12-04 14:44:43 +01:00
Alexander Couzens d74bb1e3b0 Introduce NM GPRS NSVC FSM
Related: OS#4870
Change-Id: I381472532c2622a8dba7c81ae00ea873c2e58ae1
2020-12-04 14:44:40 +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 ee9f02f2df Introduce NM GPRS NSE FSM
Related: OS#4870
Change-Id: I91a5f40324d5373eac885032295690cec97214a6
2020-12-03 18:46:27 +01:00
Pau Espin dd9abff60b nm_bts_sm_fsm: Fix peer_has_no_avstate_offline not applied for nanobts
The condition was set in st_op_disabled_notinstalled_on_enter():
"""
site_mgr->peer_has_no_avstate_offline = (bts->type == GSM_BTS_TYPE_NANOBTS);
"""

However, at startup of the FSM the oneneter func of the default initial
state is not called. In any case, if called it would be too early since
the type is not known yet (because its parsed later on at the VTY with
the "type" command, that's after the "bts X" node is called and the
bts_sm is allocated.
So we need to make sure to always enable it, also for nanobts.

Change-Id: Ic6049a44ae3fca1b8e968fe800c268f579e7cad4
2020-12-03 16:31:36 +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
Vadim Yanitskiy 8c03bf3f3c gsm_08_08: fix NULL pointer dereference in bsc_cm_update()
MS Classmark 3 is optional, and thus can be NULL.

Change-Id: I4f1455a3db4972ea9843564b590e405c51083b47
Fixes: I39ae439d05562b35b2e47774dc92f8789fea1a57
Fixes: CID#215593 "Explicit null dereferenced"
2020-12-02 11:45:51 +01:00
Neels Hofmeyr 18aff1fc46 ctrl_test_runner.py: remove per-test startup delay
The CTRL connect already includes 30 retries with .1 seconds delay each, so
there is no point in adding a fixed two second delay that unnecessarily drags
out test duration for each test.

Change-Id: I830fabbd037d6e945956a99aa3f5e4d4015ea165
2020-12-01 12:09:26 +00:00
Philipp Maier 0eb479e283 abis_rsl: parse cm3 and indicate ACCH repetition cap to BTS
In order to activate FACCH/SACCH repetition on the BTS, the classmark 3
IE in the CLASSMARK CHANGE message must be parsed and depending on the
Repeated ACCH Capability bit the RSL_IE_OSMO_REP_ACCH_CAP is added to
the RSL CHAN ACT und RSL CHAN MODE MODIFY. Since
RSL_IE_OSMO_REP_ACCH_CAP is a propritary IE, it may only be added for
BTS type osmo-bts.

Change-Id: I39ae439d05562b35b2e47774dc92f8789fea1a57
Related: OS#4796 SYS#5114
2020-12-01 11:58:24 +00: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
Neels Hofmeyr c93b2a2640 AMR start-mode auto: send smod bits as zero
When ICMI becomes zero for 'start-mode auto', the smod bits will remain
whatever start-mode was set in the previous osmo-bsc config. Instead, osmo-bsc
should clear the smod bits for 'start-mode auto' so that its MultiRate Config
does not vary depending on what was previously configured.

Change-Id: I1ec5bad0bce01cc425ee05ecf70c83ec662a226a
2020-11-30 15:49:46 +00:00
Neels Hofmeyr 2e8ddb44ed AMR start-mode: send proper smod bits
So far, the smod bits reflecting the start mode never made it to the
MultiRate Config IE: gsm48_mr_cfg_from_gsm0808_sc_cfg() always sets them
to zero, and the mode filtering fails to carry the BTS set bits.

Set smod bits according to BTS config after the filtering of available
modes.

Change-Id: I49691df01745a7c485bf165e897872c35fc4b147
2020-11-30 15:49:46 +00:00
Neels Hofmeyr 551cec4086 fix AMR start-mode auto: reflect proper ICMI in MultiRate Config IE
Send the proper ICMI value, instead of always sending ICMI=1 regardless
of the AMR start-mode setting.

To avoid test fallout from the fix, we should first merge
osmo-ttcn3-hacks I4cff01c37d5c7e301e9a01f773b7e009a789519b

Change-Id: I577ff590d7588fd7e3ee4846c7955ab8f84cf2b1
2020-11-30 15:49:46 +00:00
Pau Espin 9402d1eeb7 ipaccess-proxy: generate coredump and exit upon SIGABRT received
Previous code relied on abort() switching sigaction to SIG_FDL +
retriggering SIGABRT in case the signal handler returns, which would
then generate the coredump + terminate the process.
However, if a SIGABRT is received from somewhere else (kill -SIGABRT),
then the process would print the talloc report and continue running,
which is not desired.

Change-Id: Iff920ff3dbeb48bd871b7578470f27fe9d0f9516
Fixes: OS#4865
2020-11-30 14:32:32 +00:00