Commit Graph

2650 Commits

Author SHA1 Message Date
Vadim Yanitskiy 66637c68ae vty: add macro for 'bts <0-0> trx <0-0> ts <0-7> lchan <0-1>'
Change-Id: If8e1ee87366a0d301e21161f2d9ddde8383cb744
2021-01-20 22:06:08 +00:00
Vadim Yanitskiy 2627c28188 vty: fix error messages in lchan specific commands
Change-Id: Ic0fba0605fc8a3ffa044f65fdad03b95e7cd8331
2021-01-20 22:06:08 +00:00
Vadim Yanitskiy 66f76223c4 power_control: fix: properly print 'delta' applied to attenuation
Change-Id: I178df05c1a4cb982279b21d07bd69f75b44928da
Related: SYS#4918
2021-01-20 22:04:55 +00:00
Vadim Yanitskiy 3e1dad2a37 power_control: print current RxLev and lower/upper thresholds
This makes the logging messages easier to read and understand.

Change-Id: I5f8c987054b2b01acdb9f525d06ca15bbc577070
Related: SYS#4918
2021-01-20 22:04:55 +00:00
Vadim Yanitskiy bb6765a93c paging: refactor and optimize fill_paging_type_1()
As far as I can see from my perf measurements, bitvec_fill() is called
quite often and takes 0.27% of the CPU.  A more detailed look reveals
that it's indirectly called by fill_paging_type_1() in order to fill
the remaining octets with constant '2B'O padding.

Let's optimize this function:

  - use memset() for padding *before* writing optional P1 Rest Octets;
  - conditionally initialize the bit vector for P1 Rest Octets;
  - use designated initializers instead of memset().

It's generally better to avoid using bitvec_fill() when using memset()
is possible, because the former operates on bits rather than bytes.

Change-Id: I90473356b396e5dd9326598aca025afacca4afc8
2021-01-15 17:36:46 +01:00
Oliver Smith 6351974464 contrib/jenkins: don't build osmo-gsm-manuals
Related: OS#4912
Change-Id: I8ab46680f9b753408e7ac6ef1635f997747325e5
2021-01-13 13:06:39 +01:00
Vadim Yanitskiy cd30a40be1 power_control: BS power shall not be reduced on C0
It does not make sense to trigger the BS power control loop on C0,
as it's only allowed to reduce power on additional transceivers.

Change-Id: I4fdfe097ae6f9edde5f39ed4da8a559a14b3b38f
Related: SYS#4918
2021-01-13 09:52:58 +00:00
Philipp Maier 25b11f473a l1sap: use rxlev_full when no DTX was used
At the moment only rxlev_sub is used to decide when the facch repetition
should be activated, regardless if DTX is used. Lets check if DTX is
actually used and use rxlev_full when DTX is not applied.

Change-Id: I01ba57cf661f0e41b8df209c905f8d135013e472
Related: SYS#5114
2021-01-13 00:32:26 +01:00
Philipp Maier b327c9598c l1sap: acch_repetition fix hysthereis threshold table
The table in repeated_ul_sacch_active_decision() is derived from the
second table in GSM 05.08 8.2.4 but the first table would be correct.
Also the lower threshold is not properly choosen. A lower threshold,
that derives from upper threshold shifted by 2 makes sense (BER must
improved by 2 RXQUAL steps before repetition is turned off.)

Change-Id: I1d9b5c8abb79938cdecdafed84ed2e5d47e0bd3a
Related: SYS#5114
2021-01-12 22:35:56 +01:00
Vadim Yanitskiy ef53ffe8bb power_control: rework handling of DL RxQual measurements
This change makes BS power control loop:

  - take the lower RxQual threshold (L_RXQUAL_XX_P) into account, so
    the BS power is increased only if RxQual exceeds this threshold;

  - apply the configured increase step size instead of reducing the
    current attenuation by half.

MS power loop is not affected, it does not even handle RxQual yet.

Change-Id: Ib3c740b9a0f3ba5dfb027e144dc13f456cb26ae2
Related: SYS#4918
2021-01-08 20:14:00 +01:00
Vadim Yanitskiy ef99e36626 power_control: use more reasonable reduce step size
It makes more sense to use a reduce step size that is smaller than
the increase step size.  This way both MS/BS power control loops
would be able to react quickly of the signal gets weaker, while
the good signal would not trigger radical power reduction.

