Commit Graph

7124 Commits

Author SHA1 Message Date
Alexander Chemeris 6d4ccc1638 chan_alloc: Add comments for the *_chan_load() functions.
Change-Id: Ie199104fd4a6c0d5218f56b958d12fac4612fd78
2020-05-09 00:36:21 +00:00
Alexander Chemeris dbfa85cc08 Fix a comment for the handle_unitdata_from_msc() function.
Change-Id: If20632cfe63b78c2cb17c1bb9d12207a4956be64
2020-05-09 00:36:02 +00:00
Alexander Chemeris 97a27214f1 stats: Fix stat group index for BTS stats.
osmo_stat_item_group_alloc() should be initialized with the BTS number.

Change-Id: Iedef08af56ab6985894d89ff7b285246424ca9e7
2020-05-09 00:35:46 +00:00
Alexander Chemeris 13e5aa24ce Fix indent whitespace and log message.
Change-Id: I985bf8ac4ce6136812692c06b6dc78edc6bde652
2020-05-09 00:07:58 +00:00
Alexander Chemeris 669f87955d stats: Remove dots from the end of stats descriptions.
Change-Id: I4e66b3c864f6c54332fd6dabb0ec549c3590a1f2
2020-05-08 20:25:54 +00:00
Alexander Chemeris b091def16e stats: Report per channel type load to statsd counters.
Change-Id: I2eac4c93061204aeb8f3d223f7e78158c61c7156
2020-05-08 20:25:54 +00:00
Alexander Chemeris 241f058aeb ctrs: Correctly count load total for dynamic timeslots.
From the CS perspective, there is no difference whether this is
a dynamic TS in NONE/PDCH mode or a static TCH in UNUSED mode since
BSC can switch into USED mode at any moment. So we should count
dynamic timeslots in the "total" count.

A bit of a challenge here is that GSM_PCHAN_TCH_F_TCH_H_PDCH
timeslots could be either switched to a single TCH/F or to
two TCH/H, so the total can't be calculated reliably beforehand.
In this code we assume TCH/F since this gives a lower total
count.

Change-Id: Iabd70e8adbf15eb3b7a7be597281ea99b352317b
2020-05-08 20:25:54 +00:00
Sylvain Munaut b405e6e315 om2k: Wait for OM TRX links to stabilize before trying to bring up TRX
The OM2K link "per-trx" only comes up after MCTR is setup. So that means
we need to wait for it before trying to boot the TRX itself.

He we simply apply a "dumb" 5 sec timeout as this is the most reliable
way I found to get this working reliably.

Tracking the link state proved difficult and unreliable:

 - Multiple TRX can be present with their link coming up in random
   order.

 - They can already be up at the start (BTS already initialized from
   a previous boot) and so the link may actually come up, down, and
   up again.

 - All of theses transitions might happens before/after we get to the
   OM2K_BTS_S_WAIT_TRX state depending on how the LAPD timeout
   expire, if the BTS config was actually changed or not and how much
   time it takes to apply the new config.

So all in all, what we must do is wait for the link to stabilize ...
hence just waiting 5 second.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I55a06e08b9c52ff6e97e8c72f2d55770809eba51
2020-05-08 15:16:15 +02:00
Sylvain Munaut 94033ef9a7 om2k: Properly update the 'fake' 12.21 states using OM2000 status
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I1caafa2e87c6198bf3b1a77f0fa1edc774deeef9
2020-05-08 15:16:15 +02:00
Sylvain Munaut cbaa179945 om2k: Add support for MCTR configuration
Currently only supports a single MCTR with fixed configuration

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I96b8bb2c01c05bf153fc924f62bd6aafa96725ee
2020-05-08 15:16:15 +02:00
Sylvain Munaut a40b75e44d om2k: Rename MCTR config request constants for consistency
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I776b0016837e018500ef69acb2f30a274008818e
2020-05-08 15:16:15 +02:00
Sylvain Munaut dbd1b50604 om2k: Add option to limit OML version during negotiation
Starting from G12R13 the MCTR swiches to BSC controlled mode. And
although we think we know how to configure it (via MCTR Conf Req),
something doesn't work right and the timeslot configuration is not
accepted. (TS Conf Result shows "Data not according to request").

So as a workaround for now, we use this version of the protocol where
we don't configure the MCTR (it's in "BTS controlled mode") and with
this protocol, the BTS accepts our timeslot config and we can bring
the system up.

