Commit Graph

3284 Commits

Author SHA1 Message Date
Keith Whyte 65337b739a vty info: MS power levels in dBm are not negative
Change-Id: Ib928a1378bc00b8ccb0365e5536f010e1f8a3d43
2024-03-31 12:38:05 -06:00
Harald Welte 3c09964b11 README.md: Add Forum + Issue Tracker sections
Change-Id: I2a25ae51cd5c9fdd48575715f3fa11c8631af32d
2024-03-23 12:10:23 +01:00
Harald Welte 798b28728b Add funding link to github mirror
see https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository

Change-Id: Ib500e79ae7cc93ff0fc24db47f76d27109eb01f9
2024-03-23 12:07:42 +01:00
Harald Welte aec0422c8f common: Add RTP related rate counters
Let's add some rate counters to add visibility to the BTS on what is
happening in terms of received and/or transmitted RTP packets.

This should help during debugging any RTP related issues.

Change-Id: Ide674bde10b0e4b501d6a48947b983090342dfec
2024-03-18 10:09:47 +01:00
Harald Welte 3c133dc386 osmo-bts-virtual: Port over to osmo_io
osmo_io permits us to use the io_uring backend, which should
significantly speed up the many small read/writes we're doing
on virt-um.

Change-Id: Icfe42da00fd446c38090055e2baa5d5e0ae5b70c
2024-03-16 21:08:22 +01:00
Harald Welte 3af73977dd sysmobts_mgr_temp: Migrate to ctrl_cmd_send2()
ctrl_cmd_send() is now a deprecated API function.

Change-Id: I663669a1bcf7b58d6a6175cbb51c333f5cfaedd7
Depends: libosmocore.git Change-Id Ic81af56e7ea6921ba39168727ef64c308e9c6754
2024-03-02 19:05:07 +01:00
Harald Welte a7263b6474 Fix license headers.
We have licensed the code under GNU Afffero Public License,
and state that in the first paragraph as well as in the link
to the license.  However, a paragraph in the middle stated
"see the GNU General Public License", which is somewhat misleading.

Let's fix that.

Change-Id: I37e503b195fe43e1da42c080900504ca8e682e76
2024-02-17 10:21:30 +01:00
Vadim Yanitskiy 82a2a8d9b4 doc/examples: fix missing config files in release tarballs
All config file examples must be listed in EXTRA_DIST unconditionally.
Adding them conditionally results in incomplete release tarballs,
containing only 'osmo-bts-virtual.cfg' and failing to build.

Change-Id: I167027afde3cee40a3b52adfaec7bde91ba896da
Related: OS#6349
2024-01-28 23:16:42 +07:00
Vadim Yanitskiy e94553a547 osmo-bts-trx: add test VTY command to send arbitrary TRXC messages
Change-Id: Iabc9b702e5f1513187e24f45d9ffe06ea940c3ec
2024-01-23 04:01:27 +07:00
Neels Hofmeyr 088f4ffd57 early-IA: use the correct TRX
In early-Immediate-Assignment, the BSC sends the IMM ASS message
directly after it sent the Channel Activation message, and osmo-bts
should cache it until the Channel Activation is complete.

So far the code had a bug: it assumed that the lchan was on the same TRX
where the IMM ASS is transmitted -- but actually, 'trx' refers to the
BCCH channel's TRX, i.e. always c0.

Instead, look up the correct TRX by the ARFCN in the IMM ASS message.

Now, when frequency hopping is enabled, there will be no ARFCN in the
IMM ASS message, hence this fix does not work with frequency hopping.
Related osmo-bsc patch disallows this combination.

(To also support frequency hopping, osmo-bsc would need to modify the
RSL protocol: send the IMM ASS message as a custom IE directly as part
of the Channel Activation. Then it is always possible to correllate the
IMM ASS with a specific trx and lchan, no matter what information it
contains. However, early-IA is a "bad" feature in itself as it
"promotes" having high latency on Abis. It seems unnecessary to do extra
work to also support this odd use case for frequency hopping.)