Change-Id: Ie358fd828a68bfa1d23559197e8df8478fb4535e
Related: SYS#4918
2021-01-08 19:42:22 +01:00
Vadim Yanitskiy e920902e25 power_control: properly track the first initial state
Change-Id: I16e7474b5affbd90855a2e407b305e9dec581dfa
Related: SYS#4918, SYS#4917
2021-01-08 02:30:46 +01:00
Vadim Yanitskiy 834ba05cd2 power_control: generalize measurement pre-processing state
This way EWMA based filtering can also be applied to RxQual.

Change-Id: I439c00b394da670e314f217b3246cc85ce8213c6
Related: SYS#4918, SYS#4917
2021-01-08 02:23:56 +01:00
Vadim Yanitskiy e8f857453d power_control: migrate MS/BS control loops to the new params
In change [1] the new power control structures and default params
were introduced.  In change [2], the existing VTY commands for MS
power control in the BTS were deprecated and changed to use the
new structures as storage.  Finally, in change [3], handling of
the power control parameters on the A-bis/RSL was implemented.

This change is the final logical step in the mentioned chain: it
makes both MS/BS power control loops use the new parameters, and
removes the old structures.  The actual implementation of both
power control loops remains the same, however the expected output
of some unit tests for the Downlink loop needs to be changed:

  - TC_fixed_mode: disabling dynamic power control becomes a separate
    step of the test script since the field 'fixed' is removed;

  - TC_rxlev_target: RxLev thresholds are printed 'as-is'.

Not all of the new parameters are used by the power control loops
yet.  Further improvements to be done in the follow up commits.

[1] I6d41eb238aa6d4f5b77596c5477c2ecbe86de2a8
[2] Icbd9a7d31ce6723294130a31a179a002fccb4612
[3] I5a901eca5a78a0335a6954064e602e65cda85390

Change-Id: Ib18f84c40227841d95a36063a6789bf63054fc2e
Related: SYS#4918
2021-01-08 02:05:27 +01:00
Vadim Yanitskiy 4a0a6fd014 vty: add a command to show GPRS related info
Here is a sample output:

  OsmoBTS# show bts 0 gprs
  BTS 0, RAC 0, NSEI 101, BVCI 2
    Cell NM state: Oper 'Enabled', Admin 'Unlocked', Avail 'OK'
    NSE NM state: Oper 'Enabled', Admin 'Unlocked', Avail 'OK'
    NSVC0 (NSVCI 101) NM state: Oper 'Enabled', Admin 'Unlocked', Avail 'OK'
      Address: r=127.0.0.1:23010<->l=0.0.0.0:55385
    NSVC1 (NSVCI 0) NM state: Oper 'Disabled', Admin 'Locked', Avail 'Off line'

This command is useful for debugging NS connection problems.

Change-Id: I149eea0b1c109020406eb67c9082c335a77aab06
2021-01-07 13:58:21 +01:00
Vadim Yanitskiy 9238c3549d power_control: handle MS/BS Power control params on A-bis/RSL
Change-Id: I5a901eca5a78a0335a6954064e602e65cda85390
Depends: I2f4ed56837dd479dbbd10c0a7df0ed7565d3946a
Related: SYS#4918
2021-01-07 00:38:55 +00:00
Vadim Yanitskiy f0089a8495 power_control: vty: deprecate 'uplink-power-control' commands
MS/BS Power Control parameters have been recently moved to the BSC
and now signaled to the BTS over the A-bis/RSL link.  Let's make
sure that the existing VTY commands for Uplink Power Control do:

  - trigger deprecation warnings if present in the config file,
  - not show up in the online VTY help nor VTY reference,
  - affect the fall-back parameters in 'struct gsm_bts',
  - still get printed by 'show running-config' command.

Change-Id: Icbd9a7d31ce6723294130a31a179a002fccb4612
Related: SYS#4918
2021-01-07 00:38:55 +00:00
Vadim Yanitskiy 7a8c9dbad7 power_control: vty: re-use cfg_bts_ul_power_target()
This reduces code duplication by defining an alias.

Change-Id: I37f51d426fcf008c9d9e933827de70ab7b072a94
Related: SYS#4918
2021-01-07 00:38:55 +00:00
Vadim Yanitskiy 22646cb122 osmo-bts-trx: vty: clarify and improve some deprecation messages
Change-Id: I22b69eccfa50d178bd36bf770f7158ec441c9923
Related: SYS#4918
2021-01-07 00:38:55 +00:00
Harald Welte e0b9570cde major README uppdate
* use https for hyperlinks
* update known limitations
* VTY manuals are now per backend

