Commit Graph

154 Commits

Author SHA1 Message Date
Martin Hauke b378fccef1 Fix common misspellings and typos
Change-Id: I403b9029f57fec3fdec2c1e2cbeac0f6eab53f24
2019-10-17 08:05:35 +00:00
Oliver Smith 5fee4d1ff5 log: set L1 SAPI log context
Add a new common L1 SAPI enum, to unify all the BTS specific SAPIs.
Translate to this enum, and set the context for uplink messages in
each BTS specific implementation.

Set the context for downlink messages in the common l1sap code, by
converting the osmo_phsap_prim back to the SAPI value (mostly looking at
chan_nr). The new functions for doing this conversion,
get_common_sapi_by_trx_prim() and get_common_sapi_ph_data(), are based
on the existing to_gsmtap() and gsmtap_ph_data() functions.

Note that we can't set the uplink SAPI context in the common code,
because then we can't set it as early as possible. In this patch, the
SAPI context is set for the PHYs where the SAPI is readily available.
With additional conversion from the RSL channel, the SAPI context could
be set for osmo-bts-trx in a follow up patch.

Related: OS#2356
Depends: (libosmocore) I814cb3328d99faca9220adb5a80ffb934f219d7d
Change-Id: I6b7bb2e1d61502b61214f854a4ec5cbb7267545b
2019-10-11 10:46:02 +00:00
Vadim Yanitskiy df51be6329 L1SAP: there can be no DATA.ind primitives on PTCCH/U, reject them
Change-Id: Ib846a9b8e619c7da56b5f0a54d16f629913af80d
2019-10-09 16:45:48 +00:00
Vadim Yanitskiy d73832bc35 L1SAP: use GSMTAP_CHANNEL_PDTCH for PDTCH blocks by default
We don't know whether a data block on PDCH belongs to PDTCH or PACCH
without parsing it, because the latter one is being allocated on
demand. Let's use GSMTAP_CHANNEL_PDTCH by default, rather than
GSMTAP_CHANNEL_PACCH.

Change-Id: I7639215ef936a8ac05ca417a91f4e12755f318d4
2019-10-09 16:45:48 +00:00
Vadim Yanitskiy 2cbdeba5cf L1SAP: fix gsmtap_pdch(): there can be no DATA.ind on PTCCH/U
Change-Id: Id69010ffa8c697e8c01bbb21509253c330f95343
2019-10-09 16:45:48 +00:00
Vadim Yanitskiy 43a8ed2b55 L1SAP: use the actual ARFCN for outgoing PCUIF messages
Change-Id: I07b3aac97603d85fb6cf077d3a342b12b0643171
2019-10-09 16:45:48 +00:00
Vadim Yanitskiy eb43c947c1 L1SAP: properly handle 11-bit encoded RACH.ind in gsmtap_ph_rach()
Change-Id: Id263c2b716fd282d37d705a1c5f430ce7c0edaf0
2019-10-09 03:18:30 +07:00
Vadim Yanitskiy 29e47ffc20 L1SAP: refactor handling of Access Bursts on PDCH
First of all, we also need to apply the same filtering to Access
Bursts on PDCH as for the normal ones on RACH, i.e. filter them
by ToA (Timing of Arrival) and BER (Bit Error Rate).

Secondly, we shall not interpret Access Bursts on PDTCH/U as
handover related ones. Instead, let's print a warning and
ignore them since they are not (yet) supported by OsmoBTS.

Finally, in gsmtap_pdch() we need to set a proper channel type
for Access Bursts received on PDCH (PDTCH/U or PTCCH/U).

Change-Id: I461fde9f4543c45c42b591cd3fd0ff3d98673cec
2019-10-09 03:13:31 +07:00
Vadim Yanitskiy d7103f9172 L1SAP: do not pass unused parameter to l1sap_handover_rach()
Change-Id: I7f2d909f1bde09cbec106240df290381b3418e46
2019-10-09 03:01:58 +07:00
Vadim Yanitskiy 91fc2b9e30 L1SAP: clarify debug messages in rach_pass_filter()
RACH stands for Random Access CHannel, while in rach_pass_filter()
we're dealing with Access Bursts, that may be received on other
logical channels too (e.g. PTCCH, PDTCH or any other).

Change-Id: I1e5ca9930ab491a6916c972865154d54530cbf51
2019-10-09 03:01:43 +07:00
Vadim Yanitskiy 41c7b05283 common/l1sap: increase ToA precision for packet Access Bursts
QTA is a Timing Advance value in units of 1/4 of a symbol. Let's
use ToA256 (1/256 of a symbol) field of L1SAP RACH.ind as a base
for QTA calculation in order to achieve better precision.

