Commit Graph

271 Commits

Author SHA1 Message Date
Harald Welte 5d9cb9f555 osmo-bts-trx/loops.c: Use lchan name based logging
The loops.c code dates back to ancient times when we printed the TRX
number and the raw channel number to identify a logical channel.  We
meanwhile have gsm_lchan_name() and should use it to log messages
related to this lchan in a common format.

This commit introduces the LOGPLCHAN() helper macro [similar to
osmo-bsc], and uses it from loops.c.

As a result, some functions don't need a chan_nr argument anymore,
while some need to add a new lchan argument.

Change-Id: I6976dd7444c26b1f52741bc367b0311ebbef1718
Related: OS#1622, OS#1851
2018-12-23 10:38:23 +00: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 47c8f37c9f cosmetic: fix whitespace
Change-Id: Iaa4552844db33fe69da5ed7028dbfa0100c33900
2018-11-26 14:08:14 +01:00
Max ecfb83d3cc Drop unused function
Change-Id: Ib1ecc6dcb243da27976ca0e90a83aefa18a65b76
2018-11-22 10:54:37 +00: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
Omar Ramadan 9c75c387c0 Add OC-2G BTS sources
Change-Id: I327384fe5ac944dc3996a3f00932d6f1a10d5a35
2018-10-27 11:35:58 +00:00
Vadim Yanitskiy ee9e8e9eb2 common/scheduler.c: track TDMA frame loss per logical channels
This change modifies the logic of TDMA frame loss tracking. To
be more precise, the tracking logic was moved from per timeslot
level to per logical channel level, what makes OsmoBTS more
accurate in its measurements.

But before getting into details, it's important to clarify some
things about the Uplink burst processing in transceiver (OsmoTRX).
If an Uplink burst is detected, OsmoTRX demodulates it and sends
to OsmoBTS. If nothing is detected on a particular timeslot,
OsmoTRX will do nothing. In other words, it will not
notify OsmoBTS about this.

Meanwhile, there are usually a few logical channels mapped to a
single TDMA timeslot. Let's use SDCCH8 channel configuration as
an example (simplified layout):

  /* SDCCH/8 (ss=0), subscriber A (active) */
  { TRXC_SDCCH8_0,    bid=0 },
  { TRXC_SDCCH8_0,    bid=1 },
  { TRXC_SDCCH8_0,    bid=2 },
  { TRXC_SDCCH8_0,    bid=3 }, // <-- last_fn=X

  /* SDCCH/8 (ss=1), subscriber B (inactive) */
  { TRXC_SDCCH8_1,    bid=0 },
  { TRXC_SDCCH8_1,    bid=1 },
  { TRXC_SDCCH8_1,    bid=2 },
  { TRXC_SDCCH8_1,    bid=3 },

  /* SDCCH/8 (ss=2), subscriber C (active) */
  { TRXC_SDCCH8_2,    bid=0 }, // <-- current_fn=X+5
  { TRXC_SDCCH8_2,    bid=1 },
  { TRXC_SDCCH8_2,    bid=2 },
  { TRXC_SDCCH8_2,    bid=3 },

SDCCH8 has 8 sub-slots, so up to 8 subscribers can use a single
timeslot. Let's imagine there are three subscribers: A, B, and C.
Both A and C are active subscribers, i.e. they are continuously
transmitting UL bursts, while B is not using ss=1 anymore.

The original way of TDMA frame loss tracking was the following:

  - when an UL burst is received, store it's frame number in
    the timeslot state structure (last_fn);

  - when the next UL burst is received on same timeslot, compute
    how many frames elapsed since the last_fn;

  - if elapsed = (current_fn - last_fn) is lower than 10, then
    iterate from (last_fn + 1) until the current_fn and send
    dummy zero-filled bursts to the higher layers;

  - otherwise (elapsed > 10), process the current burst,
    and do nothing :/

According to our example, subscriber A is sending 4 bursts, then
nobody is sending anything, and then subscriber C is sending
4 bursts. So, there is a 4 frames long gap between the both
transmissions, which is being substituted by dummy bursts. But,
as the logical channel on ss=1 is not active, they are dropped.

This is not that scary, but the current algorithm produces lots
of false-positives, and moreover is not able to track real frame
drops in longer periods (i.e. >10). So, tracking the frame loss
per individual logical channels makes much more sense.

Let's finally drop this hackish 'while (42) { ... }', and track
the amount of lost / received TDMA frames (bursts) individually
per logical channels. Let's also use the multiframe period as
the loss detection period, instead of hardcoded 10. And finally,
let's print more informative debug messages.