Related: osmo-bsc I8d375e5155be7b53034d5c0be5566d2f33af5db0
Related: SYS#6655
Change-Id: Id9a930e5c67122812b229dc27ea2bfe246b67611
2024-01-10 07:56:23 +00:00
Vadim Yanitskiy 950ed8bc4d l1sap: fix logic error in gsmtap_csd_rlp_process()
Current code evaluates as follows:

   (trx->arfcn | is_uplink) ? GSMTAP_ARFCN_F_UPLINK : 0

while we want it to be evaluated as follows:

   trx->arfcn | (is_uplink ? GSMTAP_ARFCN_F_UPLINK : 0)

Change-Id: Ida3d684968a3e4a45531d4b6d7b6af170e3e39f4
Fixes: CID#338165
2024-01-06 16:40:13 +00:00
Matan Perelman 59c641d20e ctrl: Add max ber10k rach
Change-Id: I466ee7ab0f8b24f14a91875ae2c720da3e506bd1
2024-01-04 19:09:06 +02:00
Harald Welte 1f755bcfee gsmtap-rlp: Add support for skipping generating NULL frames
If there's nothing to transmit over a CSD NT channel, both ends generate
NULL frames.  Let's add an option to suppress GSMTAP output for those,
creating pcap files with less noise.

Change-Id: I85a2159cfaa01bfb4205c1462e3a9dbda68e4bad
Depends: libosmocore.git I2d9bd8eb4f0cd0f72c436996767b199429596917
2023-12-21 11:37:41 +00:00
Harald Welte 7786d9b673 Add GSMTAP encapsulation of RLP frames in CSD NT mode
In CSD (Circuit Switched Data) NT (Non-Transparent) mode, there
are RLP (Radio Link Protocol) frames inside the modified V.110.

wireshark alrady has a dissector for this, and we've introduced
a GSMTAP type for RLP some time ago.  So with this patch, we now
generate such GSMTAP RLP frames.

Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219
2023-12-21 11:37:41 +00:00
Andreas Eversberg f60f45e7ab OML: Add Get Attributes for supported MOs for Channel Object Class
Get Attributes of Channel Object class that osmo-bts supports are added:

* ARFCN List
* Channel Combinations
* TSC
* HSN
* MAIO

Related: OS#6172
Change-Id: I56e067be9e5c17625c7da4e982b90927802f57b4
2023-12-19 14:19:06 +01:00
Andreas Eversberg 722767a49d OML: Add Get Attributes for supported MOs for Radio Carrier Object Class
Two Get Attributes of Radio Carrier Object class that osmo-bts supports
are added:

* RF Max Power Reduction
* ARFCN List

Note: Only one ARFCN is reported, because synthesizer hopping is not
      supported. The NM_ATT_ARFCN_LIST in the Set Radio Carrier
      Attributes message currently allowes one ARFCN only.

Related: OS#6172
Change-Id: I49ab516c38a986520f1d3f6e26ddd20ee16688ac
2023-12-19 14:19:05 +01:00
Andreas Eversberg 90f6ebcd3b OML: Add Get Attributes for supported MOs for BTS Object Class
Most Get Attributes of BTS Object class that osmo-bts supports are
added. Not supported attributes are:

* T200
* Starting Time
* HW Configuration

Related: OS#6172
Change-Id: I067c6bdea3c44d5a731bcfdcfe304c14629eb3db
2023-12-16 11:53:25 +01:00
Andreas Eversberg 17fe7d6841 Use polling based LAPDm with frame numbers
Osmo-bts uses the new polling based LAPDm implementation.

The OML message NM_ATT_T200 is ignored, because T200 timeouts are set to
the minimal response time. Longer timeouts would cause lower throughput
in case of lost frames. Shorter timeouts would cause LAPDm to fail.

Related: OS#4074
Depends: libosmocore.git I6ebe83f829d7751ea9de1d90eb478c7a628db64c
Change-Id: Ic6d7902b13cf491daaa8752db78f9875387aeffd
2023-12-11 10:06:21 +01:00
Andreas Eversberg 1013ca3b8b Handle empty (idle) PDCH blocks gracefully
An empty PDCH block contains no payload, sysmo-bts and similar BTS
models crash, because they expect the msg->l2h to be set. The function
l1sap_pdch_req() will not set msg->l2h for empty PDCH blocks, so these
models crash.