Change-Id: Ib897e0248299b9a105140090528b790f53c16e40
2021-01-06 13:24:24 +01:00
Vadim Yanitskiy 9b6c149e42 sysinfo: fix less-than-zero comparison of an unsigned value
size_t is an unsigned type, while get_si4_ro_offset() returns int.

Change-Id: I3b216b70fbcc653ced734835ccb2c7f1932d9f0a
Fixes: CID#215888
2021-01-05 14:12:06 +00:00
Vadim Yanitskiy e476629bcf l1sap: fix: enable UL SACCH repetition if RxQual threshold is 0
It is expected that setting RxQual threshold to 0 would make the
L1SAP logic enable repetition for both Uplink SACCH and Downlink
FACCH unconditionally.  However, this was only valid for the
later.  Let's add the missing check and make it consistent.

Change-Id: Ia44a134e7f28ea990798d1b79c87b644504c0876
Related: SYS#5114
2021-01-05 12:21:23 +01:00
Vadim Yanitskiy 763ce0627a power_control: add VTY introspection commands for MS/BS params
Change-Id: I34095673bf49deb390d5e8383c4ee05a6915b82f
Related: SYS#4918
2021-01-04 21:49:21 +00:00
Vadim Yanitskiy 5f909b45c5 power_control: check-in new parameters and default values
For the sake of simplicity, the old structures that are still used
by MS/BS power control loops are kept in place.  Migration to the
new structures requires additional changes to the existing power
control logic, so it will be done in the follow-up changes.

The new parameters are integrated as follows:

  + struct gsm_bts - a BTS instance:
  |   Hard-coded default (fall-back) parameters for all transceivers.
  |
  +-+-> struct gsm_bts_trx - a TRX instance (transceiver):
    |     Default parameters for all logical channels inherited from
    |     'struct gsm_bts' at start-up.  May be overwritten by the
    |     BSC using ip.access specific 'Measurement Pre-processing
    |     Defaults' message on the A-bis/RSL interface.
    |
    +---> struct gsm_lchan - a logical channel (e.g. TCH or SDCCH):
            Connection specific parameters inherited from 'struct
            gsm_bts_trx'.  May be overwritten by parameters sent
            by the BSC in CHANnel ACTIVation and other messages.

Change-Id: I6d41eb238aa6d4f5b77596c5477c2ecbe86de2a8
Related: SYS#4918
2021-01-04 21:49:21 +00:00
Pau Espin Pedrol 20cbf7bc67 cosmetic: sysmobts-mgr: fix whitespace indentation
Change-Id: I8449a34998808f7e13cc5d1eafb5420b1cc0a9d4
2021-01-04 18:07:23 +01:00
Harald Welte ecf4879403 fix-up missed review comment in CBCH SI4 patching fix
This is a follow-up fix for I0ee0cf736e2fb74a6759a68101f699b4ec2ef54e

get_si4_ro_offset() itself already checks if it's less than GSM_MACBLOCK_LEN,
so we must check if it's not negative.

Change-Id: Iba99e5de625af6bed6720a38fec26c2acc6251c0
2021-01-03 10:28:55 +01:00
Harald Welte 129cb51597 sysinfo.c: Fix SI4 GPRS patching which overwrote CBCH IE
In Change-Id I1fd513ea03297918d15d4b28ed454f9b6dd6ebfa we introduced
patching of SI4 to indicate GPRS presence in terms of PCU connection
status.  Unfortauntely this didn't account for optional IEs being
present in SI4, and hence overwrote any CBCH related information
elements, if present.

This in turn meant that since the above-mentioned commit, you could
have either a GPRS-capable, network, or a Cell Broadcast capable one.

Change-Id: I0ee0cf736e2fb74a6759a68101f699b4ec2ef54e
Related: OS#3075
2021-01-03 00:46:16 +01:00
Vadim Yanitskiy f158bb614c rsl: remove redundant boolean flag in rsl_rx_chan_activ()
Checking if a given RSL IE is present is a straightforward task,
so there is no need for a special boolean flag.