Change-Id: I6e6fa7985c430a9bdbd12af2a8b2a5a66f11a41c
2019-10-04 15:53:53 +00:00
Vadim Yanitskiy df5b813c0f scheduler: fix handling of PTCCH/U and PTCCH/D logical channels
According to 3GPP TS 45.010, section 5.6.2, for packet-switched
channels the BTS shall monitor the delay of the Access Bursts
sent by the MS on PTCCH and respond with timing advance values
for all MS performing the procedure on that PDCH.

According to 3GPP TS 45.002, section 3.3.4.2, PTCCH (Packet Timing
advance control channel) is a packet dedicated channel, that is
used for continuous Timing Advance control (mentioned above).

There are two sub-types of that logical channel:

  - PTCCH/U (Uplink): used to transmit random Access Bursts
    to allow estimation of the Timing Advance for one MS in
    packet transfer mode.

  - PTCCH/D (Downlink): used by the network to transmit
    Timing Advance updates for several MS.

As per 3GPP TS 45.003, section 5.2, the coding scheme used for
PTCCH/U is the same as for PRACH as specified in subclause 5.3,
while the coding scheme used for PTCCH/D is the same as for
CS-1 as specified in subclause 5.1.1.

The way we used to handle both PTCCH/U and PTCCH/D is absolutely
wrong - they have nothing to do with xCCH coding. Instead, we
need to use tx_pdtch_fn() for Downlink and rx_rach_fn() for Uplink.

In l1sap_ph_rach_ind() we need to check if an Access Burst was
received on PTCCH/U and forward it to OsmoPCU with proper SAPI
value (PCU_IF_SAPI_PTCCH). To be able to specify a SAPI, a new
parameter is introduced to pcu_tx_rach_ind().

Change-Id: I232e5f514fbad2c51daaa59ff516004aba97c8a3
Related: OS#4102
2019-10-04 15:53:53 +00:00
Pau Espin 76837bddb7 l1sap: Log conn dropped due to radio link counter timeout
Change-Id: I78c5ff00be8d2c870ed0277294a8e499ba8a8d95
2019-10-02 19:03:41 +02:00
Vadim Yanitskiy b777c0f3ec Move Access Burst link quality handling to L1SAP
Change-Id: I893ec9c6c2ebad71ea68b2dc5f9f5094dfc43b78
Depends: (libosmocore) Ie2a66ebd040b61d6daf49e04bf8a84d3d64764ee
2019-07-21 21:55:51 +07:00
Vadim Yanitskiy 9649a42d5a Clarify and refactor link quality (C/I) handling
The radio link quality is defined by C/I (Carrier-to-Interference
ratio), which is computed from the training sequence of each
received burst, by comparing the "ideal" training sequence with
the actual (received) one.

Link quality measurements are used by L1SAP to filter out "ghost"
Access Bursts, and by the link quality adaptation algorithms. One
can define minimum link quality values using the VTY interface.

On the VTY interface we expect integer C/I values in centiBels
(cB, 10e-2 B), while the internal structures are using float
values in deciBels (dB, 10e-1 B). Some PHYs (sysmo, octphy,
oc2g, and litecell15) expose C/I measurements in deciBels,
while on the L1SAP interface we finally send then in centiBels.

Let's avoid this confusion and stick to a single format, that
will be used by the internal logic of OsmoBTS - integer values
(int16_t) in centiBels. This will give us the range of:

  -32768  .. 32767  centiBels, or
  -3276.8 .. 3276.7 deciBels,

which is certainly sufficient.

Change-Id: If624d6fdc0270e6813af8700d95f1345903c8a01
2019-07-21 13:51:57 +00:00
Harald Welte b24ef23570 l1sap: Compute statistics on FN advance in PH-RTS.ind
Let's keep some statistics about the min/max/average frame number
advance that we're observing above L1SAP when comparing the time in the
PH-RTS.ind and the frame number we observe in PH-DATA.ind of data
that was received on the uplink.

The statistics are currently only shown in the VTY, but this is a
precursor to using them to correctly advance the LAPDm timers in a
follow-up patch.

Change-Id: I8f739fdb808a614f080afbc4654641ec3df19eb2
Related: OS#2294
Related: OS#3906
2019-06-13 15:37:13 +00:00
Harald Welte dfa3bb8a10 Add severity to OML FAILURE EVENT REPORT
Example: The fact that the PCU has connected with a given version is not
a *failure* in the first place, particularly not a MAJOR one.  Let's
allow callers of oml_tx_failure_event_rep() specify the serverity of the
event that they're reporting to the BSC.