The current osmo-pcu does not send empty PDCH blocks to these BTS
models. But there shouldn't be a crash, if we receive empty PDCH blocks
over the PCU socket interface.

Change-Id: Icb52c896766425fcf453c65530c4c0b8d06b8821
2023-12-11 10:06:19 +01:00
Andreas Eversberg 647b8d0978 LAPDm: Reject (release) establishment on DCCH, SAPI 0 without L3 payload
If the channel is activated for immediate assignment, the initial data
link establishment on main signaling link with SAPI 0 must have L3
infomation included in the SABM message. If this is not the case,
release the data link without notifying BSC.

Related: OS#5971
Change-Id: I6819b51a876b8743c2d4a04165b7900723a1631c
2023-12-11 10:06:16 +01:00
Andreas Eversberg bc6cc67115 Transmit invalid AMR speech blocks instead of dummy FACCH
Every BTS needs to have some graceful handling for the scenario
where it is time to send out a speech frame on TCH DL, but there is
no frame to be sent. One possible solution is to transmit dummy
FACCH, but this option is unattractive for TCH/AHS where FACCH
displaces two speech frames rather than one. A more elegant solution
is to emit a speech frame that is bad, causing the MS receiver to
declare a BFI condition to trigger substitution and muting procedure.
A bad frame is generated by gsm0503_tch_{afs,ahs}_encode() by setting
the payload length to 0.

Depends: libosmocore.git I82ce2adf995a4b42d1f378c5819f88d773b9104a
Related: OS#6049
Change-Id: I056f379715c91ad968f198e112d363a9009dc1c3
2023-12-06 16:33:00 +00:00
Andreas Eversberg bc4ca18a31 Use uniform log format for default config files
Related: OS#6272
Change-Id: I08b297ea78e7cd60f28f0df79f2096f70c0692c6
2023-12-01 11:50:12 +01:00
Philipp Maier 4a6a2fdf7e pcuif_proto: signal BTS model via PCUIF
At the moment the PCU has no way of knowing with which BTS model it is
used with. However, some BTS models may require slightly different
behaviour by the PCU, depending on which BTS model is used. So, lets add
an additional bts_model field to struct gsm_pcu_if_info_ind in order to
convey the exact BTS model to the PCU.

Related: OS#6191
Depends: osmo-pcu.git I48eb75f65ab54fdec41ef913e24c1f18cd4a4047
Change-Id: Ib51238a0e09d4484a539a7f822864189872698b6
2023-11-21 09:17:00 +00:00
Vadim Yanitskiy 28b8759465 osmo-bts-trx: eliminate ul_bursts_prev, use the primary buffer
When adding support for Circuit Switched Data calls, we had to enlarge
the burst buffer size to accommodate bits for a maximum of 24 bursts.

Let's take advantage of this by utilizing the currently unused part of
the Uplink burst buffer for storing bits of previously decoded blocks.
This eliminates the need to allocate additional memory for SACCH.

Change-Id: I15047cd1df4476054b36f05616e41f5297d9bfe5
Related: SYS#5114, OS#4794, OS#4795, OS#4796
2023-11-14 12:22:32 +00:00
Vadim Yanitskiy 25aae40e17 osmo-bts-trx: use BPLEN macro instead of magic numbers
Change-Id: I7d89b2e50c7eeb54b734c4959eeeb1c63a51a315
2023-11-14 12:22:21 +00:00
Vadim Yanitskiy dc3b78da01 osmo-bts-trx: add_sbits(): simplify, improve coding style
Change-Id: I518a8ea268a9a6d48b04c291a03e5efbed5f571d
2023-11-14 12:22:21 +00:00
Vadim Yanitskiy 7c76630024 osmo-bts-trx: tx_tch[fh]_fn(): fix sending idle CSD frames
In accordance with 3GPP TS 44.021, sections 8.1.6 and 10.2.3, the
transmission of idle frames to the DTE is mandated when no data is
received from the radio interface.  An idle frame has all data,
status, and E-bits to binary '1' (excluding the alignment pattern).
This requirement is currently implemented for the Uplink, see
function csd_v110_rtp_encode().