This commit add a generic option to limit either OML or RSL IWD
version to any value. It also keeps track of the actual negotation
version so we can react to it in other places of the code.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I8f0b0ba72056ea4250fe490e7a38630c77c04f65

better version limit

Change-Id: Ia789f8ede3eab7eeca6c759da0109e0b53398f60
2020-05-08 15:16:15 +02:00
Sylvain Munaut ce0b562785 bts_ericsson_rbs2000: Whitelist the E1d input driver
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Ief9093706d6ca20f8162ca541dcc4669c13e2cbc
2020-05-08 15:16:15 +02:00
Sylvain Munaut d1f1884dfd bts_ericsson_rbs2000: Init all the TRX, not just C0
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I9417f433f759ce21b8b6e0b74cd686df5388f8c5
2020-05-08 15:16:15 +02:00
Sylvain Munaut 4a048d363b om2k: Fix the frequency specifier for TX/RX/TS conf requests
* OM2K_DEI_FREQ_SPEC_RX:

  (hop << 15) | (rx_addr << 10) | arfcn

  . hop     Hopping marker
  . rx_addr is not really the TRX number, it's just a sequential number
            different for all TRX, doesn't need to be 'in-order' of TRX
  . arfcn   The ARFCN number (0 for hopping and 1023 for 'no frequency')

* OM2K_DEI_FREQ_SPEC_TX:

  (hop << 15) | (tx_id << 10) | arfcn

  tx_id Pretty much same as rx_id except here we know that the order
  doesn't have to match TRX order. It seems to even vary from one
  reboot to another on some real-world capture we got.

  . hop     Hopping marker
  . tx_addr Same as 'rx_addr' above but for TX
  . arfcn   The ARFCN number (0 for hopping and 1023 for 'no frequency')

* OM2K_DEI_FREQ_LIST:

  Groups of 3 bytes (24 bits), 1 per frequency used.

  (tx_addr << 20) | (rx_addr << 16) | (is_c0 << 10) | arfcn

  . tx_addr See above
  . rx_addr See above
  . is_c0   Must be 1 if that ARFCN hosts the C0. (first TRX of a MCTR)
  . arfcn   The ARFCN number

  (Note MAIO must also be set properly on the different TRX/TS sharing
   a frequency ... )

The way we generate theses here is what we gathered from real-world
traces:
 - Each 'TX' of each TRX is set to the ARFCN set in that TRX config
 - Each 'RX' of each TRX is configures as 'hopping'
   (which I assume means it will just pick the appropriate freq ?)
 - For each TS, we use :
   . tx_addr of the TRX that has the ARFCN we want to TX on
   . rx_addr of the TRX where the TS we're configuring is
   . arfcn   The actual ARFCN we want to add to the list

This is incomplete but will work for the 1 MCTR case.

Config for multiple MCTR or multiple virtual-bts still need to be
handled but it's not yet known exactly how those need to be
configured.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Ie39a857543adaa11d1822346d8563ce3718412c8
2020-05-08 15:16:15 +02:00
Sylvain Munaut 586c0114b3 om2k: Dispatch TS_EV_OML_READY to TS FSM only when it's actually ready
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Ic2a84ea406e9a39332313d63b27d73f334d4e0a0
2020-05-08 14:50:26 +02:00
Sylvain Munaut 540e98f259 om2k: Use the "from config" TS config to setup OM objects
During the configuration of the TS object through OML we must use
pchan_from_config since it's too early to use anything else.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Iecdc911a79b66d8f3d746347710ad697cb288174
2020-05-08 14:50:26 +02:00
Sylvain Munaut 7d10c80a7d om2k: Properly name message 0x0136, found to be MCTR Statistics Report
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I4b4389fd2e7bf0b3078b8ff60f6ea109114a4475
2020-05-08 14:50:26 +02:00
Harald Welte 456a62e98e bts_nokia_site: Fix LAPD segfault during reset procedure
The existing Nokia *Site code destroyed the LAPD SAP instance for OML
while processing an OML message.  Once the stack frame returned back
to the LAPD code, the LAPD SAP was gone -> segfault.

Let's work around this by moving deletion of the LAPD SAP out-of-line
by starting a timer 0ms in the future.  Not particularly nice, but
effective.