Change-Id: I49af04212568892648e0e8704ba1cc6de8c8ae89
2019-05-25 10:24:13 +02:00
Harald Welte f2419bf8c3 l1sap: Fix calculation of expired RACH slots in case of missing frame numbers
In case of a Combined CCCH (with SDCCH/4), the number of RACH slots
depends on the frame number.  So in case of lost/skipped frame numbers,
we cannot simply compute the value for the current fn and then multiply
it by the number of frame numbers expired.  Rather, we have to 'replay'
all missed frame numbers and individually determine how many RACH
slots happened in that frame.

Related: OS#3750
Change-Id: If4f8d2ea55fc722c64c330cde09e833b67ee98fe
2019-05-24 11:08:20 +02:00
Harald Welte 03e3fae639 l1sap: Correctly count RACH slots in calc_exprd_rach_frames()
We used a bogus multiplication factor of four when computing the number
of expired RACH slots.  While there are four RACH slots per block (i.e.
4 times more RACH received than normal MAC blocks), that multiplier
doesn't apply here:  We are calling this function per *frame* and not
per *block*.  So the maximum number of RACH slots per *frame* is (in
most suual cases with a single CCCH) at maximum 1. Only some obscure
configurations with multiple CCCHs in a single cell would render higher
values.  In any case, *blocks* never even enter this equation.

This wrong multiplier resulted in rather weird RACH load reports to the
BSC.

Related: OS#3750
Change-Id: I6b14fd6e7819f9164fb4a09b432a9f419e3b6e5c
2019-05-24 11:06:42 +02:00
Harald Welte b07e271994 Use LOGPLCHAN whenever possible
There's no point in open-coding what LOGPLCHAN was created to do:
Log some event while stating the name of the logical channel.

Change-Id: I6913ac8fb543811126b85a54118333155c03bc03
2019-05-24 00:02:34 +02:00
Vadim Yanitskiy 43033e6923 common/l1sap.c: fix: add missing new line to a debug message
Change-Id: I7c0dab255289a5847d1a0af009e8962e4410e5ca
2019-04-21 13:50:21 +00:00
Philipp Maier a5a03d6b35 oml: use oml_tx_failure_event_rep() instead of oml_fail_rep()
The function oml_tx_failure_event_rep() replaces oml_fail_rep(), so lets
use only oml_tx_failure_event_rep() and remove oml_fail_rep()

Change-Id: I83c4fa9ebd519299fd54b37b5d95d6d7c1da24f6
Related: OS#3843
2019-03-27 11:10:57 +00:00
Max 6bc6d78b36 Constify pcu_rx_*() parameters
Use const for data parameter where appropriate.

Change-Id: Ia228c001ca07cfde61b540bec6257b62aec93517
2019-03-18 16:28:33 +00:00
Max faf501e432 Fix type mismatch
llist_count() return unsigned value, let's use it for counter as well.

Change-Id: I81097a64ef694bec046afcc23cf995dc539a706b
2018-11-22 09:02:41 +00:00
Pau Espin 0bbc56b8f3 l1sap: Log name of chan_nr instead of hex value
Change-Id: If98e130d17f1d153a13ba28f48a0a563731fde41
2018-10-10 13:43:04 +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
Harald Welte 3c87f5c3ea get_lchan_by_chan_nr(): Fix resolution of CBCH
The CBCH (as per GSM specs) always maps on sub-slot 2 of either
the SDCCH/4 or SDCCH/8 that it replaces.  However, the way how we
express it as RSL-style channel number (0xC8) doesn't allow room
for any sub-slots.  The top 5 bits are used for expressing CBCH, while
the bottom 3 bits are used for the timeslot number (TN).

So when transforming from channel number to lchan, we must handle the
CBCH case specially by using a hard-coded sub-slot number of 2.

Change-Id: I44e2f763d5d25311167f435f2ca7e030b2a3f009
Related: OS#1617
2018-09-17 21:36:59 +02:00
Harald Welte 7c82b4a872 l1sap/scheduler: Consistently print chan_nr as hex number
It's very confusing if some log messages log chan_nr as decimal, while
most log it as hexadecimal.  Let's standardize on hex everywhere.

Change-Id: Ia6566d5bbee8124fb7c689c962ce34d714208503
2018-09-17 20:53:37 +02: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
Stefan Sperling 0b2893f6fc Revert "send TCH/F fill frames in DTX mode (WIP)"
This reverts commit 9bffa87c11.

This commit was not intended to be merged yet.