However, 3GPP TS 44.021 does not explicitly specify whether the same
rule is applicable to the Downlink, perhaps assuming a continuous
stream of bits on the CSD-over-TDM link.  Currently, we transmit
a sequence of binary '0' on the Downlink instead of idle frames.

* In non-transparent (RLP) mode, whether all bits in a block are
  set to binary '0' or '1' has no impact, as both scenarios lead
  to an incorrect FCS.
* In transparent sync mode, any filling be it binary '0' or '1'
  is perceived as incorrect or unexpected.
* In transparent async mode, it is more logical to transmit a
  sequence of binary '1,' which will be interpreted as
  a sequence of stop bits.

Let's align the Downlink with the Uplink for consistency and transmit
idle frames when no data is available for transmission.  The modified
60-bit V.110 frames exclude the alignment pattern, so sending a
sequence of binary '1' is enough to achieve the intended goal.

Change-Id: I0b25cfac41b6d8dcf3bfd9d46d51a9665f1b047a
Related: OS#1572
2023-11-10 02:19:37 +07:00
Vadim Yanitskiy bcb9875176 osmo-bts-trx: tx_tch[fh]_fn(): rework generation of dummy FACCH
Even though it might have a somewhat higher performance impact,
opting for the common code path for FACCH by allocating a msgb
on heap is more favorable for both readability and maintainability.

This choice is preferred over directly calling
gsm0503_tch_fr_encode() and then using a 'goto' statement.
A similar strategy will be adopted in an follow up patch for CSD.

Change-Id: I67cb5c6f4d15149996e17c78a59d66db396da8ff
Related: OS#1572
2023-11-10 02:07:37 +07:00
Vadim Yanitskiy 863d4d933e osmo-bts-trx: tx_tch[fh]_fn(): use BUFPOS macro everywhere
For the sake of consistency.

Change-Id: I16ce4c979c5b44fd67324eb2ed3da28a4b78221b
Related: OS#1572
2023-11-09 19:28:48 +07:00
Andreas Eversberg 791d121bd9 ASCI: Add library requirements for uplink access to TODO-RELEASE
Related: OS#4851
Depends: libosmocore.git Ibd6a1d468a70126a8f67e944fcb916969cc3c36b
Change-Id: Ic7807b69bbecd84b7a30d45b599b688acfd2ddc0
2023-10-27 10:35:21 +00:00
Andreas Eversberg 771e9f2838 ASCI: Control uplink access bursts detection of physical interface
An MPH-INFO message is used to turn detection of uplink access bursts on
or off. Whenever the uplink on a voice group channel is free, the uplink
access burst detection is turned on. When the uplink access is granted
to a talker or when the calling subscriber has been assigned to the
channel, the uplink access burst detection is turned off until the
uplink becomes free again.

Related: OS#4851
Depends: libosmocore.git Ibd6a1d468a70126a8f67e944fcb916969cc3c36b
Change-Id: I92d6773a3a463eb747143c85aa149e54c1fda122
2023-10-27 10:35:21 +00:00
Andreas Eversberg e5d8a469d2 ASCI: Enable voice group/broadcast call feature at osmo-bts-trx
Related: OS#4851
Change-Id: I3a2e3f94812cec0bbf7e3674172437fa359d014c
2023-10-27 10:35:21 +00:00
Andreas Eversberg 8fafc1a74c ASCI: Add control of uplink access to osmo-bts-sysmo
An MPH-INFO message is used to turn detection of uplink access bursts on
or off. This is required for voice group/broadcast channels.

Related: OS#4851
Depends: libosmocore.git Ibd6a1d468a70126a8f67e944fcb916969cc3c36b
Change-Id: I61f232aa91191dae08404c1f08cad91964d74568
2023-10-27 10:35:21 +00:00
Andreas Eversberg d88cc624ed ASCI: Add control of uplink access to osmo-bts-trx
An MPH-INFO message is used to turn detection of uplink access bursts on
or off. This is required for voice group/broadcast channels.