Also, it makes sense to use the amount of lost / received bursts
during the calculation of the measurement reports, instead of
sending dummy bursts, but let's do this separately.

Change-Id: I70d05b67a35ddcbdd1b6394dbd7198404a440e76
Related: OS#3428
2018-10-25 17:51:33 +00:00
Pau Espin 34018dd4c9 Convert lchan CCCH_LCHAN to chan_nr BCCH and viceversa
Before this patch it was being coded as SDCCH4 TS0 SS 0, and as a
result the state LCHAN_REL_ACT_OML applied in opstart_compl in abused
SDCCH4 TS0 SS 4 was not being checked when deciding whether to send a
Chan Act ACK in rsl_tx_chan_act_acknack.

Fixes: OS#3513
Change-Id: I1641960c9ffbb3ed0de74ab5b53e24e5b4ff3397
2018-10-22 13:18:23 +02:00
Harald Welte 173555dab7 Fix computing CCCH block number from frame number
The existing implementation used a simplistic macro, which was wrong
in many ways:

1) it returned a negative value for "fn % 51 < 5" conditions without
   raising any error message or asserting
2) it returned a wrong block number for many different input frame
   numbers, as it didn't account properly for the FCCH/SCH gaps between
   the blocks

Let's replace the simplistic macro with a proper lookup table based on
TS 05.02, and let's OSMO_ASSERT() if this is ever called with non-CCCH
frame numbers.

Change-Id: I11fd6cc558bb61c40c2019e46f56c1fe78ef39f5
Closes: OS#3024
2018-09-30 15:50:01 +02:00
Philipp Maier 27a86005f3 measurement: fix unit-test test_lchan_meas_process_measurement
The unit test that tests lchan_meas_process_measurement() only inputs
test data to lchan_meas_process_measurement() but it is not checked if
the interval end could be detected or not.

- Add a return code to lchan_meas_process_measurement()
- Ensure that the return code is checked in the unit-test

Change-Id: I9e00ce683e8c44528804f65181dbfed9e85e3aed
Related: OS#2975
2018-09-13 14:27:12 +00:00
Philipp Maier c78759055a measurement: remove missed interval end detection
The function is_meas_overdue() was introduced to allow
lchan_meas_process_measurement() to detect when the end of a measurement
interval has been missed. Interval ends may be missed when the SACCH
block of the related measurement interval gets lost. This is due to the
fact that the SACCH block is used as a trigger to start the measurement
result computation.

The idea behind is_meas_overdue() was to check the frame number of the
current measurement against the frame number of the previous measurement
in order to see if there was a measurement for SACCH in between or not.
Unfortunately SACCH and TCH Voice data is not necessarly processed in
order by each phy. Depending on the phy there may be a jitter between
the timing of SACCH and TCH Voice. Depending on the phy this jitter may
be enough to mess up the timing so that we see a SACCH block earlier
than expected. So we can not use the current frame number of TCH Voice
measurements to check for missed SACCH blocks.

Change-Id: Idfdbf64c1f965f35c12559b3995e2b746c74ee9e
Related: OS#3502
Related: OS#2975
2018-09-13 14:27:12 +00:00
Harald Welte d9a1cd994c CBCH: Implement CBCH support for osmo-bts-{trx,virtual}
This patch adds scheduler support for the channel combinations that
substitute SDCCH index 2 for a CBCH in either a SDCCH/8 or SDCCH/4.

Change-Id: Icc15603079a1709ec094f400a9bcf0008211890f
Closes: OS#1617
2018-09-09 15:40:58 +00:00
Harald Welte 02d99db08b CBCH: Move processing via L1SAP
for some historical reason, CBCH handling was not using the normal
L1SAP boundary.  Let's change that and traverse L1SAP just like for
e.g. BCCH which is quite similar to CBCH handling.

This also has the added benefit of logging CBCH via GSMTAP.

Change-Id: Ibdba4c5e808330f8406f441a97fe0e81170fce97
Closes: OS#3534
2018-09-09 15:40:58 +00:00
Philipp Maier bd3462f355 paging: add unit-test to check different bs_ag_blks_res settings
The parameter bs_ag_blks_res, which is loaded into the BTS via the SI3
setting, defines how many of the CCCH blocks shall be used for AGCH. The
remaining CCCH blocks will then be available as PCH for paging.
Unfortunately there is no unit-test yet that verifies that all of the 8
different settings for bs_ag_blks_res.

