This commit changes lots of stuff in the MS release lifecycle, but
there's no really good way to split this into patches which make sense,
since all the chaos is intensively entangled.
Get rid of the ms_callback complex mess, it is not needed at all.
Previous MS release was strange due to the existance of previous
ms_callback.idle concept and MS storage: the MS signalled when it went
idle (no TBFs attached) and waited for somebody outside to free it,
while then arming itself the release timer to release itself if it was
not released by whoever.
The new lifecycle follows an easier (expected) approach: Whenever all
TBFs become detached from the MS and it becomes idle (use_count becomes
0), then it frees its reserved resources (TFI, etc.) and either:
* frees itself immediatelly under certain conditions (release timeout
configured = 0 or MS garbage with TLLI=GSM_RESERVED_TMSI)
* Arms release_timer and frees itself when it triggers.
If during release_timer the MS is required again (for instance because a
new TBF with TLLI/IMSI of the MS is observed), then a TBF is attached to
the MS and it is considered to become active again, hence the release_timer
is stopped.
OS#6002
Change-Id: Ibe5115bc15bb4d76026918adc1be79469c2f4839
It is interesting to log that a tbf is being detached *before* it
actually happens, so that the reader can see which TBF is being
detached.
Change-Id: I2008beb9ab8f97f7ea5ed7b45cfb3f23dfe7b27f
* Make sure that the tbf being attached has already the MS assigned.
* Check no re-attaching of alredy attached TBF ever happens.
* Document and early skip case where a non-attached TBF detach is
attempted.
* Avoid recursive call mess to tbf_set_ms(tbf, NULL); during detach.
* MsTest needs to be modified since it uses fake TBF objects which use
different set of calls than the regular TBFs in osmo-pcu. Since the
ul_tbf object is reused, it needs to be assigned ul_tbf->ms again before
re-assigning it, as per what happens usually in tbf_set_ms() in
osmo-pcu.
Change-Id: Ia18fe2de1fb3bf72f530157e5f30de64f2b11e12
It makes no sense to pass "NULL" to attach function. There's a detach
function to be used if a given TBF has to be detached.
Change-Id: I0c5df195c080b21e5516aebfb46db22bdc55f2a2
gprs_default_cb_ms_idle() is changed to have the same implementation as
previous bts_ms_idle_cb(), since that's the only one being used in
osmo-pcu code. It makes no sense to use different callback logic in unit
tests.
This is another step towards simplifying the code and getting rid of the
idle/active_cb().
Change-Id: I2a06d17588572a21dc5a14ddbde83766076b446d
With this change the MS no longer is removed from the llist without
potentially skipping free() if not idle in bts_ms_idle_cb().
As a result, some unit tests now can free it during bts tear down
instead of having them leaked.
The tests int MsTest need changes because the tbfs created are fake and
cannot be freed using tbf_free(), and hence cannot be detached from MS
using regular code paths. Instead first call explicit talloc_free(ms)
like other unit tests in the file already do.
Change-Id: Id53f8dfb9963366dd4b19a324615bbc83c4f23e7
That class is mostly a C++ class holding a llist plus some callbacks.
Having that in a separate class makes code more complex for no good
reason. This patch moves the llist into bts and allocates stuff directly
from within bts.
This will allow further cleanup of MS lieficyle in future patches.
Change-Id: I627f5db5073189c23ddf2b7f09c90abb24846f62
That information is not required during allocation of the object, and
most times it is not known.
Defer setting it only to meaningul values in paths obtaining the
information from peers.
Change-Id: I36f07dc389f7abe205fc4bcddbde93735f5d5cfc
Inside osmo-pcu code, the code path is to always call ms_alloc with
tlli=GSM_RESERVED_TMSI; a different value is only passed during unit
tests.
It makes no sense to have unit tests using differnet code paths than
ther app itself, since in the app it always desired to go through the
ms_set_tlli() and ms_confirm_tlli() which does more stuff.
Hence, drop the tlli param in ms_alloc and change the unit tests to use
the available APIs used by the application.
Change-Id: I730ec911a43b0f4e78faee4eeffb3ca8601564f8
This check (tlli != 0) was added in 2015 in
6d86628e5b, with the rationale below:
"""
To avoid dangling entries without a TLLI there (which cannnot be
retrieved anyway), the timer in the MS objects is not started after
all TBF have been detached, so that they get deleted immediately in
that case.
"""
The rationale makes sense, but through time the MS class was fixed to
return GSM_RESERVED_TMSI (0xFFFFFFFF) when no TMSI was available.
Hence, the check was wrong, and as a result, free() of MS containing
GSM_RESERVED_TMSI would be delayed over time by release timer.
Related: OS#6002
Change-Id: I7a694a30f8709c00af774846d7c4925cef253a71
Currently we do log an error, but then still call pcu_rx_container(),
passing it a malformed message. The function does have an additional
length check inside, but let's better discard it early.
Change-Id: I8410ecf35442ab75741a5c9cd29d640ce5508e57
Related: OS#5963
When debugging frame number offset problems betwen l1 and below and the
upper layers of the PCU, it may be helpful do know which blocks/frame
numbers got reserverd for uplink transmissions.
Change-Id: I4277c572a4cc6cbbf3ac4e67442c9036be687627
Related: OS#5198
As of now the manual only focusses on the BTS co-located scenario. Since
we recently introduced support for Ericsson RBS 2000/6000 base stations,
we also had to add support for the BSC co-located scenario. Let's update
the manual accordingly.
Related: OS#5198
Change-Id: Ib2a3b60849fd312b21073a3511b8ca36b4536343
The manual so far describes how OsmoPCU is run in co-location with the
BTS but Figure 1 shows the PCU next to the BSC. Lets put BTS and PCU on
the same rank so that they appear next to each other. This reflects the
reality better.
Change-Id: Ifa170f3956b4629765a88ed62e877a204541d9ea
EXTRA_DIST should only list files that are not source, but should be
distributed anyway. Listing the source files in _HEADERS and _SOURCES
should be sufficient
Change-Id: If8b9b8cfaad22a093a74c418651bc76f48f2d071
Fix linker errors with ld from binutils 2.35.2 in Debian 11:
/usr/bin/ld: osmo-bts-litecell15/lc15_l1_hw.o:(.rodata+0x100): multiple definition of `lc15bts_l1prim_names'; osmo-bts-litecell15/lc15_l1_if.o:(.rodata+0x80): first defined here
/usr/bin/ld: osmo-bts-litecell15/lc15_l1_hw.o:(.rodata+0x2a0): multiple definition of `lc15bts_sysprim_names'; osmo-bts-litecell15/lc15_l1_if.o:(.rodata+0x220): first defined here
/usr/bin/ld: osmo-bts-litecell15/lc15_l1_hw.o:(.rodata+0x420): multiple definition of `lc15bts_l1sapi_names'; osmo-bts-litecell15/lc15_l1_if.o:(.rodata+0x3a0): first defined here
/usr/bin/ld: osmo-bts-litecell15/lc15_l1_hw.o:(.rodata+0x5a0): multiple definition of `lc15bts_l1status_names'; osmo-bts-litecell15/lc15_l1_if.o:(.rodata+0x520): first defined here
/usr/bin/ld: osmo-bts-litecell15/lc15_l1_hw.o:(.rodata+0x760): multiple definition of `lc15bts_tracef_names'; osmo-bts-litecell15/lc15_l1_if.o:(.rodata+0x6e0): first defined here
/usr/bin/ld: osmo-bts-litecell15/lc15_l1_hw.o:(.rodata+0x940): multiple definition of `lc15bts_tracef_docs'; osmo-bts-litecell15/lc15_l1_if.o:(.rodata+0x8c0): first defined here
/usr/bin/ld: osmo-bts-litecell15/lc15_l1_hw.o:(.rodata+0xb20): multiple definition of `lc15bts_tch_pl_names'; osmo-bts-litecell15/lc15_l1_if.o:(.rodata+0xaa0): first defined here
/usr/bin/ld: osmo-bts-litecell15/lc15_l1_hw.o:(.rodata+0xc20): multiple definition of `lc15bts_clksrc_names'; osmo-bts-litecell15/lc15_l1_if.o:(.rodata+0xba0): first defined here
/usr/bin/ld: osmo-bts-litecell15/lc15_l1_hw.o:(.rodata+0xcc0): multiple definition of `lc15bts_dir_names'; osmo-bts-litecell15/lc15_l1_if.o:(.rodata+0xc40): first defined here
/usr/bin/ld: osmo-bts-litecell15/lc15_l1_hw.o:(.rodata+0xd20): multiple definition of `pdch_msu_size'; osmo-bts-litecell15/lc15_l1_if.o:(.rodata+0xca0): first defined here
/usr/bin/ld: osmo-bts-litecell15/lc15bts.o:(.data.rel.ro.local+0x0): multiple definition of `lc15bts_l1prim_names'; osmo-bts-litecell15/lc15_l1_if.o:(.rodata+0x80): first defined here
/usr/bin/ld: osmo-bts-litecell15/lc15bts.o:(.data.rel.ro.local+0x1a0): multiple definition of `lc15bts_sysprim_names'; osmo-bts-litecell15/lc15_l1_if.o:(.rodata+0x220): first defined here
/usr/bin/ld: osmo-bts-litecell15/lc15bts.o:(.data.rel.ro.local+0x320): multiple definition of `lc15bts_l1sapi_names'; osmo-bts-litecell15/lc15_l1_if.o:(.rodata+0x3a0): first defined here
/usr/bin/ld: osmo-bts-litecell15/lc15bts.o:(.data.rel.ro.local+0x4a0): multiple definition of `lc15bts_l1status_names'; osmo-bts-litecell15/lc15_l1_if.o:(.rodata+0x520): first defined here
/usr/bin/ld: osmo-bts-litecell15/lc15bts.o:(.data.rel.ro.local+0x660): multiple definition of `lc15bts_tracef_names'; osmo-bts-litecell15/lc15_l1_if.o:(.rodata+0x6e0): first defined here
/usr/bin/ld: osmo-bts-litecell15/lc15bts.o:(.data.rel.ro.local+0x840): multiple definition of `lc15bts_tracef_docs'; osmo-bts-litecell15/lc15_l1_if.o:(.rodata+0x8c0): first defined here
/usr/bin/ld: osmo-bts-litecell15/lc15bts.o:(.data.rel.ro.local+0xa20): multiple definition of `lc15bts_tch_pl_names'; osmo-bts-litecell15/lc15_l1_if.o:(.rodata+0xaa0): first defined here
/usr/bin/ld: osmo-bts-litecell15/lc15bts.o:(.rodata+0x820): multiple definition of `lc15bts_clksrc_names'; osmo-bts-litecell15/lc15_l1_if.o:(.rodata+0xba0): first defined here
/usr/bin/ld: osmo-bts-litecell15/lc15bts.o:(.data.rel.ro.local+0xb20): multiple definition of `lc15bts_dir_names'; osmo-bts-litecell15/lc15_l1_if.o:(.rodata+0xc40): first defined here
/usr/bin/ld: osmo-bts-litecell15/lc15bts.o:(.rodata+0x8e0): multiple definition of `pdch_msu_size'; osmo-bts-litecell15/lc15_l1_if.o:(.rodata+0xca0): first defined here
Change-Id: I33c061e79536a6e9ea7289a245af996e8d17c6ce
The parameter imsi of pcu_l1if_tx_pch_dt() could be NULL. In those cases
we should ensure that struct gsm_pcu_if_pch_dt is populated with a zero
length string.
Related: OS#5198
Change-Id: I9192d50dd78be0a72ffdb9bfb9ed66aef085bcf1
The PCU uses a 16 bit integer value as paging group which does in fact
not really resamble the paging group. Instead it encodes the last three
digits of the IMSI from which the paging group can be calculated. The
value is then eventually converted back to Ascii-digits and then sent
over the PCU-IF interface. Lets get rid of this weird conversion and
use the IMSI directly.
Change-Id: I40d7fc14c9591b3de091e425faaf325421c70a0e
Ericsson RBS series BTSs do not have a built in PCU. Rather than having
the PCU on board the PCU is co-located to the BSC in those cases. Just
like the MGW the PCU would connect to the CCU (Channel Coding Unit) via
E1 line. The PCU is connected via an unix domain socket (pcu_sock) to
the BSC to receive RACH requests and to control Paging and TBF assignment.
This patch adds all the required functionality to run an Ercisson RBS in
GPRS/EGPRS mode. It supports 16k I.460 E1 subslots and full 64k E1
timeslots (recommended)
Change-Id: I5c0a76667339ca984a12cbd2052f5d9e5b0f9c4d
Related: OS#5198
The previous gprs/protocol/gsm_04_60.h header from libosmogsm was
misleading because it was placed in the subdirectory used by libosmogb,
and hence was recently deprecated in favour of gsm/protocol/gsm_04_60.h.
Let's follow the pragma message advising to move to the new header file.
Depends: libosmocore 0158b05337a825352d9fd7f074170b686e9fd1e5
Change-Id: I027abbf3ed4c71331000565af1ef4f08f10cfafc
In situations where the PCU is co-located to the BSC, the IMMEDIATE ASSIGNMENT
for downlink TBFs must be sent via RSL and the BSC also must instruct the BTS
to transmit the IMMEDIATE ASSIGNMENT via PCH instead of AGCH. Eventually the
BSC must sent a confirmation message (follow-up patch) where the TLLI is used
as an identifer.
This new method will eventually replace the previous method that uses
the MAC block as an identifier. To remain compatible with older versions
of osmo-bsc, we will keep the old method until osmo-bts is migrated as
well.
This patch also requires new features to be added to the PCU socket
interface the version number of the protocol is incremented from 0x0a to
0x0b. Version 0x0a will remain compatible and use the old method, while
version 0x0b will use the new method introduced with this patch.
Change-Id: I2a78651593323e8b9627c39918d949a33497b70f
Related: OS#5198
The PCU already has a list that can hold multiple BTS objects but the
API for the direct PHY access has no way to associate a PHY with a
certain BTS object. Lets update the API so that we can associate a BTS
object when opening a PDCH.
Unfortunately OsmoPCU has never been tested with more than one BTS so it
is very likely that there are still shortcomings that prevent OsmoPCU to
work properly when more then one BTS is attached. To make users aware of
this, also print a warning as soon as more than one BTS object exists.
Related: OS#5198
Related: OS#5930
Change-Id: I33518cbbe83f7f8c071afa5e995d30930099ba92
The PHY implementations we currently have do not require any
initialization that has to run directly on startup. This will change
when we introduce support for the E1 based Ericsson RBS CCU. Then we
will have to perform at least one elarly initialization (VTY config
file). So lets add an API function for PHY initialization now.
Related: OS#5198
Change-Id: Ibf2a3a058c826f6ee5b740eee72d5be94d460517
There is a function l1if_connect_pdch, but no complementary function
like we have it with l1if_open_pdch and l1if_close_pdch. The reason for
this is that the PHY implementations that rely on a femtocell DSP do not
need to disconnect the pdch explcitly. However, the planned support for
the E1 based Ercisson RBS CCU will require an explicit disconnect. So
lets add a function call for this.
Change-Id: Ied88f3289bda87c48f5f9255c4591470633cc805
Related: OS#5198
Lets include the header file that contains the definition of struct
gsmtap_inst since this struct is directly used with l1if_open_pdch.
Change-Id: I9b859c4f7906f31547549d4ff7751fb720519270
Related: OS#5198
The log messages and code comments sometimes refer to the direct PHY
access feature as "direct DSP access". Lets use only the term "direct
PHY access"
Change-Id: I121ad85cd8581c40f390dbaad0d6a028d68b095e
The file gprs/protocol/gsm_04_60.h is deprecated, now it is recommended
to use gsm/protocol/gsm_44_060.h
Change-Id: I870e446ad8f371e13bbdb4034feae1260c874ee5
The file pcu_l1_if_phy.h contains the function prototypes for the
implementations found in xyz_l1_if.c. Lets also include pcu_l1_if_phy.h
in the related .c files.
Change-Id: Id35ba473973108da4e36d5c6f2ca78da1225ae8b
Related: OS#5198
The function signatures l1if_open_pdch() in the code for lc15 and oc2g
differ from what is defined in pcu_l1_if_phy.h. Lets update the
signatures so that they match the prototype.
Related: OS#5198
Change-Id: If1693b1b74c1808596d7da639b860f7b226385c0
The function headers for the direct phy related functions (l1if_...) are
currently directly listed in pcu_l1_if.cpp and osmobts_sock.c. Those
functions are basically the API interface definition between the
platform independed PCU code and the platform dependant direct phy code.
Lets put them into a dedicated header file.
Change-Id: Id54b96a4cd498a9860f3f209498132455e2aa6f8
Related: OS#5198
The IMMEDIATE ASSIGNMENT for downlink TBFs must be confirmed by the
receiving end (BSC/BTS) in order to set the timers in the PCU correctly.
When the PCU is used in a BSC co-located scheme (Ericsson RBS). The TLLI
is used as an identifier to confirm a specific IMMEDIATE ASSIGNMENT.
Change-Id: Icf7ca34500984239ee877ee71fd9c126b5eb3480
Related: OS#5198
The struct gsm_pcu_if_e1_ccu_ind is a bit misplaced. Lets move it next
to the info indication strucht, to have it in the same order is it used
in gsm_pcu_if
Change-Id: I4afafd8e94dc0083974ff2f5b6d6be0f5574d0bf
Related: OS#5198
The current name of PCU_IF_SAPI_AGCH_DT is a bit misleading as it
describes a method to send immediate assignment messages (normally AGCH)
via the PCH. The name in the constant should reflect that correctly
Change-Id: I6dfb8035134bc85a025415bd6c2f9c01987d9268
Related: OS#5198
osmo-bsc may send invalid frame numbers through the pcu-sock interface.
Lets make sure that incoming frame numbers do not exceed the valid
range.
Change-Id: Ib0cf1738be07733c95fc6c459a8a7c4cb2eeef26
Related: OS#5198