Change-Id: Ibd8c0899451ae3c17bc07d4e112e32b4897405c9
2018-08-23 13:29:09 +02:00
Stefan Sperling 9bffa87c11 send TCH/F fill frames in DTX mode (WIP)
Send DTX TCH fill frames according to GSM 05.08, section 8.3.

Change-Id: I7bff00b8cf41dc1b0e6e668173bebce23be0d253
Related: OS#1950
2018-08-22 19:50:33 +00:00
Stefan Sperling 0ab50934d5 fix conditions for sending fill frames during RTS IND
Rewrite an if-statement to better match the description given
in GSM 05.08, and quote the relevant paragraph in a comment.
Since this entire block of code only runs for SDCCH and TCH,
this new condition should provide the same result expect that
in accordance with the standard we now stop sending fill-frames
on a signalling TCH if DTX is in use.

Also note that this code should already cover parts of the
patch proposed at https://gerrit.osmocom.org/c/osmo-bts/+/5753
The changes to osmo-bts-litecell15/l1_if.c proposed there
should be equivalent to the fill-frame logic in this
existing common BTS code which is handling RTS IND.

Change-Id: Ibaf3ecbd0bde4f37e799d5e2f5d00dc695e0139a
Related: OS#1950
2018-08-22 19:50:33 +00: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
Pau Espin 319b1d5bd7 l1sap: add_l1sap_header: Compact msgb_push ret assignment
Change-Id: Ia427c216cd096d313b234ca244eb71837450e2a9
2018-07-19 16:02:09 +02:00
Harald Welte ae3da5f8c3 cosmetic: it's n_r in check_for_first_ciphrd(), not n_s
When we introduced the n_s verification in
2cc37035d7, the variable name n_s was
used for what is actually n_r N(R) read from the LAPDm frame

Change-Id: Iaef1648f35ceae9d7f4cd1d9d5409e05115d199a
2018-05-24 06:08:44 +00:00
Pau Espin 5f17e6138e l1sap: Avoid assumption that l1sap is at head of msgb
This assumption used while sending the rx data to gsmtap in l1sap_up was
making osmo-bts-virtual crash, since that bts model is allocating the
l1sap in the stack rather than inside the msgb.
Instead, let's use the assumption that l2h is set correctly in msgb by
the bts model lower layer.

crash report:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6234ec3 in __memmove_sse2_unaligned_erms () from /usr/lib/libc.so.6
(gdb) bt
0  0x00007ffff6234ec3 in __memmove_sse2_unaligned_erms () from /usr/lib/libc.so.6
1  0x00007ffff6dbf4c8 in gsmtap_makemsg_ex (type=<optimized out>, arfcn=arfcn@entry=17255, ts=ts@entry=6 '\006',
    chan_type=<optimized out>, ss=ss@entry=0 '\000', fn=fn@entry=11249, signal_dbm=0 '\000', snr=0 '\000',
    data=0x5555557d5b50 "", len=4294967263) at libosmocore/src/gsmtap_util.c:179
2  0x00007ffff6dbf6d8 in gsmtap_send_ex (gti=0x555555877f10, type=type@entry=1 '\001', arfcn=arfcn@entry=17255,
    ts=ts@entry=6 '\006', chan_type=<optimized out>, ss=<optimized out>, fn=11249, signal_dbm=0 '\000', snr=0 '\000',
    data=0x5555557d5b50 "", len=4294967263) at libosmocore/src/gsmtap_util.c:311
3  0x00007ffff6dbf765 in gsmtap_send (gti=<optimized out>, arfcn=arfcn@entry=17255, ts=ts@entry=6 '\006',
    chan_type=<optimized out>, ss=<optimized out>, fn=fn@entry=11249, signal_dbm=0 '\000', snr=0 '\000',
    data=0x5555557d5b50 "", len=4294967263) at libosmocore/src/gsmtap_util.c:330
4  0x0000555555573571 in to_gsmtap (trx=0x7ffff7ef8070, l1sap=0x7fffffffde80)
    at osmo-bts/src/common/l1sap.c:397
5  0x0000555555573b9c in l1sap_up (trx=0x7ffff7ef8070, l1sap=l1sap@entry=0x7fffffffde80)
    at osmo-bts/src/common/l1sap.c:1285
6  0x000055555555ec06 in virt_um_rcv_cb (vui=<optimized out>, msg=<optimized out>)
    at osmo-bts/src/osmo-bts-virtual/l1_if.c:170
7  0x000055555555f5c6 in virt_um_fd_cb (ofd=0x55555587cc30, what=<optimized out>)
    at osmo-bts/src/osmo-bts-virtual/virtual_um.c:50