- Separate the the decision logic that checks if a given fn is part of
  an AGCH into a function to have it available in the unit-test.
- Add a test that checks all possible bs_ag_blks_res settings.

Change-Id: Ib9652f4013a4da3766852f8f03ce9ec5590f6989
Related: OS#1575
2018-08-31 12:44:31 +00:00
Philipp Maier 9b41b36e97 measurement: add unit tests for ts45008_83_is_sub()
The function ts45008_83_is_sub() is an integral part of the measurement
calculation as it automatically tags incoming measurements as SUB
measurements. This is important in the context of DTX. Unfortunately
there is no unit test for this function yet.

- Add unit test for ts45008_83_is_sub()

Change-Id: Ia26774859f4bf31baee075896905079368bddd42
Related: OS#3502
2018-08-29 17:34:49 +02:00
Philipp Maier 510158256b measurement: add unit tests for is_meas_complete()
We do not test is_meas_complete() individually yet, but it is an
integral part of the measurement processings since this function decides
where a measurement interval ends.

- Add unit tests that test TCH/F, TCH/H, SDCCH/4 and STDCH/8

Change-Id: I8f89d9e7092cd65ba4d5c5649140692dcc20bdd6
Related: OS#2987
2018-08-29 07:35:57 +00:00
Philipp Maier 4553890d70 measurement: make sure measurement interval end is detected
the measurement interval end is detected by using the measurement
indication that is related to the SACCH block as a trigger to start the
computation. If the measurement indication for the SACCH gets lost
because the block could not be received then the processing is not
executed. This may cause wrong results or when it happens condecutively
an overflow of the measurement sample buffer.

- Store the frame number of the last received measurement indication
- Use the stored frame number to check if an interval was crossed when
  the next measurement indication is received. If we detect that we
  missed the interval, catch up by running the computation and
  start the next interval.

Change-Id: I3a86cd8185cc6b94258373fe929f0c2f1cf27cfa
Related: OS#2975
2018-08-20 18:27:28 +02:00
Philipp Maier 9feddb7edf measurement: make sure state is reset on chan act.
At the moment only lchan_meas_reset is reset on channel activation.
All other states are not reset. This may lead to irretations in the
first measurement interval if there are still leftover messages from
a previous connection. Lets ensure everything is reset to zero by
zeroing out the whole .meas struct in struct lchan.

- Add a centralized function that does the reset
- Call that function from rsl_tx_chan_act_ack() in rsl.c

Change-Id: I880ae3030df6dcd60c32b7144c3430528429bdea
Related: OS#2975
Related: OS#2987
2018-08-20 12:19:30 +02:00
Philipp Maier b5a28bd967 cosmetic: unify measurement sample handling in one function
In l1sap.c we call lchan_new_ul_meas() and lchan_meas_check_compute()
directly in sequence. Lets unify thos two steps inside measurement.c so
that we only need to call one function from l1sap.c.

Change-Id: If48bc7442dfaab8c36b93949f741de6e836e792a
Related: OS#2975
2018-08-17 16:24:26 +00:00
Vadim Yanitskiy 5d17b97a5b Clarify frame loss counter for l1sched_chan_state
Each logical channel (e.g. SACCH, SDCCH, etc.) has a counter of
lost L2 frames. Let's use a bit better name for it, and correct
its description in the 'l1sched_chan_state' struct definition.

Change-Id: I92ef95f6b3f647170cfd434a970701406b0a7c82
2018-08-01 02:35:07 +07:00
Stefan Sperling 6575f0c3e9 preserve lchan-specific SI overrides on SACCH FILL
During SACCH FILL processing, update lchan SI values only
for lchans which follow BTS-global default values, keeping
lchan-specific overrides in place.

Change-Id: I515bbd9983fa894507386b241863a9aa4d279497
Fixes: eee7247ebe
Related: OS#3173
2018-07-25 12:57:22 +02:00
Harald Welte b7b5c4219c Add min/max/std-dev measurement reporting for TOA256
This patch adds extended processing of the high-resolution TOA256
measurement values.  It adds reporting of the following values
for each RSL MEAS REP for uplink measurements:
* minimum TOA256 value during reporting period
* maximum TOA256 value during reporting period
* standard deviation of  TOA256 value during reporting period