Change-Id: I6270c7210f600e53f845561898245d2fd30a368d
Closes: OS#1761
2020-05-08 13:27:40 +02:00
Sylvain Munaut 7ab23b75af om2k: Acknowledge the unknown MCTR messages we get from time to time
This is probably a fault report of some kind, but didn't get any
confirmation or naming from anywhere for it yet.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I8333093d09f27f61094c7f5854573aa16e4bf28c
2020-05-05 21:15:53 +02:00
Sylvain Munaut eebb1ad0a0 om2k: Acknowledge the HW Infos Reports
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Ida92c9ca59a608854737ba9e330a5394cceff0fe
2020-05-05 21:15:52 +02:00
Sylvain Munaut 4a97d46cb1 om2k: Fix type of msg_type in abis_om2k_tx_simple
Thoses messages IDs are 16 bits and the upper 8 bits are sort of
important :D

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Ifcc1a01fdbf66a0f6f44cf8fed60dc19e72dd56a
2020-05-05 21:15:51 +02:00
Sylvain Munaut 9d2375407e om2k: Fix TS channel config payload for non-superchannel case
* In superchannel mode, those 3 are required.
* In normal mode, "Config Type" is optional and the two others are
forbidden.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: If02d02c067ae8af8ce693ddfb8747212f3f4e441
2020-05-05 21:15:50 +02:00
Sylvain Munaut e619675d84 om2k: Don't use slashes in FSM IDs and use dashes instead
slashes are invalid so we can't use om2k_mo_name() directly, so we just
build it manually with dashes.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I3cfc19670e6d7bb607d796cabcee5e86a15d1985
2020-05-05 21:15:49 +02:00
Harald Welte 1d7349ffc9 gsm_data.h: Comment the 'nokia' BTS fields
Change-Id: I5e3eaf3dee97e2edcd80b20c3acf85bd89b40cdc
2020-05-04 08:20:06 +00:00
Oliver Smith 93830d7fc4 timers: T->X: 23002, 23004, 23005, 23006
Make various internally used timers negative, to indicate that they are
Osmocom specific. A follow-up patch will make them configurable.