Change-Id: I6a12930314c79b9c3efabfa575b17f78105fea4c
2020-12-30 18:33:40 +01:00
Vadim Yanitskiy 538c56ef34 vty: fix dump_lchan_trx_ts(): dump dedicated channels only
It does not make sense to dump CCCH/CBCH as dedicated channels:

  OsmoBTS# show lchan
  BTS 0, TRX 0, Timeslot 0, Lchan 4: Type CCCH
    State: ACTIVE
    BS (Downlink) Power Control (autonomous):
      Channel reduction: 0 dB (max 0 dB)
      TRX reduction: 0 dB
      Actual / Nominal power: 13 dBm / 13 dBm
    MS (Uplink) Power Control (autonomous):
      Current power level: 0, -39 dBm (max 0, -39 dBm)
    Channel Mode / Codec: SIGNALLING
    LAPDm SAPIs: DCCH --, SACCH --
    Valid System Information: 0x00000060
    MS Timing Offset: 0, propagation delay: 0 symbols
    Radio Link Failure Counter 'S': 0

so let's only dump SDCCH, TCH/F, and TCH/H.

Change-Id: Id7880de56a93cc9fa4ca576b094cef35ee269822
2020-12-10 15:27:37 +00:00
Neels Hofmeyr 7233fa8623 log: rsl_rx_chan_activ: show chan type as human readable string
Change-Id: I3acf6c18309d3b4093dbc295be622363cb6dbcdc
2020-12-10 15:23:42 +00:00
Vadim Yanitskiy 6904d7dd5d vty: resurrect per-lchan BS/MS Power Control information
Change-Id: I48812383ef0a125e83b9b3761f3f15873d3b37b4
Related: SYS#4918
2020-12-09 21:39:52 +00:00
Vadim Yanitskiy 675618b4f8 power_control: make raise/lower step limitation configurable
Change-Id: Ic37742f46f533865043b3dbcf16ea702e1746f98
Related: SYS#4918
2020-12-09 21:39:52 +00:00
Pau Espin Pedrol 2b416d6d2b nm_channel_fsm: Fix several FSM internal transitions not being made
During the initial implementation I used the wrong function to change
state. As a result, from BSC point of view the BTS was changing state
but the FSM internally was not. "Fortunately", while in state Dependency
the BTS still could cope with that in order to still be operative with
older osmo-bsc, so there was no major breakage, only some error log
message being printed.

Related: OS#4873
Change-Id: Ifd2eefc362fca0aa9e6ae102c7e6dbc1b4f295d6
2020-12-09 14:04:19 +01:00
Vadim Yanitskiy 75162427ad rsl: properly initialize MS/BS Power Control state
struct lchan_power_ctrl_state actually contains more fields,
which also must be initialized on CHANnel ACTIVation.

Change-Id: Id9719088fc6e9479c13e9b327a3466d9e2810a3a
Related: SYS#4918
2020-12-08 13:10:46 +01:00
Vadim Yanitskiy 36743255cd power_control: clarify units in 'struct lchan_power_ctrl_state'
Change-Id: I934f2d1e1064eed7587bc5693ef981bf449a1b81
Related: SYS#4918
2020-12-06 18:59:07 +01:00
Vadim Yanitskiy 237ec6194b power_control: clarify units in 'struct bts_power_ctrl_params'
Change-Id: Icb059ca1f555397be116a424800e4536883b9106
Related: SYS#4918
2020-12-06 18:59:05 +01:00
Vadim Yanitskiy 63c1838c7a power_control: cosmetic: fix weird spacing
Change-Id: Ia5661e82372f958e7cda4041d7b5a1cfb1d64afe
2020-12-06 18:58:11 +01:00
Vadim Yanitskiy 0698c58ebe power_control: implement BS (Downlink) Power Control
We already have MS Power Control, which according to 3GPP 45.008
shall be implemented in the MS to minimize the transmit power in
the Uplink direction.  The BS Power Control may optionally be
implemented by the network side for the same purpose.

Using Downlink signal measurements reported by the MS, the BSS
(either BSC, or BTS) may control Downlink attenuation in a way
that the transmit power remains as low as possible, or remains
in a specific range corresponding to good RxLev values on the
MS side.  This change implements autonomous BS Power Control,
that can optionally be enabled by the BSC.

BS Power Control re-uses parts of the MS Power Control code,
so all parameters can be configured in the same way - via the
VTY interface or a configuration file.  This basically means
that features like hysteresis and EWMA based filtering are
also available for BS Power Control.

The only difference is that RxQual values higher than 0 would
trigger the logic to reduce the current attenuation twice.

Note that one of the unit tests ('TC_rxlev_max_min') fails,
as the power step limitations for raising and lowering look
wrong to me, and the related discussion is still ongoing.