Related: OS#4851
Depends: libosmocore.git Ibd6a1d468a70126a8f67e944fcb916969cc3c36b
Change-Id: I9045437d52984b7abe00fbc815d7f83c62c0fb5a
2023-10-27 10:35:21 +00:00
Pau Espin bd777b0276 trx_if: Allow calling trx_if_flush/close from within TRXC callback (v2)
- If the llist is flushed during rx rsp callback, when the flow is
  returned to trx_ctrl_read_cb() it would access tcm which was in the
llist and end up in use-after-free.
- We need to store state on whether code path is inside the read_cb in
  order to:
-- Delay transmission of new message if callback calls trx_if_flush()
   followed by trx_ctrl_send(), since the trx_ctrl_send() at the end of
   trx_ctrl_read_cb would retransmit it again immediatelly.
-- Avoid accessing tcm pointer if the callback called trx_if_flush(),
   since it has been freed.

Related: OS#6020
Change-Id: Ibdffa4644aa3a7d219452644d3e74b411734f1df
2023-10-25 16:00:59 +00:00
Pau Espin 3bd97d839e Revert "trx_if: Allow calling trx_if_flush/close from within TRXC callback"
This reverts commit 4444262a6a.
This commit introduced several side effects:
- tcm is left out of the l1h->trx_ctrl_list and hence won't be ever
  retransmitted.
- Since tcm is removed before rsp callback, the llist may become empty
  and if somehwere in the rsp callback a new message is enqueud it will
  be sent immediatelly, and will be retransmitted again when
trx_ctrl_read_cb() calls trx_ctrl_send() at the end.

Change-Id: Ideb2d08ac8a2902bceeabfb055c59c9a13dbe3c0
Related: OS#6020
2023-10-25 16:00:59 +00:00
Philipp Maier 6ed4a9a1eb pcuif_proto: clean up last remains of old PCUIF v10
There are still some remains that are related to the old PCUIF v10
protocol version. Let's clean those up.

Related: OS#5927
Depends: osmo-pcu.git I68a3f59d5c960ae3a4fbd74f9d4a894295cb9ed8
Change-Id: I04f7108c94c99c9920192177087748e8b89b3106
2023-10-16 11:54:14 +02:00
Andreas Eversberg d265ce68b2 Increase RR scheduler priority to 20, to avoid dropped bursts
If frames are not deliverd fast enough to the DSP, bursts will get
dropped. The osmo-bts-sysmo process must have priority over other
processes, so it can deliver frames fast enough.

Related: OS#6199
Change-Id: I2394e6bbc00a1d47987dbe7b70f4b5cbedf69b10
2023-10-09 08:04:56 +00:00
Pau Espin 586e897eea Drop use of deprectated vty callback is_config_node
While compiling:
vty.c:169:3: warning: 'is_config_node' is deprecated: Implicit parent
node tracking has replaced the use of this callback. This callback is
no longer called, ever, and can be left NULL. [-Wdeprecated-declarations]
        .is_config_node = bts_vty_is_config_node,
         ^

Change-Id: I54c5aa5911611b181f80e76556b150f25dd5b60c
2023-10-05 09:39:31 +00:00
Philipp Maier 955b7dc637 pcuif_proto: rename PCU_IF_FLAG_SYSMO to PCU_IF_FLAG_DIRECT_PHY
The PCUIF flag PCU_IF_FLAG_SYSMO was originally used by osmo-bts-sysmo
to signal to the PCU that the direct PHY access for the sysmo-bts DSP
should be enabled. With time, support for other BTS models was added and
the flag became a synonym for "direct PHY access", so it makes sense to
rename it to "PCU_IF_FLAG_DIRECT_PHY"

