Commit Graph

562 Commits

Author SHA1 Message Date
Vadim Yanitskiy b828b32f31 osmo-bts-trx: store pointer to gsm_lchan in l1sched_chan_state
This change simplifies access to generic logical channel state
(struct gsm_lchan) from osmo-bts-trx specific state (struct
l1sched_chan_state), so there is no need to look it up using
get_lchan_by_chan_nr() on receipt of each Uplink burst.

Change-Id: Ic4378020f980845b962f71b9e4b7faea738bc174
2020-06-15 20:55:23 +07:00
Vadim Yanitskiy ae781bc5cd osmo-bts-trx: introduce and use struct trx_dl_burst_req
This change is similar to what we did for Uplink bursts:

  - group all Downlink burst parameters into a single structure,
  - allocate it once and pass a pointer to lchan handlers,
  - pass a pointer to trx_if_send_burst().

Given that the structure is allocated and (zero-)initialized in
trx_sched_fn(), we can get rid of some memset() calls in lchan
handlers and thus improve the overall performance a bit.

Change-Id: If3014e69746559963569b77561dbf7b163c68ffa
2020-06-15 10:42:03 +00:00
Pau Espin adf5d3aed2 bts-trx: Implement power ramping during BTS bring up
The nominal transmit power is still only configurable manually from
osmo-bts-trx VTY interface. Support to retrieve the nominal power
from osmo-trx will come later.

Change-Id: Ia7c353e4c199e0fc3bcab55c45a4abda2c66d2c1
2020-06-12 09:59:56 +00:00
Vadim Yanitskiy 578156b815 Do not mix public and private BTS features, use libosmocore's API
It was a very bad idea to mix "public" BTS features, that are
reported to the BSC via OML, and those features, that are used
locally (and exclusively) in osmo-bts.

Why? At least because we already have the BTS feature manipulation
API in libosmocore, that is used by osmo-bsc, but for some reason
not by osmo-bts. New features added to libosmocore would clash
with the existing "internal" ones like BTS_FEAT_MS_PWR_CTRL_DSP.

So what this change does can be described as follows:

  - remove duplicate definition of the "public" features,
  - use libosmocore's API for the "public" features,
  - separate both "internal" and "public" features:
    - the "public" features continue to live in bitvec,
    - the "internal" features become flags,
    - s/BTS_FEAT/BTS_INTERNAL_FLAG/g.

Change-Id: Icf792d02323bb73e3b8d46384c7890cb1eb4731e
2020-06-11 00:36:21 +07:00
Vadim Yanitskiy ba0e5c7d50 gsm_data_shared: use bitvec API to allocate the feature vector
Change-Id: I19ecfc619c0dc2bfd14f054d17e222c4e16f6238
2020-06-11 00:35:51 +07:00
Vadim Yanitskiy 4977e135c8 common/scheduler: use boolean for channel activation state
Change-Id: I0cb1d915db8787050cdec1802894f66e885a9bf3
2020-06-06 19:41:15 +00:00
Pau Espin 897aa786c2 bts-trx: phy_link: Improve logging fmt in phy_link_state_set()
Change-Id: I4633dd81d0b4cc104ca9e0803993ba766cb23790
2020-06-05 20:57:08 +00:00
Vadim Yanitskiy ffe5a8d8b8 rsl: refactor handling of RSL_IE_MR_CONFIG
- get rid of gsm_lchan::mr_bts_lv, it's never used anyway,
  - check IE length in amr_parse_mr_conf() before parsing,
  - check return code of amr_parse_mr_conf().

Change-Id: Ibfd5845ea429945b352dd14421e86562998d65ca
2020-06-05 18:40:42 +07:00
Vadim Yanitskiy 301b218509 vty: fix bts_dump_vty(): properly print OML stream ID (TEI)
Change-Id: I80ceba60e4b48d5bc68de71a2b2a2036b1e78f57
2020-06-05 18:38:38 +07:00
Vadim Yanitskiy 759a12e8aa scheduler: drop non-existing extern declarations
Change-Id: Ifa6fc5947e8fb7ec071a6567c275f5db5ab385f9
2020-06-05 18:38:38 +07:00
Vadim Yanitskiy fccd944bd7 gsm_data_shared: drop force_combined_si & bcch_change_mark
Change-Id: I997ab5e9801af50708ce6dc35004da5e11cb926b
2020-06-05 18:38:38 +07:00
Vadim Yanitskiy b8bdefc33b gsm_data_shared: drop unused rach_b_thresh & rach_ldavg_slots
Change-Id: I75ffc5c0c1f683adf0632bfe71ac51d1adfd97bd
2020-06-05 18:38:38 +07:00
Vadim Yanitskiy 24454fc2f8 gsm_data_shared: drop unused ctrl_ack_type_use_block & net_ctrl_ord
Change-Id: I7c8ddc4a9cfbbd1983e89fa261eaf4f32e15c6bd
2020-06-05 18:38:38 +07:00
Vadim Yanitskiy 0d25f9c94c gsm_data_shared: drop unused dtxu from struct gsm_bts
Change-Id: Ic2ddbf04bac7ced900a4e5e532206652dae64059
2020-06-05 18:38:38 +07:00
Vadim Yanitskiy 79ad26cabf gsm_data_shared: drop unused *nmh from struct gsm_bts
Change-Id: I57e9146cfc3274847b50caa44b09b5f06f0cf00b
2020-06-05 18:38:38 +07:00
Vadim Yanitskiy d7fa003686 gsm_data_shared: drop forward declaration of struct vty
Change-Id: I12b178d73e19761d16a6ef8e2a16243a23e1bf04
2020-06-05 18:38:38 +07:00
Vadim Yanitskiy 1851781d99 gsm_data_shared: drop unused sacch_deact from struct gsm_lchan
Change-Id: I93c6bebbf715076c774248596089c77511733acc
2020-06-05 02:14:48 +07:00
Vadim Yanitskiy c966253aad gsm_data_shared: drop meaningless comments
Change-Id: I8bf88249ef88c283df16fd21a0ad5613801a826f
2020-06-05 02:14:48 +07:00
Vadim Yanitskiy a44a8f469e gsm_data_shared: drop unused struct bts_codec_conf
Change-Id: Ic7187eeb252b327a4d8d1d593758587007d8b891
2020-06-05 02:14:48 +07:00
Vadim Yanitskiy f106db2e37 gsm_data_shared: drop unused LCHAN_SAPI_{UNUSED,MS,NET,REL}
Change-Id: I431844fa69245fca43b1acdaf91229a172878db0
2020-06-05 02:14:48 +07:00
Vadim Yanitskiy 936ed22bd9 gsm_data_shared: drop unused MAX_EARFCN_LIST
Change-Id: I8927ee178fe204c3598d574391e1cabfe5d6334a
2020-06-05 02:14:48 +07:00
Vadim Yanitskiy 308d252795 gsm_data_shared: drop unused A38_XOR_{MIN,MAX,COMP128}_KEY_LEN
Change-Id: If4802d30f7c40a359c4d130a754dd762181f122e
2020-06-05 02:14:48 +07:00
Vadim Yanitskiy 4fa3598639 gsm_data_shared: drop declaration of non-existing gsm_parse_reg()
Change-Id: I2a53ec4b599a7845e49d484f4cd061d7e67c3a28
2020-06-05 02:14:48 +07:00
Vadim Yanitskiy 36e2b55a9e gsm_data_shared: get rid of unused enum gsm_hooks
Change-Id: Ib35fc7772babd3bf09dedf1a44e16a07bcc089f0
2020-06-05 02:14:48 +07:00
Vadim Yanitskiy f53e4aafc7 gsm_data_shared: get rid of unused HARDCODED_BTS{0,1,2}_TS
Change-Id: I8f91681d9102f9a2ab09e75c4f8b44c37dd8c0d4
2020-06-05 02:14:48 +07:00
Vadim Yanitskiy 5ad8db2a19 gsm_data_shared: get rid of unused HARDCODED_{ARFCN,BSIC}
Change-Id: I7e7298bc661d3d3160f03c32d36e98484c8aa79c
2020-06-05 02:14:48 +07:00
Vadim Yanitskiy f5f614b86d gsm_data_shared: drop unused channel request reason definitions
Change-Id: I9a680d4a60dbdd82dc31fbd06c6ecd2240945c68
2020-06-05 02:14:48 +07:00
Vadim Yanitskiy 5de50a598b gsm_data_shared: drop unused enum bts_gprs_mode
Change-Id: Ied91acd3ae480c2e7c85f8d5436babf5a8329a04
2020-06-05 02:14:48 +07:00
Vadim Yanitskiy 53a9c98737 gsm_data_shared: drop unused supports_egprs_11bit_rach
Change-Id: I5fa3aa1cb384f72a9deb3715ba78c199307dd6ec
2020-06-05 02:14:48 +07:00
Vadim Yanitskiy 633de1fb88 vty: get rid of unused ournode_{exit,end}_cmd declarations
Change-Id: Id6fde5976d31dff4cee72473c597638b3c08dbb2
2020-06-04 23:53:04 +07:00
Philipp Maier 78a1d3a31a measurement: remove unecessary is_amr_sid_update parameter
The function ts45008_83_is_sub rougly decides if a frame is a SUB frame
or not. This works by checking the frame number against against lookup
tables. This works fine for codecs where the occurrence of SUB frames is
fixed. However for AMR this is not the case as the DTX periods are
dynamic. Here it is the responsibility of the lower layers (phy,
frame decoding) to tag SUB frames early since making the decision later
based on the frame number is not possible.

The parameter is_amr_sid_update was probably added as a placeholder. It
is set to falls by the callers of the function. Lets remove this
parameter as a late decision if an AMR frame is a SUB frame will never
work.

Change-Id: I125d5ff592218a9e98130a6a7b6bbc6378ce4132
Related: OS#2978
2020-04-25 14:03:06 +00:00
Philipp Maier 58b9f11898 dtx: add detection of AMR DTX frames for osmo-bts-trx
Currently we do not detect any of the DTX frames (SID_FIRST, SID_UPDATE
etc.) Detecting and tagging those frames as is_sub is important for
measurement processing. Also the RTP marker bit must be set on each
ONSET frame.

 - Add detection of DTX frames
 - Tag DTX frames as is_sub and set frame type to AMR_SID
 - Set RTP marker bit when ONSET frames are received

Change-Id: I5afe730fff2fa3199a5913b0de4f5c7b23a39f31
Depends: libosmocore I2bbdb39ea20461ca08b2e6f1a33532cb55cd5195
Related: OS#2978
2020-04-25 14:03:06 +00:00
Rafael Diniz 4f3e3db8d1 osmo-bts-litecell15: Implement missing features.
Many hardware parameters of the LC 1.5 were not exposed to the user.
This change introduces most of the features, being very similar
to osmo-bts-oc2g code. Mostly based on commit
653e974fec00414ba85baf258ccc46ea778a53bd from NuRAN's osmo-bts fork
at: https://gitlab.com/nrw_noa/osmo-bts