Change-Id: I5b509e71d5f668b6b8b2abf8053c27f2a7c78451
Related: SYS#4918
2020-12-06 18:57:43 +01:00
Vadim Yanitskiy 0ced8dd03e power_control: derive calc_delta() from lchan_ms_pwr_ctrl()
This function will also be used by the BS Power Control logic.

Change-Id: I2525eb2c3f1fdb3d0847a8ad50b30a44d7741a55
Related: SYS#4918
2020-12-04 09:27:48 +01:00
Vadim Yanitskiy 2f53fae01f power_control: do not log averaged RSSI values as 'rx-current'
Similar to I3c07cb6e14acd5a988761bbc51a9c3b60fb22d87, this change
is another step towards separating the common delta calculation
logic from lchan_ms_pwr_ctrl(), since this function will loose
access to the averaged values.

On the one hand, the affected logging statements are getting
less precise; on the other, logging the averaged value as the
actual value ('rx-current') may be even more confusing.

Change-Id: I07007e45c859b4080fbbe520ffb5ccc0bb9c4244
Related: SYS#4918
2020-12-04 09:27:48 +01:00
Vadim Yanitskiy 567ea2a079 power_control: remove a logging statement and early return
This change would allow to separate the common logic from
lchan_ms_pwr_ctrl() and re-use it for Downlink power control.

The logging statement was quite useful during early stages
of development and testing of hysteresis and filtering,
but now we can sacrifice it.

Change-Id: I3c07cb6e14acd5a988761bbc51a9c3b60fb22d87
Related: SYS#4918
2020-12-04 09:27:48 +01:00
Vadim Yanitskiy 2b59a625e8 power_control: lchan_ms_pwr_ctrl(): make use of params/state pointers
Change-Id: I177d82cd61d59256976007fed2f7da400b814789
Related: SYS#4918
2020-12-04 09:27:48 +01:00
Vadim Yanitskiy 08f3eafd02 power_control: generalize and rename lchan_ul_pf_ewma()
This way EWMA based filtering logic can be used not only for
MS Power Control, but also for BS Power Control.

Change-Id: I16c2e1b997f2b8af44d47809420293f072335bbd
Related: SYS#4918
2020-12-04 09:27:48 +01:00
Vadim Yanitskiy f15c44df52 power_control: lchan_ms_pwr_ctrl(): use existing 'trx' pointer
Change-Id: Idf46e47f20f031ff9dded1be1e6c4337d7b423e7
Related: SYS#4918
2020-12-04 09:27:48 +01:00
Vadim Yanitskiy 0e24ace2f1 power_control: lchan_ul_pf_ewma(): do not use lchan->meas.res_nr
This would allow to pass only two pointers:

  - 'struct bts_power_ctrl_params', and
  - 'struct lchan_power_ctrl_state',

and get rid of 'struct gsm_lchan' dependency.  The later is
exactly where all state variables are supposed to be kept.

Change-Id: Idfefca30f4944bc722b4e9d8f1685eb77670a9db
Related: SYS#4918
2020-12-04 09:27:48 +01:00
Vadim Yanitskiy 9381576e18 power_control: generalize power control state structure
Change-Id: I8c6ad8d14349e8a05084c2912644c5202f951f52
Related: SYS#4918
2020-12-04 09:27:48 +01:00
Vadim Yanitskiy fb03b43e24 tests/power: rename s/power_test/ms_power_loop_test/
There will also be bs_power_loop test soon.

Change-Id: I3f58eb85e44825a159af58948f01d9ffd75bceec
Related: SYS#4918
2020-12-02 15:01:10 +01:00
Vadim Yanitskiy 3b1e66af9e l1sap: make sure that UL SACCH is always 23 octets long
Change-Id: I1c8a43337fbc1acfab3c0f0713c75ded95d69512
Related: SYS#4918
2020-12-02 15:01:10 +01:00
Vadim Yanitskiy 369c852022 bts: add Downlink power control parameters
Change-Id: I724f661e9ce5dd75f95fb7b270a89b2e2a73c951
Related: SYS#4918
2020-12-02 13:56:49 +00:00
Vadim Yanitskiy e9b6648761 bts: generalize a struct for UL/DL power control parameters
Change-Id: I504de17fb3c1300c2a3faa6d7d3a9eb1b74b214b
Related: SYS#4918
2020-12-02 13:56:49 +00:00