Change-Id: Iea4a4781481f77c6163d82dcd71a844a5be87bf2
2018-06-29 17:53:20 +00:00
Philipp Maier 685ded1929 octphy: add support for 16x oversampling mode
The latest octphy firmware release (octsdr-2g-02.11.00-B1927-alpha),
introduces a 16X oversampling option which is not yet supported in
osmo-bts.

- Add oversampling flag in phy_link.h
- Add VTY commands to enable/disable oversampling
- Add phy messages to enable/disable oversampling
- Add conditional compilation to preserve support for legacy
  header files and firmware

Change-Id: Ib78f92bfe03ff20aa0a257763c90844fb7b87cf0
Related: SYS#4257
Patch-by: Octasic inc.
2018-06-28 16:12:25 +02:00
Pau Espin db330522ea Send DELETE_IND when dropping Imm Assign pending message
This way we give the opportunity to the BSC to release the channel
quicker, otherwise it has to wait until T3101 expires.

Same procedure is already done in rsl.c rsl_rx_imm_ass() when we return
an error (hard limit AGCH queue len reached) from bts_agch_enqueue().

Related: OS#2990
Change-Id: Id9927c0789054ce3ecc7b30380585a1ffe05db5a
2018-06-09 12:02:29 +00:00
Philipp Maier f1e2d08022 rtp: make port range configurable, assign correct port numbers
The current implementation does not allow the user to specify a port
range in which the BTS is allowed to allocate a local RTP port. Also
the ports the BTS picks do not match the policy described in RFC3550.
An RTP Port must be at an even port number and the matching RTCP
port must be at the following (odd) port number. The BTS currently
picks random port numbers for both.

- Add a VTY command to specify a port range in which the BTS may
  assign local ports.

- Pick ports as described in RFC3550.

Change-Id: Id75f1dfaf898ed8750d28b1c4840e188f4cfdc87
Related: OS#2825 OS#2635
2018-05-25 15:41:35 +02:00
Stefan Sperling 5a0f85d00b let osmo-bts log a special notice if OML connection is closed early
A frequent configuration file error is that the unit_id settings of
osmo-bts and osmo-bsc don't match. The BSC already prints an error
in this case. Let the BTS print an error as well.

We use a heuristic for this purpose: If the OML link is dropped within
10 seconds after being established, log a special warning which alerts
the user and recommend a manual configuration file check.

Change-Id: I476ac797458b5a46edea3ae9cfbd491fd7f77f47
Related: OS#3143
2018-05-15 20:58:06 +00:00
Pau Espin c7b206e850 gsm_data_shared.h: Remove unused enum gsm_paging_event
Change-Id: I37c026f0e4d5ed6cbedaa237b259742f44c238b9
2018-04-23 16:56:09 +02:00
Philipp Maier 69d0d50677 osmo-bts-trx: perform error concealment for FR frames
When a bad voice frame is received, it is replaced by
a silence frame. This may cause unpleasant audio effects.

This change implements a functionality to craft a replacement
frame from the last known good frame using ECU implementation
from libosmocodec. At the moment, only FR is supported.

Depends: libosmocore I06a21f60db01bfe1c2b838f93866fad1d53fdcd1
Change-Id: Iae9e69a9578ae305bca42f834694af96a29084e6
2018-04-17 16:34:53 +02:00
Neels Hofmeyr 113e30cb06 use osmo_init_logging2() with proper talloc ctx
Completely drop bts_log_init(), call osmo_init_logging2() directly instead: all
callers of bts_log_init() passed NULL as category string, so all it ever did
was call osmo_init_logging(). The bts_log_info is already declared in the .h.

Here and there also define a proper talloc root context instead of using NULL.

Change-Id: Ic049f77bef74123b95350bcae182a468e0086b9c
2018-04-04 17:54:37 +02:00
Harald Welte 553535f87b Add 'osmo-bts-omldummy' to bring up only OML without RSL
This is used only in integration testing, where in the TTCN-3 testsuite
we currently have no A-bis OML implementation, but only a RSL one.

Change-Id: Id8e5f34091e6e32621d8c8673de7ea848dfd252f
2018-03-17 15:22:51 +01:00
Harald Welte 6d0c67684c virtual: Correctly set+report BTS variant in OML attributes
Change-Id: I76dc47427ec26834859fb737bd319dc379ae8697
2018-03-17 15:14:01 +01:00
Harald Welte d8cd756da4 Get rid of 'struct gsm_bts_role_bts'
gsm_bts_role_bts was introduced at a time when we still shared
gsm_data_shared.[ch] between BSC and BTS, and where we then subsequently
needed a BTS-private structure.  Since that sharing was abandoned quite
some time ago, we can merge gsm_bts_role_bts into gsm_bts and do away
with the bts/btsb dualism in a lot of the code.

