"sizeof(*meta_storage) <= sizeof(llc_msg->cb)" assert fails on debian 13
armv7l.
Since struct MetaInfo cannot always fit inside msgb->cb, move the struct
MetaInfo into the headroom of the msgb.
Related: OS#6831
Change-Id: I98d966c257d50d3b2fc326dce85ead5591acf51f
In Debian 13 armv7l, time_t and suseconds_t are "long long int" instead
of "long unsigned int" as seen on x86_64 and aarch64.
Related: OS#6828
Change-Id: I535d997f079dce902bbdd3eff22153201b53353f
CSN.1 parsing code is inherited/co-maintained with wireshark.git code,
and used to have its own coding style, so avoid enforcing osmocom code
style in there.
Change-Id: Ib6e7d2dcc3d8f262092f0100e55cad397aa226f4
Drop use of deprecated vty is_config_node() cb
This callback was drepecated and is not ever called since
libosmocore.git 70ce871532ab21955e0955d7e230eae65438f047 (release 1.3.0).
See also libosmocore.git d31de237582f6fe3315d61bb9a488d4cda92654e.
Change-Id: I999ac55fca21cf942876bc19c19f0eda2754501b
Fixes: 1ec29c7324
This IE is defined in 3GPP TS 44.060 Table 12.5a.2.1. Each presence
bit indicates presence of the next two entries, not one.
This patch does affect the output of csn1_ts_44_060_test, though it
does not fix decoding because it's caused by an unrelated problem.
Early versions of 3GPP TS 44.060 required to use the standard
2b-padding. Later versions added release extensions and say that 0 **
(zero padding) shall be used. This does not take backwards
compatibility into account, and makes it hard to parse RLC/MAC PDUs
originated by old phones. In this case the PDU has 2b2b2b at the end,
but we implement the recent version of 3GPP, so we try to parse padding
and run into problems...
Related: libosmo-gprs.git Iac4de18ef25386f774bb409201b7a7996d1c8824
Change-Id: I061ac16df5e6413266de08884f791f0264791192
This file comes from wireshark (originally from Ericsson) and does
not follow the kernel coding style - ignore it.
Change-Id: I91e05f9742aaac6ec61a1668ce3b63e8da52032d
The PCU sends a TXT_IND with the PCU_VERSION as the first message
after the socket connection is established. The BTS/BSC uses those
messages to trigger some initialization (allocate BTS object inside
the PCU, send SI to the PCU).
Unfortunately the PCU will send the TXT_IND with the PCU_VERSION
always with to BTS 0. The 0 in this case is a hardcoded fake BTS
number (There is no BTS object allocated under this number in the
PCU at this point). However, the BTS/BSC will then do the
initialization process for BTS 0, which works by chance for the
BTS where the BTS number is always 0, in the case of the BSC there
may be multiple BTS configured, so there may be arbitrary BTS
numbers.
Let's fix this design error by agreeing that a TXT_IND that has the
type PCU_VERSION is always addressing the receiving process as a whole
and therefore the BTS number in the indication must be ignored.
Related: OS#6507
Change-Id: Ib3f340ae9450151549ce61d34b28253d499ae04a
X2001 is the timer triggered after 2 seconds when a DL TBF is being
assigned but the assignment never completes.
A DL TBF can be PACCH-assigned using either:
* Another DL TBF (usually the same object when upgrading to multislot)
* A UL TBF.
The active UL/DL TBF doing the assignment of thew new DL TBF is the one
holding the assignment state in its tbf.dl_ass_fsm.
That FSM is checked by the scheduler to figure out whether a Pkt DL Ass
needs to be transmitted.
if the new DL TBF being assigned was freed due to X2001, then the
tbf.dl_ass_fsm of the TBF doing the assignment was not updating, meaning
it was trying to send Pkt DL Ass by the scheduler, but it was erroring
(properly) by a check in create_packet_dl_assign() validating a DL TBF
(the oen being assigned) exists in the MS.
Change-Id: I42cc264b1b77bf8d91ec01a18d8985e182a20024
The original code did E1 raw TS output by posting directly to
&ts->raw.tx_queue instead of calling e1inp_ts_send_raw();
doing so bypasses the call to driver->want_write performed in
e1inp layer. This approach worked for DAHDI where no
select-for-write is used; however, e1inp interface to osmo-e1d
does use select-for-write, hence applications like osmo-mgw
do need to use e1inp_ts_send_raw() API in order to work
correctly.
Change-Id: Ia2e0fa27195fc1ae75e441038eb4adeb4cf1d6cf
When some client connects to the PCU socket, the PCU sends a TXT
indication with its version number in it. There is a retry mechanism
in place that checks if the BTS got active. In case the BTS is not
active yet, the TXT indication with the version number is repeated.
This mechanism is unnecessary. It even can cause annoyance in cas the
BTS on the other end does not send an info indication because it does
not use GPRS/EGPRS at all. The TXT indication is sent after the PCU
socket connection is made. We use a normal unix domain socket, which
can not lose messages. It is guaranteed that the TXT indication
reaches the client (BTS or BSC).
Related: OS#6270
Change-Id: Iddd3eed113ed288e629b6029f9a56de427de8126
I have verified that with AmbientCapabilities=CAP_SYS_NICE, setting
scheduling policy as described in the manual still works as expected.
Related: OS#4107
Change-Id: I362a9e55309033c42b16f12321f8d1aa27da7b59
This fixes TBF objects leaking and ending up alive when the MS object is
explicitly freed through talloc_free (and sporadically
crashing TbfTest once a timeout for them occur).
This mostly affects unit tests, where most of the explicit free()
happens.
In osmo-pcu, in general, the GprsMs object only gets _free() called when
its resource count reaches 0, aka no more TBFs are attached to it. Hence
in general GprsMs object is freed() only when no TBFs (to be leaked) are
present.
However, in the unit tests it's usual that we want to wipe the entire
context by eg. feeing the PCU, the BTS or MS object, which should also
free the related TBFs.
When running osmo-pcu this may only be an issue when the MS object is
freed explicitly, which could happen for instance when a BTS is torn down,
ie. PCUIF going down, moment at which all GprsMs of that BTS are freed.
But in there actually it iterates over PDCHs to free all TBFs, so it's
fine.
If we iterated over MS, this could have ended up in a crash, like
it happened in TbfTest sporadically, but it's not a bit problem if we
crash + restart at that time since anyway the BTS is gone ore just
getting up around that time.
Related: OS#6359
Change-Id: Ibbdec94acb8132be20508d3178d88da44bfaf91d
We should have introduced this documentation snipped years ago, when
first introducing IP-SNS support in libosmogb/osmo-pcu.
Change-Id: I83709b7231c2a3930e1b3f09b737319fb7d7e741
I'm not sure why some files did contain an AGPLv3+ header, instead of
the GPLv2+ which is the actual overall project license. I consider it a
mistake.
In any case, any copyrightable contribution to those files was done by
sysmocom employees, so I as managing directory can legally make a
license change, whther or not it was a mistake early on or not.
The only remaining AGPLv3+ files are those implementing the "direct
PHY" interface for osmo-bts-{symo,lc15,oc2g}. That is als
unintentional, but more complex to resolve as they were copied from
osmo-bts, which is indeed an AGPLv3+ project.
Change-Id: I52533193de0ec7e24bf7c5bb035589ba5b9419e4
Now that 1.4.0 is released, bring back the patch that was temporarily
reverted to avoid the need for a new libosmocore.
This reverts commit 16729ba727.
Change-Id: Idd113e328a693df2e8f2f5d172eaf5bf2bfcf009
In preparation for an 1.4.0 osmo-pcu release that should not require a
new libosmocore, revert this patch.
This reverts commit a155fe85de.
Change-Id: I714efdc9c9403d3ff74e18df1629e2de6876e9d7
The struct member gen_idle_blocks controls whether the the PCU has to
generate dummy blocks to fill idle periods or if this task is left to
the BTS hardware.
Since idle dummy blocks only have to be transmitted on the C0 carrier,
we should rename the gen_idle_blocks struct member to
gen_idle_blocks_C0.
Related: OS#6198
Change-Id: If9511ed911f9c5d6d463881a387a9e7d11a15465
When a PDCH is idle, then the gaps are filled with dummy blocks. OsmoPCU
supports generating the dummy blocks locally, so that a continous stream of
PDCH blocks is sent to L1. However, some BTS models (the OsmoTRX based models
in particular) are able to generate the idle blocks locally. In this case the
PCU should leave the genration of the dummy blocks to the BTS in order to
save processing time and load on the PCUIF interface.
In gprs_rlcmac_sched we already have a flag to skip idle frames in case we do
not use the so called "direct phy access". A similar mechanism also exists in
pcu_l1_if.cpp in function pcu_rx_rts_req_ptcch().
Unfortunately this check is not implemented correctly. The flag gets set when
the ENABLE_DIRECT_PHY define constant is set. However, this does not say
anything about whether the BTS model supports the generation of idle blocks or
not. The define constant is intended to be used to disable direct phy related
code in on platforms where no direct phy code is used or cannot be used. We
must instead check the BTS model (bts->bts_model) in order to decide whether
this particular BTS type requires the generation of dummy blocks or not.
Related: OS#6191
Change-Id: I7a08d8cc670fa14f7206ffffdbc22351f3668a17
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 and store this information in
struct gprs_rlcmac_bts
Related: OS#6191
Change-Id: I48eb75f65ab54fdec41ef913e24c1f18cd4a4047
We now use PCUIF v11 in the TTCN3 tests exclusively and also osmo-bts
and osmo-bsc only support PCUIF v11. There is no longer a need to
maintain a backward compatibility to PCUIF v10 in osmo-pcu.
Related: OS#5927
Change-Id: I68a3f59d5c960ae3a4fbd74f9d4a894295cb9ed8
This has been fixed in osmo-bts too.
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: Ifa2c36bc0975e89d21b6fb2fc49db6077e5207da
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
Change-Id: I29b7b78a3a91d062b9ea3cd72623d30618cd3f0b
Fix OsmoPCU not restarting if e.g. an external gsmtap IP is configured
that is currently not available. Also make the service files more
consistent with other Osmocom projects.
Revert f81e2f76 ("systemd: Do not re-start in case of exit(1) (e.g. a
config issue)").
Related: SYS#6581
Change-Id: I061206a6f61abddfa698a4ce809afcbdf0cbce9c
We cannot see how uninitialized access is possible, but gcc v13.2.1
does complain about it. Let's work this around by assigning an
invalid value, like trx_count_free_tfi() does.
src/bts.cpp: In function 'int bts_tfi_find_free(const gprs_rlcmac_bts*,
gprs_rlcmac_tbf_direction,
uint8_t*, int8_t)':
warning: 'tmp_first_tfi' may be used uninitialized [-Wmaybe-uninitialized]
Change-Id: Ia446cdf573ee25e6da6b4aa917972c63472229bb
Fixes: OS#6190
This function is also needed in osmocom-bb.git, so it becomes
a library function (part of libosmogsm).
Change-Id: I6a8502c2b2015ca7d0452ab9f5da0484a03ce91e
Depends: libosmocore.git I9590f2e836fc48650decf1564b6ab46306c4fe2d
Depends: libosmocore.git Ie8bb9c49c6f81b8f4a1766547d6943f9880d1186