Change-Id: I6f8be40ea54a3083f4b21ab938cc1723fc67c2ef
2020-05-04 10:07:01 +02:00
Sylvain Munaut e55e76f4c7 om2k: Add VTY command to allow TX of arbitrary message for testing
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I5a385614fc670946f83ea79cc176c2d448675672
2020-04-28 09:50:59 +02:00
Sylvain Munaut d9fe61c43f om2k: Allow the CON configuration request to be triggered via VTY
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Id1171a151773182bb5cdc14c023c3637fb9ad0bc
2020-04-28 09:50:59 +02:00
Sylvain Munaut 98c8985110 om2k: Allow TG and MCTR to be manipulated via VTY
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I3983ba9f06c48d515a7b739b00f05023af632267
2020-04-28 09:50:59 +02:00
Sylvain Munaut 63d7661147 om2k: Add definitions for the TG object
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I6d90554a54baa78f454281a486e4b5e95784fdee
2020-04-28 09:29:14 +02:00
Harald Welte 7463285994 handorer.h: Fix compilation with gcc-10
/usr/bin/ld: bsc_subscr_conn_fsm.o:/home/laforge/projects/git/osmo-bsc/src/osmo-bsc/../../include/osmocom/bsc/handover.h:26: multiple definition of `mr'; abis_rsl.o:/home/laforge/projects/git/osmo-bsc/src/osmo-bsc/../../include/osmocom/bsc/handover.h:26: first defined here

See also https://alioth-lists.debian.net/pipermail/debian-mobcom-maintainers/Week-of-Mon-20200413/000649.html

Change-Id: Ic21af84f2a6de48d220940f30dad02a0e7683ce8
2020-04-20 18:18:05 +00:00
Vadim Yanitskiy e981f17200 vty: clarify EGPRS Packet Channel Request message support
According to 3GPP TS 44.060, section 12.24, GPRS Cell Options IE
contains two parameters related to 11 bit Access Burst support:

  - ACCESS_BURST_TYPE - whether the 8 or 11 bit format shall be
    used in the PACKET CHANNEL REQUEST message, the PTCCH/U block,
    PACKET CONTROL ACKNOWLEDGMENT and the PS HANDOVER ACCESS
    messages on the PRACH (if present).

  - EGPRS_PACKET_CHANNEL_REQUEST - whether EGPRS capable MSs shall
    use EGPRS PACKET CHANNEL REQUEST message for Uplink TBF
    establishment on the RACH or on the PRACH (if present).

The VTY option 'gprs 11bit_rach_support_for_egprs' actually controls
the second parameter - EGPRS_PACKET_CHANNEL_REQUEST, though it may
be hard to understand this from its name and description.

This patch is actually a group of tightly related changes:

  - deprecate 'gprs 11bit_rach_support_for_egprs (0|1)':
    - update its description to avoid any possible confusion,
    - print a warning if it's used in non-EGPRS mode,
    - print a warning if it's still used;

  - introduce '[no] gprs egprs-packet-channel-request':
    - ensure that it can only set / printed in the EGPRS mode;

  - take a chance to clean-up / rename the related struct members:
    - 'supports_egprs_11bit_rach' -> bool 'egprs_pkt_chan_request',
    - remove 'supports_egprs_11bit_rach' from 'gprs_cell_options'
      because we already have 'ext_info.use_egprs_p_ch_req' there.

Change-Id: Ied5bd10a806aeeac65ef32339d4ab0e3700e5da9
2020-04-14 15:50:10 +00:00
Eric Wild 93920fa41b configure.ac: fix libtool issue with clang and sanitizer
As pointed out at https://github.com/libexpat/libexpat/issues/312
libtool does not play nice with clang sanitizer builds at all.
For those builds LD shoud be set to clang too (and LDFLAGS needs the
sanitizer flags as well), because the clang compiler driver knows how
linking to the sanitizer libs works, but then at a later stage libtool
fails to actually produce the shared libraries and the build fails. This
is fixed by this patch.

Addtionally LD_LIBRARY_PATH has no effect on conftest runs during
configure time, so the rpath needs to be set to the asan library path to
ensure the configure run does not fail due to a missing asan library,
i.e.:

SANS='-fsanitize=memory -fsanitize-recover=all -shared-libsan'
export CC=clang-10
ASANPATH=$(dirname `$CC -print-file-name=libclang_rt.asan-x86_64.so`)
export LDFLAGS="-Wl,-rpath,$ASANPATH $SANS $LDFLAGS"

Change-Id: If71654d87b375b4b882ab527e89353cd035f695b
2020-04-11 01:17:17 +02:00
Vadim Yanitskiy b6238b9375 vty: 'gprs 11bit_rach_support_for_egprs': clarify error message
Change-Id: I491d319f2829902a8c449db515f928cf7e480482
2020-04-06 19:00:05 +07:00
Vadim Yanitskiy 9a5b8bb031 vty: 'gprs 11bit_rach_support_for_egprs': drop redundant check
The VTY command parser would not allow values other than 0 or 1.

Change-Id: Ic29fac12414f1821702759a9f5260e941c9868b5
2020-04-06 19:00:05 +07:00
Vadim Yanitskiy 0c94d7257e rest_octets: cosmetic: fix alignment in gprs_cell_options
Change-Id: I344ea61df8cc910d9b524c9b2f0e03721eefe56c
2020-04-06 19:00:05 +07:00
Vadim Yanitskiy f06b9bf1c6 doc/manuals: remove deprecated DNAT from the VTY reference
Change-Id: Ib21c30041508a9ec9afda56bda95bddf4d665bc8
2020-04-05 00:39:45 +07:00
Vadim Yanitskiy 9077f1ab6c vty: fix: restore removed DNAT category as deprecated
This logging category has been removed in [1], what caused test
case execution failures on our Jenkins (since build #930). The
problem is that configuration files may still contain this
category in 'logging' section (see [2], [3], [4]), and
osmo-bsc would refuse to start because of that.

[1] Id965295dfe04f8bd5ce831db70c86f67b8dc290b
[2] Ie2afacfc15589c26238214cddc00baaf80e993c1
[3] I266d6f6ed54d1457b1ca63b87fc1c29f6dd40caf
[4] If02272c08ba2df37d1295d09c104d11f96abbe1e

Change-Id: I111362d19aba325889bada5a46eea62343c30033
2020-04-05 00:33:04 +07:00
Harald Welte 25e41af2d9 remove 'NAT' log category
This dates back to a time where osmo-bsc_nat was in the same repository,
which is a long time ago.

Change-Id: Id965295dfe04f8bd5ce831db70c86f67b8dc290b
2020-04-01 11:57:37 +02:00
Neels Hofmeyr 6ab7a52b67 manual: add SCCPlite section
Change-Id: I8eddc47353d6afd756865321a9e97f6cee4ce2d7
2020-03-30 15:57:57 +00:00
Neels Hofmeyr b5a25b0137 manual: add SCCP/M3UA section from common chapters
Link to the osmo-gsm-manuals/common/cs7-config.adoc chapter to fully explain
the 'cs7' client configuration.

Related: OS#2767
Depends: Ia2508d4c7b0fef9cdc57e7e122799a480e340bf7 (osmo-gsm-manuals)
Change-Id: I5b4973901f02046322b852fd9862517982d21bd9
2020-03-30 15:57:57 +00:00
Keith Whyte b6c6253038 Meas Tools, Avoid compiler format warnings
Change-Id: I8d807ffc4571f2954e3d1083da673dc1235e7687
2020-03-29 14:23:44 +00:00
Keith Whyte 2c92f3c44f Meas Tools: Avoid unusable terminal in case of error on osmo_sock_init
If, as before this patch we call initCDKScreen() before
attempting to bind the socket, then the socket bind fails,
we exit and the terminal needs a reset.

Attempt to open the socket before initCDKScreen()
so we don't end up with a messed up terminal if the socket
call fails.

Change-Id: Ia5148d9ef386df314bc2837b3cb672150250bd2a
2020-03-29 00:20:42 +00:00
Keith Whyte 85fe6104c5 Meas Tools: Avoid OSMO_ASSERT due to uninitialised logging.
The measurement tools use libosmocore socket functions that will
use logging if the socket cannot be opened, but the tools did
not initialise logging, resulting in

 Assert failed osmo_log_info logging.c:235
 backtrace() returned 9 addresses
 [.....]

Initialise logging so that we get a nicer and more informative
message, such as:

 unable to bind socket:(null):8888: Address already in use
 no suitable addr found for: (null):8888

Change-Id: Ib3b3558723682defcee22e7ea2d8bf5c2cff1278
2020-03-28 15:25:07 -05:00
Oliver Smith b5bfa71aa2 VTY: regenerate bsc_vty_reference.xml
Change-Id: I27bcde8d36dcf8daa9d24b4b581c9526b73cb35e
2020-03-27 10:29:51 +01:00
Oliver Smith da603f0aef VTY: let all descriptions end in \n
Change-Id: I00a183078679db50567286a78c9e4f9afa3466c6
2020-03-27 10:15:01 +01:00
Oliver Smith ba0a12233f VTY: add show bts failure report
Save OML failure reports from each BTS. Add a VTY command to display them
conveniently and optionally clear the list.

OsmoBSC> show bts 0 fail-rep
[2020-03-23 14:51:22] Type=processing failure, Severity=minor failure, Probable cause=Manufacturer specific values: Software warning, Additional text=test message sent from VTY
[2020-03-23 14:51:19] Type=processing failure, Severity=minor failure, Probable cause=Manufacturer specific values: Software warning, Additional text=test message sent from VTY

Related: OS#1605
Change-Id: I18aa17a721cd5eb1c98926dc2367229c0a50bc78
2020-03-27 09:55:30 +01:00
Oliver Smith cd1df9975c abis_nm: move fail report parsing to extra func
Separate raw input parsing from handling the failure report. A follow-up
patch will use the new parsing function to print saved failure reports
to the VTY.

While at it, put struct tlv_parsed inside struct nm_fail_rep_signal_data
instead of a pointer, so we don't need an additional alloc. Also add
error handling to the abis_nm_tlv_parse() call.

Related: OS#1605
Change-Id: Ia51004faf620aa4d40435d58c70d758c9d0054d8
2020-03-26 14:52:02 +01:00
Oliver Smith 33eca64211 abis_nm.c: rx_fail_evt_rep: fix sd.bts
Use the extra bts pointer instead of mb->trx->bts, which does not point
to an allocated bts.

Related: OS#1605
Change-Id: Ie61512f5690763fa380bdf0e7fb4763dbda019d2
2020-03-23 13:49:05 +01:00
Neels Hofmeyr 21a2c81da4 manual: add "Multiple Instances" section, akin to other manuals
Related: OS#2767
Change-Id: Ideb137f19d19144d35b05eb036098045bbb18d64
2020-03-22 19:23:55 +00:00