Change-Id: I4fdd601ea873d9697f89a748cc77bcf7c978fa3e
2018-03-17 13:40:03 +01:00
Harald Welte 7c4a22dbc4 cosmetic: Move agch_queue to sub-structure of gsm_bts_role_bts
Rathert han have 11 direct members of gsm_bts_role_bts, group them
into a sub-struct as ew do for other parts like interference, laod, ...

Change-Id: Iefecf4b70c1b11c650913f2ae3783718ffb8a36c
2018-03-17 12:24:29 +01:00
Harald Welte 5cef5056ff gsm_data_shared: Remove unused definitions/members/functions
What we remove here is a legacy from sharing this header file with
openbsc/osmo-bsc-sccplite, which we stopped to do quite some time ago
and hence can remove those parts that are only relevant to the BSC but
not to the BTS.

Change-Id: Icac1656da68f6a006a28c779e3b563bbdd905b3d
2018-03-17 12:24:26 +01:00
Neels Hofmeyr 02d1fe87f0 implement support for 3-digit MNC with leading zeros
Record the mnc_3_digits flag from SI and pass on via the PCU interface.

Instead of changing to e.g. osmo_plmn_id, add the flag separately, and instead
of bool use a uint8_t, to not raise any struct packing issues and clarify the
flag's size beyond any doubt.

Bump the PCU interface version to 9.
This is one part of the three identical pcuif_proto.h patches:
- I49cd762c3c9d7ee6a82451bdf3ffa2a060767947 (osmo-bts)
- I787fed84a7b613158a5618dd5cffafe4e4927234 (osmo-pcu)
- I78f30aef7aa224b2e9db54c3a844d8f520b3aee0 (osmo-bsc)

Depends: Id2240f7f518494c9df6c8bda52c0d5092f90f221 (libosmocore)
Change-Id: I49cd762c3c9d7ee6a82451bdf3ffa2a060767947
2018-03-11 00:45:49 +01:00
Alexander Couzens 4046e3b3dd pcuif_proto: add version 8 features
Add PCU_IF_MSG_DATA_CNF_DT and PCU_IF_SAPI_AGCH_DT to bring the
pccif_proto into sync. Both commands are required to support the
rb11 with an osmo-bsc co-located pcu.

Change-Id: I6d330aca26249ee94ece5e415079f0b75c6e8b48
2018-03-02 14:52:17 +01:00
Alexander Couzens f03a3a584c pcu_if: move definition PCU_SOCK_DEFAULT into pcuif_proto.h
PCU_SOCK_DEFAULT is defined in the pcu counterpart of the file pcuif_proto.h
To be consistent with the pcu move the definition pcuif_proto.h
The pcuif_proto.h will be exact the same in the pcu repo and bts repo.

Change-Id: I67f8ec036e219994cc296d0ed5409da7f3ec681e
2018-03-02 08:57:37 +00:00
Alexander Couzens e1ff92b8dd pcuif_proto: correct indention of gsm_pcu_if_data
Change-Id: I39f3bc1f0a1e238f8f00cb00e2d1e5193f118c16
2018-02-28 09:43:49 +00:00
Harald Welte 5bd6132c04 Add high-accuracy ToA value to Uplink Measurement Reports
Normal Abis RSL MEasurement Results contain only the "MS Timing Offset
IE" in units of full symbols.  In some use cases it is important to have
higher-accuracy timing information exposed to the BSC.

We do this by adding the average timing offset value during the last
measurement interval in 1/256th symbol accuracy to the "Supplementary
MEasuremen Information" part of the TS 48.058 9.3.25 Uplink Measurements
IE.

In order to avoid any compatibility issues, this feature is only enabled
if the new vty config command "supp-meas-info toa256" at the bts node
is enabled.

Change-Id: Ie85e53b47d4041cc4e6d7b78406ae8b79b2d9397
2018-02-27 20:00:16 +01:00
Harald Welte 916d508bf6 measurement: Keep average of high-accurate ToA value in lchan
At the end of a measurement processing window, we currently compute
the ToA / timing offset at 1/256th symbol accuracy, but we only print
it to the log.  Let's store the value in the lchan to make it usable
by other code in follow-up patches.