Related: OS#6191
Depends: osmo-pcu.git I29b7b78a3a91d062b9ea3cd72623d30618cd3f0b
Change-Id: Ib556a93f7d7d7dbe1e96c4a0802bc802241b2b2d
2023-10-04 14:46:53 +00:00
Vadim Yanitskiy 695080745c meas: lchan_meas_sub_num_expected(): handle CSD modes
Change-Id: Iba5314dc89d65ab4a3706b6ef11994b6fa95162c
Related: OS#6168
2023-10-04 09:18:11 +00:00
Vadim Yanitskiy fe005cb76e meas: ts45008_83_is_sub(): properly handle CSD modes
Change-Id: Ic3b1e27be2dece3605657fd91d7addebb1e554e8
Related: OS#6168
2023-10-04 09:18:11 +00:00
Vadim Yanitskiy b960c7558a meas: fix ts45008_83_is_sub(): DTX is permitted on TCH/F sign
DTX is not allowed for TCH/H in signalling mode, but *is* allowed
for TCH/F in signalling mode.

Change-Id: I91cfd8f561eb47a5fc48c0682d56331a1d69aded
Related: OS#6168
2023-10-04 09:18:11 +00:00
Vadim Yanitskiy b8a185cc12 meas: handle VAMOS specific chan modes
Treat the VAMOS channel modes same as their non-VAMOS counterparts.

Change-Id: I8ecaf87c7cda4c10dd411e7539382274715bce57
Related: OS#6168
2023-10-04 09:18:11 +00:00
Vadim Yanitskiy 08f058789f meas: lchan_meas_check_compute(): fix -SUB frame substitution
The current implementation does substitute all missing meas samples
with dummy -SUB measurements and then complain about exceeding
amount of -SUB samples.

Change-Id: Iab84f4b64b645486e2f115b0f82ee2f27eb992bc
Related: OS#6168
2023-10-04 09:18:11 +00:00
Vadim Yanitskiy 8bff3b6898 meas: lchan_meas_sub_num_expected(): proper cmode enforcement
3GPP TS 45.008, section 8.3 defines TDMA Fn subsets, which shall
always be transmitted when DTX is employed, only for:

* TCH/F in signalling mode (but not for TCH/H),
* TCH/H and TCH/F in data mode (CSD) [*],
* TCH/FS, TCH/EFS, and TCH/HS.

For channel modes employing AMR codec, in particular:

* TCH/AFS, TCH/WFS, O-TCH/WFS,
* TCH/AHS, O-TCH/AHS, O-TCH/WHS,

there exist no fixed TDMA Fn subsets, but DTX is still permitted.
For those we expect at least one SACCH frame, plus a variable
number of speech frames (0 or more).

[*] Handling of data modes is fixed in a follow-up patch.

Change-Id: Ied477528d77871dd7e3b5b7b433a4e33bca40011
Related: OS#6168
2023-10-04 09:18:11 +00:00
Vadim Yanitskiy aaa1f26e52 meas: also match stderr logging for meas_test
Change-Id: Id1ce154a65b194ce5fd9257c9c1b26d62aad1e0d
Related: OS#6168
2023-10-04 09:18:11 +00:00
Vadim Yanitskiy 40ba43a2e8 osmo-bts-trx: rx_tchh_fn(): fix copy-pasted comment
Change-Id: Idba18c217187f7aacc2fcb0c330814f3802a9306
2023-10-03 13:36:40 +00:00
Pau Espin c6211a8bec cosmetic: oc2g_mgr: fix trailing whitespace
Change-Id: I918cbe32d1be692a1747c9721f680ed8a336bf6f
2023-10-03 14:19:53 +02:00
Vadim Yanitskiy aa06f97326 l1sap: l1sap_tch_ind(): fix segfault on stale TCH.ind
It was reported that osmo-bts-sysmo is crashing due to a TCH.ind
primitive being received by l1sap_tch_ind() for an lchan, which
is operating neither in speech nor data, but in signalling mode.

It's not clear which scenario is causing this situation.  My best
guess is that one or more TCH.ind primitive(s) remain waiting in
the lower layers and bob up right after the channel mode change.

This can happen, for instance, when a dynamic timeslot gets
switched from TCH/F or TCH/H to PDCH or SDCCH/8.

Change-Id: I2d270ab654fdd9d19d1708ff6c4b4e902bd5d0a3
Fixes: d1f8f3429 "l1sap: proper rate adaptation for CSD"
Closes: OS#6180
2023-09-28 14:43:22 +00:00