Change-Id: Ib16e7d423fc7030573acd86fbd356ae96697ed5d
2020-04-25 13:51:16 +00:00
Harald Welte 187f7c8713 fix compilation with gcc-10
/usr/bin/ld: /home/laforge/projects/git/osmo-bts/tests/sysmobts/../../src/osmo-bts-sysmo/tch.c:584: undefined reference to `femtobts_tch_pl_names'
/usr/bin/ld: l1_transp_hw.o:/home/laforge/projects/git/osmo-bts/src/osmo-bts-sysmo/femtobts.h:108: multiple definition of `pdch_msu_size'; main.o:/home/laforge/projects/git/osmo-bts/src/osmo-bts-sysmo/femtobts.h:108: first defined here
/usr/bin/ld: l1_transp_hw.o:/home/laforge/projects/git/osmo-bts/src/osmo-bts-sysmo/femtobts.h:71: multiple definition of `femtobts_l1prim_type'; main.o:/home/laforge/projects/git/osmo-bts/src/osmo-bts-sysmo/femtobts.h:71: first defined here

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

Change-Id: I4a9896153876fcda496365776883827746205f00
2020-04-20 20:09:24 +02:00
Philipp Maier 7f1800832f scheduler: always call Uplink burst handler on NOPE.ind
When a NOPE indication is received from the TRX normally a separate
handler (.nope_fn) is called. It turned out that calling the Uplink
handler (.ul_fn) on NOPE indications is the usual case, so let's
remove the .nope_fn member and call the Uplink handler directly.

Since a NOPE.ind comes without burst bits, the Uplink handlers must
check bi->burst_len to avoid uninitialized memory access. For some
logical channels (in particular RACH, PDTCH/U, and PTCCH/U) it does
not make sense to call the Uplink handler, so we ignore them.

Change-Id: Ice45d5986610d9bcef2a7e41f0a395ec779e3928
Related: OS#4461
2020-04-04 20:27:52 +07:00
Harald Welte 5914d76d5c osmo-bts-virtual: Add "virtual-um ttl <0-255>" VTY option
This can be used to determine the multicast TTL packet and hence
how far the packet will propagate in the network.  If you want to
operate the virtual Um only on your own machine, a TTL of 0 would
prevent the packets from ever being transmitted on your local
ethernet segment.

Change-Id: I18a9f93b764aee4e1dc68a1c6ac4d078e52ca61d
Related: OS#2966
2020-03-10 21:35:56 +01:00
Oliver Smith cb4340b8a4 rsl: make IP DSCP configurable
Related: OS#4438
Depends: libosmo-abis I41603db8c1286660ad57ac1c78a8fb393a2b080b
Change-Id: Icdef5d40243fefdeae23f3bcf9c6702e8487928a
2020-03-08 17:56:52 +01:00
Philipp Maier 5184576572 osmo-bts-sysmo: merge measurement data and payload
For osmo-bts-sysmo the MPH INFO MEAS IND indication is still sent
separately. Lets merge the measurement information into the PH DATA

Change-Id: Iffe7865727fbf9bca8eb32a96e8ea05cf718a948
Related: OS#2977
2020-02-17 12:40:07 +01:00
Philipp Maier d4f67591c7 l1sap: merge MEAS IND into PRIM PH DATA / PRIM TCH
The MPH INFO MEAS IND indication, which contains the uplink measurement
data is sent in parallel to the PH DATA and TCH indications as a
separate indications. This makes the overall uplink measurement data
processing unnecessarly complex. So lets put the data that is relevant
for measurement into the PH DATA and TCH indications directly.

This change only affects osmo-bts-trx at the moment. In order to keep
the upper layers (l1sap.c) compatible we add an autodection to switch
between separate measurement indications and included measurement data.

Related: OS#2977
Depends: libosmocore I2c34b02d329f9df190c5035c396403ca0a4f9c42
Change-Id: I710d0b7cf193afa8515807836ee69b8b7db84a84
2020-01-20 14:35:19 +00:00
Philipp Maier a0403d3769 ta_control: move timing advance code from osmo-bts-trx to common
The timing advance controller that is implemented in loops.c of
osmo-bts-trx only works for osmo-bts-trx and not for any of the phy
based bts. Lets move the timing advance controller into the common part
and make it available for every bts. Also lets add a unit-test.

Change-Id: If7ddf74db3abc9b9872abe620a0aeebe3327e70a
Related: SYS#4567
2020-01-20 14:33:49 +00:00
Philipp Maier 66c17cfc2d rsl: ensure measurement reports are sent
osmo-bts currently does not generate a measurement report in case the
SACCH of the related traffic channel is lost. This is a problem because
the moment when reception gets bad measurmenet reporting is crucial to
carry out handover decisions effectively.

The presence of a SACCH block controls the conclusion of the measurement
interval and the sending of the RSL measurement report. The latter one
not only requires a measurmenet indication, it also requires a fully
intact SACCH block.

Lets use the NOPE / IDLE indications from V1 of the TRXD protocol to
ensure a SACCH block is always reported up to l1sap.c. In cases where
the SACCH is bad, trigger the sending of the RSL measurement report
manually without attaching the measurmenet data from the MS (which we do
not have in this case)

Related: OS#2975
Depends: osmo-ttcn3-hacks Ib2f511991349ab15e02db9c5e45f0df3645835a4
Change-Id: Idfa8ef94e8cf131ff234dac8f93f337051663ae2
2020-01-03 12:56:00 +01:00
Pau Espin e3a4530919 bts-trx: Drop low layer MS Power Control Loop algo
Let's drop it instead of having code duplication from common code in a
lower layer, and maintain only the one in l1sap for all BTS models.
As a result, osmo-bts-trx loses feature BTS_FEAT_MS_PWR_CTRL_DSP and
will only be able to use "ms-power-control osmo" in VTY, which will be
enabled by default (meaning: change of behavior, now MS Power Control is
enabled by default in osmo-bts-trx and can only by disabled by BSC).
Old bts-trx specific VTY command "(no) osmotrx ms-power-loop" is marked
as deprecated but still working for more usual case (1 TRX configured)
to avoid breaking backward compatibility.

TA low level loop is still kept in loops.c and will be moved to l1sap at
some point too.

Related: OS#1851
Change-Id: I0d8b0c981d9ead91d93999df6e45fb06e426aeb9
2019-11-30 18:50:04 +00:00
Vadim Yanitskiy a070e863e2 pcuif_proto.h: extend RACH.ind with TRX and timeslot number fields
Since there can be multiple PDCH channels configured on different
timeslots, different TRXes, and BTSes, the PTCCH/U handling code
in OsmoPCU needs to know the exact origin of a given RACH.ind.

Otherwise, it is not known which subscriber originated a given
PTCCH/U indication, and hence it is impossible to send PTCCH/D
Timing Advance notification properly.

Fortunately, we can extend the RACH.ind message without even
bumping the protocol version, because every single PDU has a
fixed size defined by the largest message - INFO.ind. In case
if the actual message payload is smaller, the rest is filled
with a constant padding byte (0x00).

Older versions of OsmoPCU will consider the new fields as padding,
while the messages from older OsmoBTS versions will always have
both fields set to 0x00. Since C0/TS0 cannot be configured to
PDCH, this can be easily detected on the other end.

Change-Id: Iff38934a108b6b1cd298669834263a7d5296c3f6
Related: OS#4102, OS#1545
2019-11-22 17:38:07 +00:00
Pau Espin 522fc939e0 power_control.c: Don't use announced MS Power level as input for loop calculations
Use instead the received MS Power currently in use by the MS matching
the measured signal. This way there's no need to wait for the MS to
reach the announced MS power level or add checks in case the MS doesn't
support that specific power level. Furthermore, more fine grained
announced power level value can be obtained faster due to more input
iterations not being dropped while waiting.

osmo-bts-trx specific algo was not following this approach and using
announced MS power instead because it's wowrking at a lower level and
henche was not using the transmitted MS Power level value by the MS as
input for the calculation.

The "if (diff < 2 && diff > -2))" condition is dropped since equal
signal strength may still result in a different MS power level announced
(the one currently used by the MS during tx of last SACCH block).

Related: OS#1851
Change-Id: I4494dc27a295a3dca1d3331d4ff712d486643e13
2019-11-20 19:35:08 +01:00
Vadim Yanitskiy b37b3263a9 osmo-bts-trx: general handling of NOPE / IDLE indications
Each logical channel can now optionally have an additional handler,
that will be called when a NOPE / IDLE indication is received from
the transceiver. The aim of that handler is to keep the logical
channel state updated in case if one or more Uplink bursts are lost.

Change-Id: I71c552f44c25e56e9779d8b8ef5d4de9f8475637
Related: OS#3428
2019-11-19 01:01:45 +00:00
Pau Espin c693067b7e Introduce BTS feature BTS_FEAT_MS_PWR_CTRL_DSP
It indicates whether BTS model supports managing an MS Power Control
Loop over HW/DSP instead of using the software based osmocom algorithm
present in osmo-bts.
osmo-bts-trx own loop implementation is considered to be a "DSP/HW" one
since it acts on lower layers and interferes with osmocom algorithm
since it controls the same end variable "lchan->ms_power_ctrl.current",
this way we make sure both aren't enabled at the same time.
Old behavior in kept: if common upper-layer algo is not enabled
explicitly in VTY (ms-power-control osmo) and bts-trx specific lower
layer algo is neither enabled (osmotrx ms-power-loop <xyz>), then no
power control is done at all.

Related: OS#1851
Change-Id: I49706926b1e962b18791174627bc3cc0cd0cd9d5
2019-11-14 20:02:45 +01:00
Pau Espin d0a2caa021 power_control.c: Fix ms pwr ctrl skipped if MS doesn't support announced MS Power Level
Related: OS#1851
Change-Id: I1a9c00fe4eb3fa1eaa7997a9ec20716ddfe180a7
2019-11-14 20:02:45 +01:00
Pau Espin e717aec2f7 Move and rename gsm_lchan.ms_power field
Make it clear that it contains the maximum MS power level (TS 05.05) and
not the one to be used. The one aimed at is in ms_power_ctrl.current.
Since it's used in related code, move it inside the ms_power_ctrl struct
too.

Related: OS#1851
Change-Id: Ib264ec7dac87355cef6415461ed74bd8e9c8ca52
2019-11-14 16:36:00 +01:00
Pau Espin 18bfa91a26 Change gsm_lchan field fixed to bool
Change-Id: I715ef151b67a21e325c574585a257e71b4b0ce2a
2019-11-14 16:36:00 +01:00
Pau Espin e5e1226301 Change gsm_bts_trx field to bool and rename it
Thies field is used to store and retrieve whether MS power needs to be
calculated and updated by osmo-bts software or autonomously by lower
layers. Previous name was not clear
and may have been understood as indicating whether MS Power Control loop
is done or not in general, and the responsible for that is located under
lchan's ms_power_ctrl.fixed.

Related: OS#1851
Change-Id: Ic690ab69866a7377f1597e24aa7b0214831c1cbe
2019-11-14 16:36:00 +01:00
Martin Hauke b378fccef1 Fix common misspellings and typos
Change-Id: I403b9029f57fec3fdec2c1e2cbeac0f6eab53f24
2019-10-17 08:05:35 +00:00
Pau Espin 8ff35d3c91 bts-trx: Time out if no clock ind recvd after RSP POWERON
Before this patch, if due to whatever reason the TRX started fine (RSP
POWERON 0) and sockets were created but no CLOCK IND was ever received
by the BTS, it wouldn't notice since the timerfd timeouts
(bts_shutdown("no clock")) are only checked after the first CLOCK IND is
sent by the TRX.
As a result, the BTS would be kept on forever saying everything is fine
but it would be sending no DL burst at all to the TRX (tested with a
modfied osmo-trx dropping clock indication).
With this patch, new APIs are added to indicate the scheduler_trx code
the timeframes where clock ind are expected (between RSP POWERON 0 and
RSP POWEROFF 0); if TRX sends clock indications out of that timeframe,
BTs lower layers will drop them (controlled by "powered" bool).
Hence, the scheduler_trx can now place a timeout (reusing same timerfd
because its new use is exclusive in time with its other previous use)
when it is told that CLOCK IND should start appearing, and if none
arrives in considerable time, then the BTS can be shut down to notify
the rest of the network.

Related: OS#4215
Change-Id: Iba5dbe867aff10e70ec73dbf1f7aeeecb15c0a4d
2019-10-16 11:13:21 +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 e83c1196b8 L1SAP: also consider RSL_CHAN_OSMO_CBCH8 as CBCH
Currently we don't distinguish between CBCH on BCCH+SDCCH/4 and
CBCH on SDCCH/8, but in libosmogsm we have two independent
(non-standard) RSL channel number values for them. Maybe some day
we will, so let's extend the definition of L1SAP_IS_CHAN_CBCH.

Change-Id: I2f6d501a29edaf89dfb17d5d64f930cdb1943630
2019-10-09 03:01:35 +07:00
Vadim Yanitskiy 1c6a56fb97 L1SAP: use RSL_CHAN_* definitions from libosmogsm
Change-Id: I2708b5d5bb6b92f90766ac752bafd28cff2549b0
2019-10-09 03:01:19 +07:00
Pau Espin 96cb0c54a9 bts-trx: Rework code handling poweron state
Use of variables in each code is confusing and mixing configuration with
POWERON/POWEROFF state (which is at least per phy inst and not per TRX,
since those commands are only expected on the 1st phy inst).

* field "poweron" becomes "enabled", and is used as an indicator for
actions to take during TRX provisioning (hether to power it on and
configure it or to power it off).
* poweron/poweroff state becomes "powered", and it is shared by all trx
in same phy_link, and is updated only after confirmation by TRX.
* poweron_set becomes poweronoff_set (because it's used by both POWERON
and POWEROFF), and becomes shared by all trx in same phy_link, since
those CMDs are usually sent by first phy instance of the link (the first
trx).

Related: OS#4215
Change-Id: Icd0b482f1454236432e1952220bbec9d178b8607
2019-10-05 20:50:13 +00:00
Pau Espin 520954cd93 bts-trx: vty: Print phy link state in cmd 'show transceiver'
Change-Id: I8e49f8edad9f9c68d110dbb7faeea5143aa91022
2019-10-05 20:50:13 +00:00
Pau Espin 972c243146 struct gsm_bts: Add model_priv pointer handing bts_model specific data
Currently there's bts-virtual specific fields in gsm_bts which is not used
by other models and are always allocated.
An alternative would be having a union with different structs inside,
one per model, but since we already have the bts_model abstraction, in this
case it makes more sense to use that abstraction instead of filling code
with preprocessor ifdefs to guard against non-defined types, etc.

Existing model specific data is moved there.

This new infra will be user further in forthcoming commits.

Related: OS#4215
Change-Id: Ib17a752cdbaa7d5eb8c5dfa0b197f80a4f38b38e
2019-10-05 20:50:13 +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 35d4291a5e bts.h: Remove non-existent function definitions
Change-Id: I4d06e1cdea5970cbb493f29980b1c04e01c0e8a4
2019-09-27 14:57:05 +02:00
Harald Welte ec228cc08c osmo-bts-trx: migrate to new generic ECU abstraction
libosmocodec has recently introduced a generic ECU abstraction layer
which supports (pluggable) Error Concealment Units for not only the
FR codec, but potentially any other codec, too.

Change-Id: I001005aae6de76d4e045b8dc572239f057bb150d
Depends: libosmocore I4d33c9c7c2d4c7462ff38a49c178b65accae1915
2019-09-10 12:26:21 +00:00
Harald Welte 2588b2abf6 pcu_interface: Forward ETWS Primary Notification to PCU
All MS/UE must be notified of ETWS Primary Notifiations.

Depending on their state, the notification goes different paths:
* CS dedicated mode: BSC sends it as L3 message over LAPDm / DCCH
* CS/PS idle mode: BTS sends paging messages on PCH
* PS TBF active: PCU send Packet Application Info

This enables the last of the three methods by passing any
ETWS Primary Notifications received over RSL via the PCU socket into
the PCU.

Change-Id: Ic0b3f38b400a0ca7e4089061ceb6548b0695faa6
Related: OS#4047, OS#4048
2019-09-06 11:57:37 +02:00
Harald Welte f53fde91a3 ETWS Primary Notification via P1 Rest Octets
The ETWS (Earthquake and Tsunami Warning System) uses a so-called
ETWS Primary Notification which is sent
* to phones in dedicated mode (via DCCH from the BSC)
* to phones in idle mode (via P1 Rest Octets on PCH/CCCH)

This patch implements the second part of the functionality, i.e.
transmitting the related ETWS Primary Notification via PCH.  As
3GPP doesn't specify how this is communicated over Abis, we use
a new, vendor-specific RSL message type.

Closes: OS#4047
Depends: libosmocore I89c24a81ada6627694a9632e87485a61cbd3e680
Depends: libosmocore I36fc2ffc22728887d1cb8768c7fcd9739a8ec0fc

Change-Id: I18c60cdb86b9c19e09f5ec06d66e9b91608880e6
2019-09-05 14:30:17 +02:00
Pau Espin b4d8f5cf13 Remove undefined param passed to {logging,osmo_stats}_vty_add_cmds
Since March 15th 2017, libosmocore API logging_vty_add_cmds() had its
parameter removed (c65c5b4ea075ef6cef11fff9442ae0b15c1d6af7). However,
definition in C file doesn't contain "(void)", which means number of
parameters is undefined and thus compiler doesn't complain. Let's remove
parameters from all callers before enforcing "(void)" on it.
API osmo_stats_vty_add_cmds never had a param list but has seem problem
(no "void"), so some users decided to pass a parameter to it.

Change-Id: Ia4d1a7914308d1481fe31fe0986265ead339e61e
Related: OS#4138
2019-08-05 16:13:09 +02:00
Pau Espin e6372cff1b bts-trx: Introduce VTY command osmotrx trxd-max-version
This command allows setting a maximum TRXD format version to negotiate
with TRX. osmo-bts-trx will hence end up using that version if supported
by TRX, or a lower one otherwise (or fail if TRX doesn't support any of
them).
Since now the maximum version can be 0, avoid going through SETFORMAT
negotiation in that case, since 0 is the default version. This way we
keep backward compatibility with TRX implementations that exit upon
receival of unknown commands (such as SC5 current one).

The VTY command is located in the "phy" node instead of the "phy
instance" node because instances of same phy are expected to use same
host with same implementation, so TRXD version to use should be the same
for both.

Related: OS#4006
Change-Id: I5eb1fdc002f9d7f4acf475356d8fc998dc8f6326
2019-07-23 17:21:40 +02: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
Vadim Yanitskiy 54e104496a osmo-bts/scheduler: provide actual C/I values to OsmoPCU
C/I (Carrier-to-Interference ratio) is a value in cB (centiBels),
computed from the training sequence of each received burst,
by comparing the "ideal" training sequence with the actual one.

So far, there was no way to expose more measurements from OsmoTRX,
excluding both RSSI and ToA. Since the new version of TRXD header,
we can receive C/I indications and send the averaged (per 4 bursts)
values to OsmoPCU (as a part of PCUIF_DATA.ind).

Please note that we also need to attach C/I measurements
to the following L1SAP primitives:

  - PRIM_PH_RACH.ind,
  - PRIM_PH_DATA.ind,
  - PRIM_TCH.ind,

but this will be done in the follow up changes.

Change-Id: Ia58043bd2381a4d34d604522e02899ae64ee0d26
Fixes: OS#1855
2019-07-16 04:16:13 +00:00
Vadim Yanitskiy 01cc8c0d21 osmo-bts-trx/scheduler: pass trx_ul_burst_ind to lchan handlers
This change needs to be done in order avoid adding more and more
arguments to the UL logical channel handlers (such as rx_rach_fn).

Since we have different versions of the TRXD header, and may have
other burst-based PHYs in the future, some fields of an Uplink
burst indication have conditional presence.

Change-Id: Iae6b78bafa4b86d0c681684de47320d641d3f7c0
Related: OS#4006, OS#1855
2019-07-16 04:16:13 +00:00
Vadim Yanitskiy a99c41bac5 osmo-bts-trx/trx_if.c: introduce TRXD header version 0x01 support
The new version adds the following fields to the TRX2L1 message,
keeping the L12TRX message unchanged:

  +------+-----+-----+-----+--------------------+
  | RSSI | ToA | MTS | C/I | soft-bits (254..0) |
  +------+-----+-----+-----+--------------------+

  - MTS (1 octet)  - Modulation and Training Sequence info, and
  - C/I (2 octets) - Carrier-to-Interference ratio (big endian).

== Coding of MTS: Modulation and Training Sequence info

3GPP TS 45.002 version 15.1.0 defines several modulation types,
and a few sets of training sequences for each type. The most
common are GMSK and 8-PSK (which is used in EDGE).

  +-----------------+---------------------------------------+
  | 7 6 5 4 3 2 1 0 | bit numbers (value range)             |
  +-----------------+---------------------------------------+
  | . . . . . X X X | Training Sequence Code (0..7)         |
  +-----------------+---------------------------------------+
  | . X X X X . . . | Modulation, TS set number (see below) |
  +-----------------+---------------------------------------+
  | X . . . . . . . | IDLE / nope frame indication (0 or 1) |
  +-----------------+---------------------------------------+

The bit number 7 (MSB) is set to high when either nothing has been
detected, or during IDLE frames, so we can deliver noise levels,
and avoid clock gaps on the L1 side. Other bits are ignored,
and should be set to low (0) in this case.

== Coding of modulation and TS set number

GMSK has 4 sets of training sequences (see tables 5.2.3a-d),
while 8-PSK (see tables 5.2.3f-g) and the others have 2 sets.
Access and Synchronization bursts also have several synch.
sequences.

  +-----------------+---------------------------------------+
  | 7 6 5 4 3 2 1 0 | bit numbers (value range)             |
  +-----------------+---------------------------------------+
  | . 0 0 X X . . . | GMSK, 4 TS sets (0..3)                |
  +-----------------+---------------------------------------+
  | . 0 1 0 X . . . | 8-PSK, 2 TS sets (0..1)               |
  +-----------------+---------------------------------------+
  | . 0 1 1 X . . . | AQPSK, 2 TS sets (0..1)               |
  +-----------------+---------------------------------------+
  | . 1 0 0 X . . . | 16QAM, 2 TS sets (0..1)               |
  +-----------------+---------------------------------------+
  | . 1 0 1 X . . . | 32QAM, 2 TS sets (0..1)               |
  +-----------------+---------------------------------------+
  | . 1 1 1 X . . . | RESERVED (0)                          |
  +-----------------+---------------------------------------+

== C/I: Carrier-to-Interference ratio

The C/I value is computed from the training sequence of each burst,
where we can compare the "ideal" training sequence with the actual
training sequence, and then express that difference in centiBels.

== Limitations

  - The only supported modulation types are GMSK and 8-PSK.
    Messages with other modulation types will be rejected.

  - IDLE / NOPE indications are not (yet) handled.

  - The logical channel handlers do not (yet) handle optional
    fields, such as TSC and C/I. This will be implemented
    in the follow-up changes.

Change-Id: If61c71d20d590bf07bfd019afb33000a0b6135bd
Related: OS#4006
2019-07-04 01:28:50 +07:00
Vadim Yanitskiy b06cd9f439 osmo-bts-trx/trx_if.c: introduce TRXD header version handling
It may be necessary to extend the message specific header with
more information. Since this is not a TLV-based protocol, we
need to include the header format version.

  +-----------------+---------------------------+
  | 7 6 5 4 3 2 1 0 | bit numbers (value range) |
  +-----------------+---------------------------+
  | X X X X . . . . | header version (0..15)    |
  +-----------------+---------------------------+
  | . . . . . X X X | TDMA TN (0..7)            |
  +-----------------+---------------------------+
  | . . . . X . . . | RESERVED (0)              |
  +-----------------+---------------------------+

Instead of prepending an additional byte, it was decided to use
4 MSB bits of the first octet, which used to be zero-initialized
due to the value range of TDMA TN (0..7). Therefore the current
header format has implicit version 0.

Otherwise Wireshark (or trx_sniff.py) would have to guess the
header version, or alternatively follow the control channel
looking for the version setting command.

This change introduces a new structure 'trx_ul_burst_ind', which
represents an Uplink burst and the corresponding meta info. The
purpose of this structure is to avoid overloading the existing
functions, such as trx_sched_ul_burst(), with more and more
arguments every time we bump the version.

On receipt of a TRXD message, trx_data_read_cb() now parses
the header version, and calls the corresponding dissector
functions, e.g. trx_data_handle_(hdr|burst)_v0().

Change-Id: I171c18229ca3e5cab70de0064a31e47c78602c0c
Related: OS#4006
2019-06-27 12:51:02 +07:00
Pau Espin 5a3eb6470d gsm_data_shared.h: Remove unused loc_list from struct gsm_bts
Change-Id: I52880962dfb0399c613048aa7ddfd828d3c6c933
2019-06-13 17:42:05 +00:00
Harald Welte 46d62b984a lapdm: Use new libosmocore API to ensure per-channel-type N200 values
By using new libosmocore LAPDm API we can specify the GSM channel type
and hence enable the LAPDm code to use a per-channel-type specific N200
value.

At the same time, this new API also allows us to specify T200 values
when initializing the LAPDm channel, so we don't have to fiddle with
low-level lapdm data structures in what used to be oml_set_lchan_t200().

Change-Id: I0e814fbae13e0feddd148c47255dcc38cb718f48
Depends: libosmocore I90fdc4dd4720d4e02213197c894eb0a55a39158c
Closes: OS#4037
2019-06-13 15:38:01 +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
Vadim Yanitskiy 01c539284e common/scheduler.c: refactor description of TRXC_* lchans
Let's avoid fancy alignment in the description of logical channels
for the benefits of having better readability, the ability to add
more comments and fields without making it look ugly.

Get rid of value-string array 'trx_chan_type_names', since each
logical channel has its name defined in 'trx_chan_desc'.

Get rid of field 'chan' of 'trx_lchan_desc' structure since it's
not used anywhere, and not actually needed because the position
of each lchan description is defined by its TRXC_* type.

Replace both 'pdch' and 'auto_active' fields with more generic
bitmask field called 'flags', and define the following flags:

  - TRX_CHAN_FLAG_AUTO_ACTIVE,
  - TRX_CHAN_FLAG_PDCH.

Use RSL channel mode #defines from libosmogsm instead of having
hard-coded numbers. This increases readability.

As a bonus, let's add a human readable description to each lchan
definition, so it can be printed in the VTY some day.

Change-Id: I9d5d49ec569f133d37b8164b22607d4700474315
Backported from: I2fc61e1cdca4690a34e2861b9ee3b7c64ea64843
		 I7ab4958801b3422973b67ff0452b90afa8a3f501
2019-06-08 10:09:42 +00:00
Pau Espin 8576477de1 bts-trx: trx_if.c: Introduce logging macro LOGPPHI
This way we unify format. We take the chance to add related information
to some log messages which were not printing that information (and was
confusing when using more than one phy instance).

Change-Id: I5b17a01638ade9a6c41da73e550d5947fa92f568
2019-06-04 17:58:46 +02:00
Vadim Yanitskiy 8ec940ce9a osmo-bts/scheduler.h: cosmetic: use bool for ho_rach_detect
Change-Id: Id357e4ed38cbdca2082322da12b93d556056e916
2019-06-01 23:10:02 +07:00
Harald Welte 1e96e31c10 clear GPRS indicator in SI3 while PCU is disconnected
osmo-bts cannot provide GPRS service while osmo-pcu is not connected.
The BSC has no knowledge of the PCU connection state. Prevent MSs
from trying to register for GPRS while the PCU is disconnected by
erasing the GPRS Indicator in SI3.

Change-Id: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Depends: I690cf308311f910005a325d50f5d5d825678d2b2 (libosmocore.git)
Depends: I08e0ca9a8d13c7aa40b9d90f34f0e13adb87d4e0 (libosmocore.git)
Depends: I8b1ee2405f6338507e9dfb5f1f437c4c2db2e330 (libosmocore.git)
Related: OS#3075
2019-05-28 19:59:07 +02: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 590b23ce3c cbch: Add counters; queue length limits and CBCH LOAD reporting
This adds the final missing part to full CBCH support:
* keep a tab on the current queue length for basic + extended CBCH
* keep rate counters about the number of sent / transmitted SMSCB
* send CBCH LOAD information via RSL to the BSC

Change-Id: I7068c7937a60a900c40439115bb84dc3ee0d061f
2019-05-23 19:16:11 +00:00
Harald Welte 0f9595f462 cbch: Keep SMSCB queue length counter
This avoids having to iterate the list to count the number of elements.

Change-Id: I72c47affeb87c9b898bc2290dc7ed113945f1805
2019-05-21 02:42:00 +02:00
Harald Welte 067824841f cbch: Support Extended CBCH
The logic for Extended CBCH are the same as for the Basic CBCH, we just
need to
* duplicate our related state
* parse the optional RSL_IE_SMSCB_CHAN_INDICATOR IE
* start to send data on the Extended CBCH (TB=4..7)

Change-Id: If2c6dc7da1e2185ab75fc957f8d305ad8db22429
Closes: OS#3535
2019-05-21 00:31:11 +02:00
Harald Welte 5567d71d39 cbch: Implement support for DEFAULT message
The BSC can not only send us each to-be-sent message separately, but
it can also configure a DEFAULT message, which is then to be sent
instead of the NULL message.  Let's add support for this

Change-Id: I65a79215b54155d128c26d2ca11ff9ff3ed2cdba
Closes: OS#4013
2019-05-21 00:31:11 +02:00
Vadim Yanitskiy b873b91c5f common/oml.c: constify argument 'trx' of handle_attrs_trx()
Change-Id: Id476d492b3c1d0c728fca9eb0fb2254512bdef72
2019-04-19 20:20:47 +07:00
Harald Welte 41723e1508 Forward GPRS SUSPEND REQ from DCCH to PCU socket
As specified in 3GPP TS 03.60 Section 16.2.1 and 44.018 Section 3.4.15,
a Class B MS is sending a "RR GPRS SUSPEND REQ" via a DCCH to the BTS if
it wants to suspend GPRS services.  The BSS is now responsible to
somehow forward this to the SGSN.  As the Gs interface between BSC and
SGSN is both optional and doesn't have any provision to forward this
message, we have to send it over to the PCU so it can use regular BSSGP
signaling to inform the SGSN of the SUSPEND REQUEST.

This patch requires libosmocore Change-Id
I90113044460a6c511ced14f588876c4280d1cac7 for the related definition of
struct gsm48_gprs_susp_req.

Change-Id: I3c1af662c8f0d3d22da200638480f6ef05c3ed1f
Closes: OS#2249
2019-03-27 11:19:11 +00:00
Philipp Maier 945c09381d oml: use oml_tx_failure_event_rep() instead of signals to SS_FAIL
At some locations in the code a signal to SS_FAIL is dispatched in order
to trigger the sending of an OML failure event report in oml.c. This is
a bit overcomplicated for the task. Lets use oml_tx_failure_event_rep()
to send the failure event reports and lets remove the signal handler for
SS_FAIL.

Change-Id: Ie4fce1273a19cc14f37ff6fc7582b2945c7e7c47
Related: OS#3843
2019-03-27 11:10:57 +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
Philipp Maier c49df5d144 vty: add function gsmnet_from_vty() to vty.h
The function gsmnet_from_vty() is used in oc2gbts_vty.c, but it is not
declared in vty.h. Lets add the declaration to vty.h, so that
gsmnet_from_vty() can be used properly by other modules.

Change-Id: I8cf63c6fabdb1f2dc67ca8193704ce4d1d4882d9
2019-03-27 10:09:17 +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 965b911583 Make gsm_pchan2chan_nr() static
It's only used inside of gsm_data_shared.c so let's mark it as such.

Change-Id: I83f1783efe9dc07c8bf9901ebc94774aef1cd472
2019-03-18 11:39:07 +00:00
Philipp Maier 3dd90a09e4 oml: make oml_tx_failure_event_rep() public
The static function oml_tx_failure_event_rep() is a lot easier to use
than the currently implemented signal scheme. Lets make it public so
that we can quickly generate failure event reports.

Change-Id: I9c4601840a06119f35cfe4da453fff3b293fe615
Related: OS#3823
2019-03-18 09:20:58 +01:00
Harald Welte 96bded3ebd OML: Use 'const struct abis_oml_mo *' whenever users only read
Try to constrain the code a bit further by making all read-only
accesses use 'const *'.

Change-Id: I5a61e6d1b4e5e083bb24017166186dc87d035cd0
2019-02-12 20:08:18 +01:00
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
Philipp Maier a4bca11555 bts: use feature list instead of speech codec table
osmo-bts has a table of pchan/channel mode combinations for every
bts. This table models the codec capabilitys of the BTS hardware.
However, having the speech codec apabilities modeled inside the
BTS feature list would be much more comfortable and since the
feature list is communicated back to the BSC we would get the
codec capabilities inside the BSC domain as well.

- remove the pchan/channel mode tables
- set speech codec variants for each BTS type
- fix bts_supports_cm so that it queries the feature list

Change-Id: I977dc729ba856631245aedf76afd48eac92166f7
2018-02-22 07:58:26 +00:00
Philipp Maier e0bfd675d1 gsm_data_shared: extend bts feature list with speech codecs
The feature list does not cover any speech codec related information.

- Add speech codec related items to feature list.

Change-Id: If6d50c6f4e2348b23f31c3415b0f5577a3f5be50
2018-02-22 07:58:25 +00:00
Philipp Maier bf1fea0928 rsl: do not allow MODE MODIFY request with unsupp. codec/rate
When the BSC sends a MODE MODIFY request with an unsupported
codec, the BTS must respond with a negative acknowledge.
Currently the codec parameter is not checked at all, which may
lead into malfunction or crash of the BTS.

- Introduce a mechanism to check the codec/rate against a
  table that is set up in the phy specific code.

- Add tables with supported codec/rate combinations for
  octphy, sysmobts, and trx.

Change-Id: Id9b222b7ab19ece90591718bc562b3a8c5e02023
Related: SYS#3212
2018-02-19 08:38:21 +00:00
Max 322cfc4942 Add helper to get BCC from BSIC
Change-Id: Ib539a8739d53ab60d8fadffcef38152b82a28498
Related: OS#1854
2018-02-07 20:45:22 +01:00
Harald Welte 50cc22a30c Print much more information during 'show lchan'
This adds printing of remote RTP IP/Port, LAPDm SAPI information,
MS Timing offset, propagation delay, encryption algorithm+state,
loopback status and radio link failure counter to the "show lchan"
command.  It also adds TODO comments fro those bits that are not yet
printed but which would make sense to print.

Change-Id: Ic4bc47638b7b402aee9344dc912745a9929c37f4
2018-02-05 23:18:53 +01:00
Harald Welte 40ec238762 gsm_lchan: remove unused member fields
Change-Id: Icfc601e664ccf33078955e54b02315085cff20a8
2018-02-05 21:29:57 +01:00
Max 1adfc52a72 Remove BSC-specific parts
The dead code is from before repo-split time.

Change-Id: I9d4ee8d55a4096bf47407c7d2bdbf3063bf1666e
2018-01-05 10:06:44 +00:00
Harald Welte be4a208809 Put useful information in RTCP SDES.
The RTCP Sender Description is supposed to contain useful information
to identify the source of the RTP stream.  So far, it only contained
compile-time default data of libortp.  Let's put the BTS UnitID, the
lchan number and the OsmoBTS version in there.

This change requires libosmo-abis Change-Id Ice794f9e0c6caeea1c67520c12efbfa375d1fb82

Change-Id: Id6ce7188354d3a0517661c9648854ec829ef1cac
Related: OS#2701
2017-12-03 21:22:25 +00:00
Harald Welte 62a6a2680f scheduler: Harmonize log line format; Always print TS name + decoded FN
Change-Id: I5703b46c8a59fe00a3cdc063bcf72872980ec5e5
2017-12-02 21:05:34 +01:00
Harald Welte 41d471351f Comments on individual members of struct gsm_abis_mo
Change-Id: I8e005410080201746906b8a60e9f7957031d2e58
2017-12-02 21:05:34 +01:00
Max ec33b0397f Remove build dependency on legacy OpenBSC
* copy-paste gsm_data_shared.* from OpenBSC master
* remove corresponding configure check and option
* remove .deb dependency

Actual refactoring with removal of unnecessary structures/parts, moving
common OpenBSC/OsmoBSC parts into libraries etc. are left for further
patches.

Current patch will make coexistence with *BSC easier and will simplify
our build infrastructure.

Change-Id: I9f004fb5c4c1db29d4792dfd281d388c7063da13
Related: OS#1923
2017-10-08 18:40:09 +02:00
Max 9e36dca82a trx: avoid deactivating lchan on LCHAN_REL_ACT_REACT
* do not deactivate lchan when called with LCHAN_REL_ACT_REACT
* add fixme comment

It's unclear yet if any special steps are required for osmo-bts-trx so
let's just make it compatible with setups [1] using BS_AG_BLKS_RES != 1
for now.

Background: CCCH is auto activated by some OsmoBTS - before we receive
SI3, see 4a85828462. To accommodate for
that we deactivate CCCH in common/rsl.c, which triggers BTS-model
specific callback sapi_deactivate_cb() which updates parameters and
activates it again.

In case of osmo-bts-trx there is no auto-activation and (seems to be) no
need in special interaction with hw to activate channel (no
lchan_activate()) hence we can just skip entire
deactivate/setup/activate again routine.

[1] "channel-descrption bs-ag-blks-res N" in OpenBSC config file.

Related: OS#1575
Change-Id: I20b89ba1e43d1414180b083cd1e085eeffe5d513
2017-09-02 19:44:54 +00:00
Max bbf6c435f6 Support removing SI13 from PCU
If SI13 becomes unavailable in runtime than send 0-length message with
BCCH SAPI to PCU to indicate that SI13 have to be removed.

Change-Id: I72aef8bd98f21c4b5ea6eed21fc56b30d85bfc1b
Related: OS#2400
2017-09-01 16:13:02 +02:00
Max 6384c73fbf Support sending SI13 to PCU
* explicitly set SAPI when sending data_ind to PCU
* drop unused receiving code for BCCH SAPI
* send SI13 when PCU is connected
* send SI13 when new SI is received

Change-Id: I9e83ef792585aa962f99897d9973cef12f186bcf
Related: OS#2400
2017-08-31 14:44:45 +02:00
Max aa11997480 osmo-bts-trx: remove global variables from loops
* move TA related globals into phy_link
* move power loop related globals into phy_link
* prefix corresponding vty vars with osmotrx

Change-Id: I01d7c1abad67e51b886a4ecf2de072929d67da27
Related: OS#1848
2017-08-24 19:06:48 +00:00
Harald Welte fe6c75d24a TRX: Remove global variables, move SETBSIC/SETTSC handling into phy_link
Whether or not we are talking to an OpenBTS (SETBSIC) or OsmoTRX
(SETTSC) transceiver is a property of the phy_link, and not a property
of the BTS.  Also, we *really, really* should never use global
variables. I'm very happy this is being cleaned up, finally.

Change-Id: I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c
2017-08-09 13:03:33 +00:00
Harald Welte de99be4afb L1SAP: Use RSL_CHAN_OSMO_PDCH across L1SAP
So far, L1SAP code is hiding RSL_CHAN_OSMO_PDCH from the bts specific
code below L1SAP.  This is some kind of a hack/workaround, making code
and debug output / logs more difficult to understand.

So let's teach the lower layer how to treat RSL_CHAN_OSMO_PDCH and
remove the "hiding" code from the common l1sap.c code.

Change-Id: Iaaa833febe45b82166d3901f10cc5466a7591c19
2017-08-09 10:03:14 +00:00
Max 2d2fca4342 lc15: port lc15bts-mgr changes
That's mostly changes related to lc15bts-mgr from
https://gitlab.com/nrw_noa/osmo-bts branch nrw/litecell15 based on
eb5b7f80510b603579f7af6d7d5ead296c2fa260 commit.

I wanted to incorporate vty and hardcoded paths changes so we can use it
from this point without major backward-incompatible changes as a base
for future ports.

Change-Id: Iabbaedc84aaaa594150a4e5445c16dd1f6f89858
Related: SYS#3679
2017-07-19 11:47:47 +02:00
Harald Welte 5eb17e28ac VIRT-PHY: Initial check-in of a new virtual BTS
This patch adds a virtual physical layer designed to simulate the
Um air interface between BTS and MS.  It does so by encapsulating MAC
blocks (Layer 2 PDUs) via GSMTAP and sending them through multicast UDP
streams, both in uplink and in downlink.

The purpose of this is enable testing without any radio hardware or
related licenses.

OsmocomBB has recently received as similar patch-set, adding a virty_phy
executable that can be run on a PC instead of the classic 'layer1'
firmware on a real phone.

Using GSMTAP means that one can use unmodified wireshark to decode the
messages exchanged on the virtual Um layer.

This code was originally started by Harald in January 2016, continued
by Sebastian Stumpf in late 2016 and early 2017, and finally completed
by Harald in July 2017.

Change-Id: I1bf7670975b1e367c1c62983020865a043542622
2017-07-13 19:34:17 +00:00
Pau Espin f588b5f91d Allow passing low link quality buffers to upper layers
We want to always call l1if_tch_rx and l1sap_up in order to avoid losing triggering
events on the upper layer.

With this change, the upper layer will increase correctly seq + ts for
RTP. It will then send an RTP packet with only the header and no payload, which is
not correct but at least we avoid drifting the RTP clock. Upcoming patch
in the series solves this issue.

This patch assumes that we are not lossing data events from the physical
layer and that we receive an event every 20ms, even if the MS is not
transmitting due to DTX.

Depends on libosmocore If4ae20c22b881e94585dad710f17b9e37f77bf82

Change-Id: If5df8940fab833eb4e3ed851880b66987d356031
2017-07-10 08:44:00 +00:00
Harald Welte 50f8165540 measurement: Remove dead code
We used to have trx_meas_check_compute() and call that from the
bts-specific code in order to iterate over all timeslots and all lchans
in the timeslots if we have to send measurement reports.  This was
executed once per frame, and created unequal CPU load over time, which
in turn might increase different per-ts jitter.

Since 2f028c4e2c in April 2017 we have
lchan_meas_check_compute(), which performs this on a per-lchan basis,
and hence CPU load is distributed over all active timeslots.

Change-Id: I6308cefe4a51e55719ea4ed4d613d3782b805c08
2017-06-24 12:55:11 +02:00
Harald Welte f4544573f8 OML Add osmocom-specific way to deactivate radio link timeout
In some situations (e.g. when trying to do measurements/testing on the
BTS receiver / uplink) it is useful to have a way to disable the radio
link timeout and keep any channel open until deactivated, irrespective
of whether (valid) data is received or not.

This adds a related feature that can be activated by using an
osmocom-specific value of 0xff for the TS 12.21 Connection Failure
Criterion (9.4.14).

Change-Id: I736f21f6528db5c16fa80cdb905af20673797be5
2017-06-18 10:00:43 +00:00
Vadim Yanitskiy 0227e4d04c cosmetic: fix some typos
Change-Id: Ib9172735bc7a05d9d7425a0e66dd90ff2569ee05
2017-06-15 14:40:21 +00:00
Max 61d36212b1 Cleanup SI scheduling
* use GSM_BTS_HAS_SI() from OpenBSC instead of local copy
* arrange GSM_BTS_HAS_SI() checks to improve readability
* constify SI scheduler parameters

Change-Id: If74bc536fe7d2bfbc976c07d882151873ecda4f2
Related: OS#1660
2017-06-15 13:22:12 +00:00
Max d22b5b84c0 Re-add version to phy_instance
This is resubmission of 9eeb0b1a13 with
errorneous use of talloc_asprintf() removed which should fix OS#2316.

Change-Id: I02ae6fffdc808c1ea14185dbb4a720d27a62d4bb
Related: OS#1614
2017-06-09 09:00:04 +00:00
Philipp Maier d5fdcfe6d9 measurement: fix measurement computation
Timing advance is currently not taken into account when computing
the measurement results, this commit fixes that

Change-Id: I2e0dfd13b53e8aa2822985f12bf2985e683ab553
2017-06-09 08:54:54 +00:00
Pau Espin 8a8d73a691 trx: Allow BTS and TRX to be on different IPs
Depends on libosmocore I3c655a4af64fb80497a5aaa811cce8005dba9cd9

Change-Id: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5
2017-06-06 19:23:18 +00:00
Neels Hofmeyr d36b3a8463 Revert "Add version to phy_instance"
This reverts commit 9eeb0b1a13.

This commit caused osmo-gsm-tester test runs for the sysmoBTS to fail with
SIGABRT consistently. See below redmine issues.

In osmo-bts-sysmo/l1_if.c, it uses talloc_asprintf to write to the char
version[MAX_VERSION_LENGTH]; talloc_asprintf() however is intended to work on
string buffers allocated by talloc, and attempts to reallocate version[].

Furthermore, it is not clear why the patch passes a 'data' arg to
app_info_sys_compl_cb() that is not used.

Hence I will revert this instead of trying to fix. Please resolve issues and
re-submit.

Related: OS#2316 OS#1614
Change-Id: I2c9fd5e6739c1750365c0241476ce4b1aa2df3d4
2017-06-02 22:46:16 +02:00
Max 9eeb0b1a13 Add version to phy_instance
Change-Id: I5b2352b8d15e9b0d8616fcd526b4902d247e4693
Related: OS#1614
2017-05-29 21:13:45 +00:00
Philipp Maier 2f028c4e2c measurement: make lchan_meas_check_compute() available to l1sap.c
lchan_meas_check_compute() is a static function measurement.c.
In order to distribute the measurement result calculation events,
we need to be able to call lchan_meas_check_compute() from l1sap.c

Change-Id: Ideffe896613e0feda443bc13dac59dcdbbc605aa
2017-05-17 18:56:51 +02:00
Philipp Maier 25742a5929 octphy: set tx/rx antenne IDs via VTY
add support for the TX/RX antenna-id feature that has been
introduced with release OCTSDR-2G-02.07.00-B1314-BETA. The
user can now set individual ID numbers for the TX and for
the RX antenna.

Change-Id: I872fe3c4d7b593358a4ce2f02cf0726611b9f3aa
2017-04-13 19:08:47 +02:00
Harald Welte bbe90fd651 sysmobts: Don't start with 0dBm TRX output power before ramping
In case a system has a high-gain external PA (like a 40dB PA) connected
externally, we cannot simply switch the transceiver to 0 dBm in
trx_init() only to then start the ramping at much lower levels once the
PHJ completes in trx_init_compl_cb().  The result would be a short
0 + 40 dBm spike followed by later ramping.  We want to avoid that
spike, particularly its associated inrush current, so let's bring up the
board with smething very conservative like -50 dBm, and then ramp from
there.

Change-Id: I0ad91fce64f65e0213c9fcfde3390ace519055db
Fixes: SYS#3259
2017-04-06 18:41:01 +02:00
Max f4816fa577 Sync protocol with OsmoPCU
Copy-paste changes from OsmoPCU commit 0a8fae8d141c2cfa4387ffe9b35402d5b8cc85cd.

Change-Id: I15e6cc86604947a173e8675ba4b41a3bda2d3296
2017-03-23 10:04:38 +00:00
Philipp Maier b609ee879e l1sap: fix PTCCH detection
The macro L1SAP_IS_PTCCH(fn) only detects a PTCCH channel at fn%52 = 12,
the detection logic has been extended in order to detect PTCCH at fn%52 = 38.

See also 3GPP TS 05.02, Clause 7, Table 6 of 9

Change-Id: Ia6f3333121e5e920c5e1d562a081d0a1b58a1153
2017-03-20 12:36:21 +01:00
Philipp Maier 339b9329ff l1sap: fix rach reason (ra) parsing
The ra parameter indicates the reason for the received rach
request. osmo-bts uses the ra parameter to determine if the
received rach request is packet access related. If yes,
osmo-bts will forward the request to the PCU.

In order to determine if the ra is packet related or not,
the higher 4 bits must be equel to 0x7 and at least one of
the lower 4 bits must be zero.

The current method lacks checking of the lower 4 bits. It
would also accept 0b01111111, which is reserved for future
use. This commit extends the check to take also the last
4 bits into accound.

See also: 3GPP TS 04.08, Table 9.9

Change-Id: I5eb88c42a91e158d9bfa4105ec9636035baf8959
2017-03-15 13:37:55 +00:00
Ivan Klyuchnikov e2e0ed5a89 osmo-trx-bts: Fix incorrect setting of RXGAIN and POWER parameters on second channel (TRX1) of osmo-trx
Move rxgain and tx-attenuation (power) parameters from phy_link layer to phy_inst layer.
Rxgain and tx-attenuation parameters should be set for each phy_inst and send for each osmo-trx channel accordingly via control commands.

Change-Id: I4861a59d10d1ef91954e0c6ea265e66dec08844f
2017-02-10 13:35:41 +00:00
Harald Welte df5ac9aa11 tx_power: Change PA calibration tables to use delta vales
It seems more user friendly to look at a calibration table in terms of
the delta (positive or negative) compared to the nominal gain value,
rather than a collection of absolute gain values.  It has the added
benefit that the (API/data model) user doesn't have to specify a gain
value for each ARFCN, but rather can rely on the default nominal gain in
absence of a calibration table for this specific unit.

Change-Id: I7311815902a88d2fc9d211cf4c62fa6fdc5e86ad
2017-02-07 20:17:27 +01:00
Philipp Maier 67bc885c5d octphy: Improve OML ADM state handling
Improve state handling for for lock/unlock of OC_RADIO_CARRIER obj class. in
bts_model_chg_adm_state()

Change-Id: I034114beca95210169429d8ac1eb8648df12fc6c
2017-02-01 19:16:17 +00:00
Jean-Francois Dionne a760a043c4 Fix AMR HR DTX FSM logic.
Fix SID_FIRST_INH detection during speech and when SID_FIRST is interrupted by FACCH.
Fix SID_UPDATE_INH detection during silence and when SID_UPDATE is interrupted by FACCH.
Add a delay for SID_FIRST to appear at the right time after FACCH.
Fix extra byte sent in downlink for SID_FIRST and SID_UPDATE.

Change-Id: Ia811305e15541f2376005df736bd610e8b0d2f69
2017-02-01 19:13:16 +00:00
Max 871e0bec7e OML: internalize failure reporting
* make oml_tx_failure_event_rep() static and use osmo_signal_dispatch()
  wrapped into oml_fail_rep() to trigger event reports outside of oml.c
  instead of directly calling into OML layer
* remove unnecessary formatting from text messages

Related: OS#1615
Change-Id: I738555c547926e97b325ab53763c0076c42309bc
2017-01-25 13:24:52 +01:00
Philipp Maier 2b763cc30c octphy: set tx attenuation via VTY
add code to configure the transmision power via VTY

Change-Id: I76bb8660eb1d8baeb6b8f69da4a6ba9ab7319981
2017-01-23 12:23:17 +00:00
Max df75195666 scheduler: log lchan on which prim error occured
Log both lchan and trx_chan_type (using introduced value_string).

Change-Id: I80c581b54eeee371ee524a75a400d1e9ece16c68
2017-01-10 23:29:06 +00:00
Philipp Maier 4723a19508 CTRL: make the CTRL-Interface IP address configurable
Currently the IP address where the control interface is bound
to is hardcoded to 127.0.0.1. This leads to problems with
multiple instances on one and the same machine. This commit
integrates the ctrl interface bind option into the VTY, so
that we can bind the ctrl interface to any IP address, just
like we do it with the VTY already.

Change-Id: If51e0c645c0789a4f4a8c51737fb81fb12f80829
2017-01-10 15:45:59 +00:00
Max c038cb7903 Add Abis OML failure event reporting
Send 3GPP TS 12.21 § 8.8.2 Abis/OML failure event report.

Change-Id: Ib1170edca2207752984a554d7a6a57c224f6d5f5
Related: OS#1615
2017-01-08 11:03:39 +00:00
Max f9778b2a26 DTX AMR HR: fix inhibition
* Unlike in AMR FR, in AMR HR incoming ONSET have to be treated
  differently depending on whether we've recently sent SID UPDATE or
  EMPTY frame. Split ST_SID_U FSM state into 2 states to accommodate for
  that and make sure that additional states specific to AMR HR are not
  used for AMR FR.

* Avoid sending E_VOICE and E_SID_U in corresponding states
  as those do not initiate FSM state transitions anyway. This decrease
  extra load from FSM signalling which otherwise would be triggered on
  per-frame basis.

* Introduce separate signal for SID First P1 -> P2 transition to avoid
  confusion with E_COMPL and E_SID_U initiated transitions from P1
  state.

* Don't init DTX FSM for SDCCH channels.

Change-Id: I229ba39a38a223fada4881fc9aca35d3639371f8
Related: OS#1801
2017-01-04 11:25:17 +01:00
Max fbe655f320 Optionally use adaptive RTP jitter buffering
* add vty option to manually enable adaptive RTP jitter
  buffering (disabled by default) on per-bts level
* use this setting on per-lchan level when setting jitter parameters via
  vty at runtime
* check and log result of osmo_rtp_socket_set_param()
* note: older libosmo-abis will ignore this setting which will be
  properly detected via return value
* if jitter buffer is disabled by configuring "rtp jitter-buffer 0" than
  adaptive buffering is disabled as well but it will be used if jitter
  buffer is set to different value for a givel lchan via vty

Change-Id: I489f3c419039f40b57c2ef0641c176478b8d3566
2016-12-16 14:04:50 +01:00
Max a1fa955212 Save RTP metadata in Control Buffer
Having RTP metadata is useful for debugging - save Sequence Number and
Timestamp next to Marker bit from RTP header.

Change-Id: I359b3bcb74fbfc071547fe2f9d837829374fe997
2016-12-09 11:54:38 +00:00
Max 4a85828462 Fix AGCH/PCH proportional allocation
Do not assume that 1 == BS_AG_BLKS_RES but take that information from
SI3. Note: due to current implementation quirks we activate channels
before SI3 obtained, than we deactivate channels upon receiving SI3 and
activate them again. This might not be necessary once we migrate to
proper OML state machines.

This affects lc15 and sysmo hw.

Change-Id: I11377b12680ac3b2f77f80e742b6f0af63fc9c1e
Related: OS#1575
2016-12-01 15:25:26 +00:00
Max 36153239bf Remove duplicated code
Remove lchan deactivation related code duplication to facilitate future
use for dynamic CCCH re-activation.

Change-Id: Id0d3b19dbfaa16d1734321a07a6eb0355bfd77c9
2016-12-01 15:20:42 +00:00
Max aabeb2eae4 DTX DL AMR: rewrite FSM recursion
Add explicit state for recursion (sending the different payload data in
response to the RTS request for same FN) and corresponding
transition. Remove ST_FACCH_V as with new explicit recursion handling it
becomes unreacheable. This makes it easier to maintain
preemption (interruption of current procedure due to FACCH or
Inhibition). This also reduces the number of possible transitions out of
each state thus reducing graph's cyclomatic complexity.

Change-Id: If39b68083d23a4a35f468a5d75f54eb733ebfd14
2016-12-01 14:49:43 +00:00
Max 66325aee71 Replace link_id constant with define
Instead of using constant for link_id directly, use shared define value.

Change-Id: Ibf3d439d8893bd994ba089796175b6c635db2cf8
2016-11-11 15:52:49 +01:00
Max 5ee3dba39f DTX: wrap FSM signal dispatching
Make wrapper function which checks that DTX is enabled for lchan before
dispatching any events.

Change-Id: Id8b519c4af6d505ec9a4b9aadd5107bf7af53d66
2016-11-08 12:28:52 +01:00
Max 9f936344ea DTX DL: tighten check for enabled operation
Introduce dtx_dl_amr_enabled() function which checks that DTX is enabled
and FSM is allocated and use it for all corresponding checks.

Change-Id: Ifa68b641265ed14f242765c85e40da2d1021a541
2016-11-08 12:22:40 +01:00
Max acfccb3f02 DTX fix ONSET handling
* re-introduce ST_ONSET_F to guard from repetitive ONSET messages in case
  multiple FACCH occur duriing DTX silence period.
* produce ONSET event after both SID FIRST and UPDATE in case of AMR FR.
* always dispatch E_SID_F (SID FIRST) signal if in talkspurt.
* allow E_SID_* right after ONSET (zero-length talkspurt).
* add missing E_ONSET signal description.
* fix FSM transitions for AMR HR *Inhibited and First P*.
* fix incorrect return from l1if_tch_encode() in ONSET FACCH with
  incoming SID UPDATE

Change-Id: I0e9033c5f169da46aed9a0d1295faff489778dcf
Related: OS#1801
2016-11-03 12:31:37 +00:00
Max 9d102508a8 Remove obsolete define
It was moved to OpenBSC in 582e4f627674f46310a90d9061e82fb342051b42 as
it's used by both projects.

Change-Id: I8aba987e3cdaa840cf3e14913a8455b0ba759889
2016-11-02 09:29:39 +00:00
Max bce25a60f4 DTX DL: split ONSET state handling
Handle ONSET cause by Voice and FACCH separately. In case of Voice we
have RTP payload which we have to cache and send later on in next
response to L1 RTS. FACCH have higher priority so it preempts both voice
and silence alike - hence we can send ONSET immediately but still have
to track previous state in order to get back to it gracefully.

This affects lc15 and sysmo hw as there's no FSM-based DTX
implementation for other models yet.

Note: this requires patch for OpenBSC which adds FACCH buffer to tch.dtx
struct.

Change-Id: Idba14dcd0cb12cd7aee86391fcc152c49fcd7052
Related: OS#1802
2016-10-28 13:42:29 +00:00
Max c22da59342 Extend RTP RX callback parameters
Adopt to change in libosmo-abis to accept additional parameters in RTP
RX callback function.

Change-Id: Icf41e568f041e87b38e6192af0be90c42362bfee
2016-10-21 19:53:34 +02:00
Max ebb483b69a Replace magic number with define
SDCCH occupy lchan 0..3 in combined configuration so for CCCH we've
always used lchan[4] - replace it with CCCH_LCHAN define and add
comment.

Change-Id: Ic5d742c292d638f119c6b4672120c1950adeb7f0
2016-10-18 08:08:25 +00:00
Max babd05661d DTX DL: use FSM for AMR
Use dedicated FSM to handle all DTX DL related events:
- add explicit checks if DTX DL is enabled (fixes regression for non-DTX
setup introduced in 654175f33b)
- fix handling of AMR CMI for SPEECH frames
- add FSM for DTX DL
- sync with corresponding changes in OpenBSC's
- handle FACCH-related DTX ONSET events

This affects both lc15 and sysmobts and requires corresponding change in
OpenBSC (Change-Id: Idac8609faf9b5ced818fde899ccfc6ed0c42e8fd).

Change-Id: I74a0b42cb34d525b8a70d264135e82994ca70d31
2016-10-13 06:58:06 +00:00
Max 4ca5be766c Move copy-pasted array into shared header
Change-Id: I377ece2845830e3defab2d515f44b629ce5aed8e
2016-10-12 09:30:06 +00:00
Yves Godin c1b86d80d1 DTX: fix 1st RTP packet drop
Use "impossible" dummy value to initialize last_fn to prevent dropping
of 1st RTP frame due to timestamp jump.

Fixes: OS#1803
Change-Id: I485af21f6761048d12dc7f5552fcdd46daf786ed
2016-10-11 15:50:29 +00:00
Philipp Maier f5494e84e8 octphy: reintroducing multi-trx support
The multi-trx had to be removed because of build conflicts
with octphy header that lack the struct members for needed
to support multi-trx.

For details see the following revert-commits:
ed6b48e4a5
c9a1f284ac

This commit reintroduces multi trx support and ads an ifdef
decision to ensure that header files without multi-trx
support still work.

Change-Id: I7f9b2906cc149c817183745b4c96bcc7f9ebdad0
2016-10-06 09:48:02 +00:00
Max 067ef3f1ce DTX: move ONSET detection into separate function
Move code from tch.c (lc15, sysmo) into generic function which:
- check if talkspurt is happening
- cache SID if necessary or invalidate cache
- fill in CMR & CMI prefix

This also fixes the problem when SID FIRST was cached without sending
just like SID UPDATE instead of being sent right away.

Change-Id: I6c7016a54749abadeef4fd4f5b6f750b256fb916
2016-09-30 19:09:04 +02:00
Max 9959f45d90 DTX: further AMR SID cache fixes (lc15, sysmo)
* consolidate AMR CMR and CMI handling in common/amr.c
* use it in save_last_sid()
* remove dead code
* properly compute RTP payload length for AMR
* use save_last_sid() for FR & HR as well
* invalidate cached SID if SPEECH frame is received

Fixes: OS #1800, #1801
Change-Id: I5a1c1ad0b0a295a50e67775a4db85f1d331755ed
2016-09-30 18:57:00 +02:00
Max 7dffd553df DTX: move scheduling check inside repeat_last_sid
Note: this also require changes to properly link against libosmocodec -
see 2bb65be159dfdabf664fec569b343320301701b0 in libosmocore.

Change-Id: I96594cf3aa1013d505bd20069d5bf261d9a2aefb
2016-09-30 16:50:47 +02:00
Max 654175f33b DTX: check Marker bit to send ONSET to L1
If Marker bit is set than it's a talkspurt which we have to explicitly
indicate to L1 by first sending ONSET message and than actual voice
data in a separate message.

This change affect sysmobts and LC15 hw.

Change-Id: I88c41568bcb0d82699f617adc4ad192603dd1bb6
Related: OS#1750
2016-09-24 15:09:31 +02:00
Max 527dd402c7 DTX: fix SID repeat scheduling
Previously SID retransmission was scheduled incorrectly based on GSM
frames instead of voice frames. Fix this by using GSM Fn only as elapsed
time estimation:

* move saved SID retransmission into generic function from lc15 and sysmo
specific code
* split retransmission time check into separate generic function
* compute estimation for elapsed time since last retransmission using
  GSM Fn

Change-Id: Ib054b458a7345d9ba40dba53754ca59ab099c8e8
Fixes: OS#1799
2016-09-23 16:57:05 +02:00
Neels Hofmeyr ed6b48e4a5 octphy: fix build: Revert "octphy: fix for multiple trx with more than 1 dsp"
This reverts commit 06968beab9.

Theoretically, this patch makes a lot of sense, but in order to be able to
build osmo-bts-octphy until the headers version is clarified, revert use of
usCentreArfcn:

Above commit uses an usCentreArfcn member that is never defined in the history
of our octphy-2g-headers.git. This usCentreArfcn does exist in a code snapshot
OCTSDR-2G-02.05.00-B780-DEBUG, which is not (yet?) publicly available.

Also, the current headers version is apparently 02.07, though the octasic
version numbers have been known to cause confusion among osmocom folks.

This along with one other revert fixes this build problem:

make[3]: Entering directory '/n/s/octphy/git/osmo-bts/src/osmo-bts-octphy'
  CC       l1_oml.o
l1_oml.c: In function ‘l1if_trx_open’:
l1_oml.c:1350:13: error: ‘tOCTVC1_GSM_TRX_CONFIG’ has no member named ‘usCentreArfcn’
   oc->Config.usCentreArfcn = plink->u.octphy.center_arfcn;
             ^
l1_oml.c:1352:13: error: ‘tOCTVC1_GSM_TRX_CONFIG’ has no member named ‘usCentreArfcn’
   oc->Config.usCentreArfcn = trx->arfcn;
             ^
In file included from ../../include/osmo-bts/logging.h:5:0,
                 from l1_oml.c:33:
l1_oml.c:1365:13: error: ‘tOCTVC1_GSM_TRX_CONFIG’ has no member named ‘usCentreArfcn’
   oc->Config.usCentreArfcn, oc->Config.usTsc, oc->RfConfig.ulRxGainDb,
             ^

Change-Id: I222766f6961f5f35aa3651e2907e3e908fe9a66e
2016-09-06 15:28:44 +02:00
Neels Hofmeyr bf6bae2b23 common/rsl: move decision whether to chan act ack/nack to common function
Prepare for a dyn TS patch that needs to call rsl_tx_chan_act_ack() directly
without the rel_act_kind decision.

Add function rsl_tx_chan_act_acknack() to wrap rsl_tx_chan_act_ack() and
rsl_tx_chan_act_nack(). Move the decision whether to drop the ack/nack, based
on lchan->rel_act_kind, to the new function, losing some code dup.

Change all callers to use the new function; drop the two older ones from rsl.h
and make them static.

Note: for nack, the exception for dyn TS in PDCH mode was missing
(rsl_tx_chan_act_nack() had only the rel_act_kind != LCHAN_REL_ACT_RSL
condition, but should also have had the dyn TS exception as in
rsl_tx_chan_act_ack()). I already know that this exception will again be
removed in an upcoming commit, but for patch readability it logically makes
sense to add it here. To easily include the nack case, drop the check for which
pchan the dyn TS is operating as, because a rel_act_kind == LCHAN_REL_ACT_PCU
implies that it is either already in or trying to become PDCH mode.

Change-Id: I57ba60c670730c6d7877a6a9b96ece0a7679a0bb
2016-09-02 04:12:16 +02:00
Neels Hofmeyr 9faaf4ecf0 cosmetic: common ts_is_pdch()
Have one common ts_is_pdch(), placed in lchan.c, since this file is pretty
empty and pretty close to ts. Publish in gsm_data.h.

Remove the if-style implementation from l1sap.c, and instead implement in a
switch statement.

This prepares for upcoming ts_is_pdch() usage in ph_data_req() for sysmo and
lc15.

Change-Id: Ib78d663fdbac5a1d7053f1b9d543649b66da00e2
2016-08-30 07:35:47 +00:00
bhargava e77bcaecb6 Change interface in osmo-bts for 11 bit RACH
Interface structure between osmo-bts and osmo-pcu is updated with the
parameters to differentiate the type of RACH and further support 11 bit
RACH. The function prototype and definitions are changed accordingly.
Interface version number is increased.

Change-Id: I4f4c501b2d86d77c78de32a84b1804172ffb6f4d
2016-08-27 01:20:46 +00:00
Max 4b76a323b3 Fill measurements data for L1SAP
Fill in values for BER, BTO, Link quality in L1SAP and send them to
PCU. Note: this increases the version of BTS <-> PCU protocol. It also
requires corresponding changes in libosmocore.

All BTS models provide measurements data unless direct DSP access for
PCU is enabled. For BTS-specific notes see below.

Octphy: conversion from sSNRDb to Link Quality uses formulae which works
in practice instead of what's documented for sSNRDb value. Subject to
change in future revisions.

TRX: C / I link quality estimator is not computed.

Change-Id: Ic9693a044756fb1c7bd2ff3cfa0db042c3c4e01c
Related: OS#1616
2016-08-08 17:41:27 +00:00
Tom Tsou dab54b9178 trx: Enable EGPRS handling through burst lengths
Existing interfaces are coded with the implicit expectation of using
a burst sequence length of 148, which is constant with GSM and GPRS.
That changes with EGPRS, where the burst length may be 444 due to
the use of 8-PSK instead of GMSK modulation.

Setup the interface to accept and return a length value with the
burst sequence. This allows 444 length bit vectors to/from the
EGPRS decoder/encoder. Length is explicitly used as a identifier for
8-PSK vs. GMSK modulated sequences.

Change-Id: I90b46b46b11b6ce280e7f8232d5a2fccec2d4f18
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-07-28 06:18:12 +00:00
Neels Hofmeyr 6e656748b7 code dup: join [rsl_]lchan_lookup() from libbsc and osmo-bts
lchan_lookup in openbsc abis_rsl.c and rsl_lchan_lookup() rsl.c are the
same code, except for the log context, which is only set in abis_rsl.c.
The common code was factored out to gsm_data_shared.c in openbsc.git.

Use the *rc return code argument to keep the logging part in the newly
introduced thin wrapper lchan_lookup() in common/rsl.c. This also removes code
dup for logging

The rsl_lchan_lookup() implementation is removed from osmo-bts, so a recent
openbsc is needed to build this.

Change-Id: Ibc469b75e31560271be8633d524366442d27e6fb
2016-07-25 22:13:44 +02:00
Tom Tsou 73cb583e51 trx: Add EGPRS tables, sequences, and mappings
Includes EGPRS specific convolutional codes, interleaving tables
and functions, burst mappings, training sequences, and parity
checks from 3GPP TS 44.060 needed to handle MCS codings 1-9.

Change-Id: Ie270398dd7a72f282ba53e646853d8de1eabee93
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-07-25 18:36:29 +00:00
Neels Hofmeyr c9582ac2d7 prepare dyn TS: split/replace conf_lchans_for_pchan()
Move the actual switch from static conf_lchans_for_pchan() into new 'public'
function conf_lchans_as_pchan(), adding an explicit pchan argument. This allows
passing a non-trivial pchan, for dynamic TS.

conf_lchans_as_pchan() now takes a pchan argument, so distinguish the naming
and drop the 'for_pchan' from conf_lchans_for_pchan(), which takes only a ts
argument.

Change-Id: I8e458501fff5503c243512aeb3469c12b1f2bbc4
2016-07-25 15:22:06 +00:00
Neels Hofmeyr 334df9441a cosmetic: clarify TCH/F_PDCH related naming and comments
We're about to introduce a new kind of dynamic channel, which will also use
parts of the ip.access mode dyn PDCH code paths. Make sure the general parts
have general names and mark ip.access specific parts as such.

Rename dyn_pdch_ts_[dis]connected() to cb_ts_[dis]connected().
Rename dyn_pdch_complete to ipacc_dyn_pdch_complete().
From cb_ts_[dis]connected(), factor out the current code into static
functions ipacc_dyn_pdch_[dis]connected() -- this will make sense once the
new dynamic kind is added to cb_ts_[dis]connected().

Change-Id: I7da5b7cb7b48572671f50e0dec97d9eec3083df1
2016-07-25 16:38:18 +02:00
Neels Hofmeyr b151301c6c cosmetic: osmo-bts-trx: add comment, fix comment typo
Change-Id: Iea62bd98954d0219ba597613cea6db63f7a6b396
2016-07-09 19:50:50 +00:00
Max c03d3ae7af DTXu: move copy-pasted code to common part
Abstract code for checking/setting lchan's UL SID flag and RTP Marker
into generic function and use it for LC15 and sysmoBTS.

Change-Id: Ica5392e92bab29164711163e7b01adb174272883
Related: OS#1750
2016-06-23 20:01:02 +00:00
Max 5c0d88e69d Make get_lchan_by_chan_nr globally available
* Remove static qualifier
* Remove duplicated code - use generic function instead

Change-Id: I37a312648771f58d3087471083cfcebbd97ccf1d
2016-06-23 20:00:44 +00:00
Max 61372a20de Move copy-pasted code into common part
Related: OS#1750
Change-Id: Ic4342eaf7e32a0e9a5f2b16dd196a1f5f03152a9
2016-06-18 11:35:12 +00:00
Neels Hofmeyr 24a31cfe43 dyn PDCH: implement main dyn PDCH logic in common/
React on IPAC PDCH ACT and DEACT messages and invoke the PCU and bts_model_ts_*
APIs to effect switchover. The dyn PDCH interaction is described in the comment
to rsl_rx_dyn_pdch(), the main entry point for PDCH switchover.

In case the bts_model_ts_* are not implemented (or return other errors),
reply with an IPAC PDCH ACT/DEACT NACK.

Add callbacks that mark steps in the PDCH switchover process,
dyn_pdch_ts_disconnected(), dyn_pdch_ts_connected() and dyn_pdch_complete().

Add hooks in l1sap.c on channel activation and release confirmation, to call
dyn PDCH callbacks.

BTS dyn PDCH implementations should invoke dyn_pdch_ts_disconnected() and
dyn_pdch_ts_connected() when bts_model_ts_disconnect() or
bts_model_ts_connect() are called, respectively. (upcoming for sysmoBTS)

Change-Id: Id2f5f77121a65d6c14eac127b3d4fb50e97a77ab
2016-06-17 15:50:48 +00:00
Neels Hofmeyr 9375aa9a68 dyn PDCH: add bts_model_ts_connect() and _disconnect() stubs
Enhance bts_model_ API in preparation of dyn PDCH switching. These will be used
to re-connect a TCH/F_PDCH TS in a different mode: either as TCH/F or as PDCH.

All implementations so far return -ENOTSUP, and thus will cause a IPAC PDCH ACT
or DEACT *NACK* to be sent to the BSC as soon as these messages are handled.

Also add stubs in tests.

Change-Id: I21e60c028a1333431c3ed000f788b654d1170b0d
2016-06-17 15:50:47 +00:00
Neels Hofmeyr 703c2d6eb8 pcu_sock: add pcu_connected() to query PCU availability
Will be used in upcoming dyn PDCH switching.

Change-Id: I8031089ad5e9cb9690ca7e22facc53438f28e12a
2016-06-17 01:24:25 +00:00
Max 7cc3c3156e Fix OML activation
Previously software activation could have been reported multiple times
which broke proper BTS init. Introduce guard variable to ensure
reporting happens only once.

Note: this is just minimal workaround - ideally proper OML state machine
should be implemented.

Change-Id: Ifffbdb756bc5d2864f985c01a3299b839c4de7af
Related: OS#1648
2016-06-16 12:43:44 +02:00
Minh-Quang Nguyen 58e4e18206 LC15: TRX nominal TX power can be used from EEPROM or from BTS configuration
Change-Id: I173f4126cea41959d48def07bff25fcd29894b7e
2016-06-15 09:45:02 +00:00
Minh-Quang Nguyen 495fed9f43 l1sap.h: fix wrong L1SAP_FN2PTCCHBLOCK calculation according to TS 45.002 Table 6
We have seen that the DSP time to time rejects PTCCH message from BTS due to invalid block number.
As a result, we patched FN2PTCCHBLOCK calculation according TS 45.0002 Table 6.


Change-Id: I8be1c8b9159c94788857c6de5440a418739f1212
2016-06-14 21:57:06 +00:00
Max 201b424b73 Use libosmocore function for uplink measurements
Related: OS#1563
Change-Id: Ide47e8e69e0d2d5859c5249b22f4bad22c18aa57
Reviewed-on: https://gerrit.osmocom.org/108
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-05-31 11:58:08 +00:00
Max ed494443cc Ensure TRX invariant
There is implicit invariant in trx_phy_instance() which is actively used
by various hw-specific implementations to get TRX's phy instance. Let's
make sure there's explicit assertion for this because there's been
segfaults in the past related to it.
2016-04-29 13:03:35 +02:00
Max 06968beab9 octphy: fix for multiple trx with more than 1 dsp
Explicitly store and use "center" arfcn used by each dsp (1 dsp
corresponds to 1 phy link).
2016-03-21 17:20:11 +01:00
Holger Hans Peter Freyther 2278fdc580 pcuif: Do not bump the PCU_IF version
I had accidently bumped the version as I thought that osmo_ph_pres_info_type
was part of the ABI. It is not an only internal to the BTS. Revert
this part of the change.
2016-03-10 16:10:11 +01:00
Max cb20c83323 Fix ocmo-bts-octphy interaction with OsmoPCU
Previously osmo-bts-octphy have not provided in-band presence
information which cause off-by-one errors and misinterpretation of
ph_data_ind by PCU. This fixed now by adding support for explicitly
passing PH-DATA presence info. Corresponding check and in-band passing
of presence information are removed.

Note: this requires libosmocore version with osmo_ph_pres_info_type
support integrated.

[hfreyther/max: Remove + 1 from the decoded length]
2016-02-22 13:57:54 +01:00
Harald Welte a9a7120c82 make PCU socket and telnet port configurable
In some cases we'd like to run multiple instances of osmo-bts on a
single machine.  This is the case where we a multi-TRX PHY is to be used
for several BTSs, or in case osmo-bts-trx has multple SDRs attached.

This wa currently prevented by having a hard-coded PCU socket path
and telnet port, which are now configurable via VTY / config file
itself.
2016-02-15 14:27:52 +01:00
Harald Welte 5dfb115eaf declare pcu_direct in pcu_if.h 2016-02-15 14:27:47 +01:00
Harald Welte c6723c8206 move auto-band configuration commands to common/vty.c
It remains up to the individual BTS hardware models to decide
whether or not to register those commands (depending on whether they
support the feature) via cfg_bts_auto_band_cmd / cfg_bts_no_auto_band_cmd
2016-02-15 14:27:43 +01:00
Harald Welte e9a17292e8 LC15/sysmobts: Don't try to refer to fl1h from PHY config
At the time the phy link / phy instance level VTY configuration
commands are parsed, we did not yet call l1if_open() and thus
pinst->u.{lc15,sysmobts}.hdl == NULL.

PHY or PHY instance specific configuration must thus be stored inside
the phy_link or phy_instance itself, and not inside the (not yet
existing) handle.

We solve this by moving around some parameters:
* clk_use_eeprom/clk_cal/clk_src/calib_path get replicated in
  phy_instance
* min_qual_{rach,norm} are moved into the generic part (which means
  that osmo-bts-octphy and osmo-bts-trx should also implement them)
2016-02-15 14:27:29 +01:00
Harald Welte 9684099ae9 sysmobts/LC15: Fix startup-time DSP trace flage configuration
Due to the changes introduced by the phy_link API, it's not easy to set
the default DSP trace flags via a command line argument anymore.  We now
rather introduce a persitent VTY configuration command, by which the
default DSP tracing configuration can be set (for each PHY).

The persistent trace flags are stored in the phy_instance, while the
current operational run-time flags are in fl1h->phy_instance.
2016-02-15 14:27:20 +01:00
Harald Welte 38933afdd9 introduce + use new generic vty_get_phy_instance()
this function is intended to be used by VTY commands that need to
resolve a given PHY interface.
2016-02-15 14:27:16 +01:00
Harald Welte 1dcb97eaa3 LC15: port litecell 1.5 support to recent osmo-bts master
This includes changes required for
* shared main() function accross all BTS models
* use of the new phy_link / phy_instance infrastructure as the basis
  for true multi-TRX operation
2016-02-15 14:26:55 +01:00
Harald Welte a02bf125ac port sysmobts to phy_link/phy_instance abstraction 2016-02-15 14:18:59 +01:00
Harald Welte d784e50747 Introduce new phy_link and phy_instance abstraction
This way we can model a flexible mapping between any number of PHYs,
each having multiple instances, and then map BTSs with TRXx on top of
those PHYs.
2016-02-15 14:18:59 +01:00
Harald Welte 1a5b00ebe2 TRX: Move scheduler to src/common
This is the final step to make the L1 scheduler generally available
to other BTS models than OsmoTRX.
2016-02-15 14:17:55 +01:00
Harald Welte 131ab36e3a abis: Add a queue of OML messages
When the oml_link is down or not yet established, we currently lost
any OML messages that were scheduled for transmission to the BSC.  Let's
prevent that by keeping a queue of OML messages, which is drained at the
time the OML link comes up again.
2016-02-03 18:45:39 +01:00
Harald Welte 611ef23700 merge bts-specific main function into common/main.c:bts_main()
This removes a lot of copy+paste duplication between different BTS
models.
2016-01-22 09:09:09 +01:00
Harald Welte a0192b859b Add new bts_model_ctrl_cmds_install()
This is one step in making the main() functions of different
BTS models more similar, so we can share one code rather than multiple
copies of it.
2016-01-22 09:09:09 +01:00
Harald Welte 3d431bb4eb Fix T200 default values
t200_ms is an unsigned int [7] array, while the oml_default_t200_ms was
an uint8_t[7] array, which we memcpy() to the former as default
initializer.  Fix this by turning oml_default_t200_ms into unsigned int,
too.
2016-01-17 21:10:09 +01:00
Harald Welte 773ab8b2c5 TRX: replace some more 2715648 magic numbers with GSM_HYPERFRAME 2016-01-16 17:48:57 +01:00
Harald Welte 601781f463 move 'GSM_FR_BYTES' and related definitiions to common part 2016-01-16 17:48:20 +01:00
Harald Welte e9f12acbeb LAPDm: Use T200 settings from OML rather than libosmocore defaults 2016-01-16 16:25:52 +01:00