Change-Id: I5f00a16ac966b627d9452a98b8fa70984bed684a
2018-02-27 20:00:16 +01:00
Harald Welte acefd0586e L1SAP: Increase resolution of reported burst timing
Before this patch we had:
* osmo-bts-trx internally using 1/256th bit/symbol period
* osmo-bts-sysmo internally using 1/4 bit/smbol period
* PCU interface using 1/4
* L1SAP interface using 1/4
* measurement processing code on top of L1SAP using 1/256

So for sysmo/lc15/octphy we are not loosing resolution, but for
osmo-bts-trx we're arbitrarily reducing the resolution via L1SAP
only then to compute with higher resolution again.

Let's change L1SAP to use 1/256 bits and hence not loose any resolution.
This requires a corresponding change in libosmocore for l1sap.h, which
is found in Change-Id Ibb58113c2819fe2d6d23ecbcfb8b3fce4055025d

Change-Id: If9b0f617845ba6c4aa47969f521734388197c9a7
2018-02-27 20:00:16 +01:00
Harald Welte c092f4e1de measurement.c: higher-precision TA/TOA math
Change-Id: I0dc8e78545465dfc5c93691a49b86b6b8b56b432
2018-02-27 19:59:00 +01:00
Harald Welte d5bbd8ccf7 trx/scheduler: Use integer math for TOA (Timing of Arrival)
There's no need to express TOA as a float:
* We receive it as signed 16bit integer in units 1/256 symbol periods
* We pass it to L1SAP as signed integer in 1/4 symbol periods

So turn it into an int16_t with 1/256 symbol period accuracy throughout
the code to avoid both float arithmetic as well as loosing any precision.

Change-Id: Idce4178e0b1f7e940ebc22b3e2f340fcd544d4ec
2018-02-27 19:58:20 +01:00
Harald Welte b3a2a3e24f RACH decoding: Use BER threshold for RACH ghost detection
When decoding RACH bursts, we should use a BER threshold in order to
help distinguish 'ghost' RACH bursts from real RACH bursts.

The theoretical ideal threshold according to some papers is 7 out of 41
bits qhich aquals to Eb/N0 of 0 dB = 0.1707 (17.07%)

We add a new 'ber10k' parameter to the RACH indication l1sap primitive
(needs separate change for libosmocore), and then fill this value from
osmo-bts-{sysmo,lc15,trx,octphy}.  The common part above L1SAP then
applies the threshold, which can be changed from vty using the
	"max-ber10k-rach <0-10000>"
command available at the BTS node.  The unit is BER in 1/10000, i.e. a
value of 100 equals 1% bit error rate.

Change-Id: Ic41c11f6312a36baa2738547e8dcec80829457f8
2018-02-27 17:27:46 +01:00
Harald Welte 6381900677 split scheduler_mframe.c from scheduler.c
There are use cases for the multiframe scheduler tables outside the
context of the entire scheduler. Let's prepare for that.

Related: OS#2978
Change-Id: I6a501e66c47809ae3cdc55bef2cb6390ee0096b1
2018-02-26 15:01:08 +01:00
Harald Welte 49a8969bd6 counters: split rach:sent into rach:drop, rach:ho, rach:cs and rach:ps
Change-Id: I51e9938df0e05b8fdb12686b9a9bb6994546deed
2018-02-26 13:48:11 +01:00
Harald Welte d7f8a1c16e BTS: add rate_ctr about CCCH (paging, agch, pch)
Change-Id: Id6c833746150a3c2e32b00ea6604669f16b84bc4
2018-02-24 19:26:42 +01:00
Harald Welte 1effad1004 measurement.c: Hand Frame Number into measurement computation
This is currently only used for logging, but will be needed for proper
RX{LEV,QUAL}-SUB reporting in upcoming patches.

Related: OS#2978
Change-Id: I07fd06e8a379cab7c0c2eb111c3f5600037d3c9e
2018-02-23 19:57:44 +01:00
Harald Welte b82b81b256 scheduler: add trx_sched_is_sacch_fn() function
For proper measurement processing of RX{LEV,QUAL}-SUB, we will
need this information.

Related: OS#2978
Change-Id: I768fde62452a74dce471ebf946e56eb1e4de1abc
2018-02-23 14:27:45 +00:00
Harald Welte 6eb3752511 Introduce + use LOG/DEBUGP with frame number prefixing/printing
Let's make sure whenever we do have a frame number, we print it as
context in the related log line

Change-Id: I751d5ddb3322fce489bc241459738cbcc55c890b
2018-02-22 12:31:48 +01:00