8  0x00007ffff6db6991 in osmo_fd_disp_fds (_eset=0x7fffffffe090, _wset=0x7fffffffe010, _rset=0x7fffffffdf90)
    at libosmocore/src/select.c:216
9  osmo_select_main (polling=polling@entry=0) at libosmocore/src/select.c:256
10 0x0000555555576fbc in bts_main (argc=5, argv=0x7fffffffe288)
    at osmo-bts/src/common/main.c:364
11 0x00007ffff61b5f4a in __libc_start_main () from /usr/lib/libc.so.6
12 0x000055555555c4ca in _start ()

In the old code when the sizeof(osmo_phsap_prim) was being substracted
it resulted on a negative len which later was casted to unsigned int and
became a really big number.

Fixes: OS#3092

Change-Id: I51a880328497673a06d153bfb76c428265b8cbb8
2018-03-21 19:56:10 +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
Vadim Yanitskiy 1ef544ea24 common/l1sap.c: limit the minimal ToA for RACH bursts
In general, RACH bursts should not arrive with negative offset.
Let's limit early signal arrival up to 2 symbols, otherwise it
is most likely noise, interference or a ghost.

TTCN-3 test case: Icccc88545ed3aabd6da28a40599a8a77d1de477d
Change-Id: I662294fe3136cf7a259be13816a3e63f7db9a948
2018-03-05 22:44:08 +07:00
Vadim Yanitskiy 4f14804f8a common/l1sap.c: perform noise / ghost filtering for handover RACH
For some reason, the noise / ghost filtering was performed for
normal RACH requests, but not for handover RACH requests. There
are also ghost RACH, interference and noise possible, so let's
extend the filtering coverage.

Change-Id: I94fc15835280d624780200dadc4418210bf565ff
2018-03-05 20:43:02 +07:00
Vadim Yanitskiy 0dfe137009 common/l1sap.c: clean up noise / ghost RACH filtering
It makes sense to combine both existing BER (Bit Error Rate) and
ToA (Timing of Arrival) checks into a separate funcition, so
this code may be also used for handover RACH.

Change-Id: I1ddda238d5212a88a3dd5c4fc5dfcfea018151bd
2018-03-05 20:29:47 +07:00
Vadim Yanitskiy 53bdf4d949 common/l1sap.c: increment valid RACH counter after all checks
Previously, the number of RACH slots with valid non-handover RACH
burst was incremented between both BER (Bit Error Rate) and ToA
(Timing of Arrival) checks. So, if a RACH burst passed the BER
check, but was dropped by ToA check, the counter of valid RACH
requests could be increased anyway.

Change-Id: I31594a8c5dce1f42226ced5b2dc8778152b3d829
2018-03-05 20:03:06 +07:00
Vadim Yanitskiy 10aa1cd6f6 common/l1sap.c: increase the BTS_CTR_RACH_DROP in RACH BER check
The BTS_CTR_RACH_DROP counter is being increased in case if a RACH
request is ignored due to exceeding ToA value, but remains untouched
in case of exceeding BER (Bit Error Rate). Let's fix this.

Change-Id: Ia02e781d6c47d9d8012a4c8846fe4b731aab74d7
2018-03-05 19:40:55 +07: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 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 c2b4c668f3 Move rach_busy counting above L1SAP
In the past, rach_busy counting was performed below L1SAP, while
reporting was handled above.  This lead to subtle differences between
the BTS models, such as osmo-bts-trx missing to increment rach_busy.

Let's move the rach_busy counting above L1SAP to share more code.

This means we need libosmocore Change-Id
I9439810c3a3ad89ea0302753617b850749af887c for the additional required
parameters in ph_rach_ind_param, as well as libosmocore Change-id
I2b1926a37bde860dcfeb0d613eb55a71271928c5 for osmo-bts-trx to determine
the RACH bit error rate.

Change-Id: I3b989580cb38082e3fd8fc50a11fedda13991092
Closes: OS#3003
2018-02-27 17:27:35 +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 aa9ce821a0 l1sap: Pass is_sub from L1 primitive into the Uplink Measurement
info_meas_ind on the L1SAP always allowed the lower layers to pass
in whether a given measurement is part of the "SUB", or not.

However, the existing l1sap code before this patch simply drops this
information, despite the measurement.c code also having "is_sub" state.

Let's make sure this state is passed from L1SAP into measurement
processing as intended.

Fact is, none of our current lower-layers actually set this is_sub flag
for their primitives passed up in L1SAP, but at least now *if* they
would set that flag, the measurement code would process it as intended.

Related: OS#2978
Change-Id: Ibed2e8d7563b471c6b5dd2214ac4765caf31ed2a
2018-02-23 19:57:52 +01:00