Write TAI (if available) when generating Rest Octets for UL
Assignment. This should not affect actual PCU behavior because TAI is
not yet supported by upper layers but we have to adjust corresponding
tests anyway.
That's updated version of reverted commit.
Change-Id: I69407793bdb863be5fc42adadf75842d22f27335
Related: OS#3014
Use bitvec_set_*() directly without external write pointer tracking to
simplify the code. This is part of IA Rest Octets (3GPP TS 44.018
§10.5.2.16) which is the last part of the message so it should not
interfere with the rest of encoding functions.
The difference in the expected test output is due to proper handling of
TAI which should not be transmitted for SBA according to the Note in
Table 10.5.2.16.1 in 3GPP TS 44.018.
The change was manually tested against real mobile phone using options
'gprs mode gprs' in osmo-bsc.cfg and 'two-phase-access' in osmo-pcu.cfg
to make sure appropriate code path is actually triggered.
That's partially based on reverted commit 93d947f5e8.
Change-Id: I97d53c27c1ca9e032d431b3aa7f915027d63ddc0
Related: OS#3014
Previously result of ".to_num() - 1" was used without any checks which
means that in case of to_num() returning zero we would effectively try
to encode (uint8_t)(-1).
Let's fix this by using proper mcs_chan_code() function which returns
Channel Coding Command for MCS without the need to further correct it
and adjust expected tests output accordingly.
Change-Id: I868062a81fffe6714a811c032215f25a79259905
Add function to encode MCS value as proper EDGE or GPRS Channel Coding
value according to 3GPP TS 44.060 and corresponding helpers.
Use it for everything except IA Rest Octet encoding which is done in a
follow-up patches to make sure that we distinguish between
encoding-related changes to test output and unrelated changes.
Change-Id: I127fb29f5aaf77a7f6c4c565dfeb3b711af9845d
In preparation for Channel Coding Command encoder in follow-up patches
let's add necessary helpers. Those are similar to previously used
helpers from GprsCodingScheme class but without CamelCase and with less
typo chances between Gprs and Egprs cases.
Change-Id: I6699cbc8d7ae766fa4d2b3d37e5f9ff1cf158b7e
Move Mode (EDGE/GPRS) definition and related functions outside of
GprsCodingScheme class. This allows us to use standard libosmocore
value_string functions.
Change-Id: I3baaac7f1ca3f5b88917a23c1679d63847455f47
Move functions which compute number of blocks or bits depending on
header type and corresponding enum outside of GprsCodingScheme
class. This will allows us to use standard libosmocore value_sting
functions in upcoming patches for IA Rest Octet encoding/decoding.
Change-Id: Id0873f85e1f16a72e17e7fbc4ad76b194917067f
It's confusing to have test-specific helper with the same name as tested
function directly inside the GprsMsStorage class. Let's convert it into
static function and move to the unit test.
Change-Id: Ia2a5b90779051af894fe15d957c1d26f0a142f33
This ensures that the rpath of the generated binaries is set to use only
the just-compiled so-files and not any system-wide installed libraries
while avoiding the ugly shell script wrapper.
Change-Id: I2915f0de87598f9f23efc2b9a8f4a6bdf4966efb
This works around the issue with colliding rate counter group index
highlighted by 86e35e4887 by using
different NSEI/BVCI/NSVCI parameters for different TBF tests.
Change-Id: Id7d2d1a48308a6b1fb17768aee0e79adbdee56ee
Related: OS#3827
Move generic MCS enum to C header file to simplify further modifications
to GprsCodingScheme class in follow-up patches. This also allows us
to use standard libosmocore value_sting functions in upcoming patches
for IA Rest Octet encoding/decoding.
Related: OS#3014
Change-Id: I993b49d9a82b8c7ad677d52d11003794aeabe117
Previously some of the errors in update_cs_ul() call were silently
ignored. Let's log all those as errors with appropriate message.
Note: test output needs updating because we do not (yet) set proper meas
struct in TBF tests. That's likely wrong but it's better to update tests
in a separate commit.
Change-Id: I4084fb281dd9dad04a2a3a68cac2a8f7b462548e
This exposes the bug in BSSGP rate counter group allocation in the
current tests version which should be fixed in a separate commit.
Change-Id: I6317eccfb1408c5c9d07110a8b059f5ceb5d2afc
The headerTypeControl() function always return constant and is only used
inside OSMO_ASSERT() which compares it to the very same constant which
makes it no-op. Let's remove this clutter.
Change-Id: Ie0f81fe05a2b3f432de7d1f3446e8115d7524ff4
The TBF tests are failing on some machines due to unexpected
log output: "DL packet loss of IMSI= / TLLI=0xffeeddcc: 0%"
These messages are printed if >= 1 second has passed between
loss reports. This timing is machine-dependent so the test
is unstable as a result. Only print these messages at log
level debug to (hopefully) make TBF tests pass consistently.
Update expected test output accordingly.
Change-Id: Ie43f0e3a8740f0fc132809a09a153886c51fadf9
Currently, the TBF timer log messages lack the frame number in
the logoutput
- Add frame number to TBF timer related log-statements
Change-Id: I5a744dc5cd7c1de1baea13fffac026c83d091429
Related: SYS#4139
Patch-by: Octasic inc.
There is a duality of initialization: early_init() in bts.cpp wants to init
logging even before static instances get initialized. Make sure that
tall_pcu_ctx is initialized during early_init() as well. There is a build
context that does not seem to include bts.cpp (osmo-pcu-remote), so to be sure,
init tall_pcu_ctx as NULL and both in early_init() as well as pcu_main.cpp,
init both tall_pcu_ctx and logging if it is still NULL.
Change-Id: I2199b62d0270bd35dec2283e8f5b364b7c63915b
Receive the mnc_3_digits flag from the PCU interface.
Bump the PCU interface to 9.
This is one part of the three identical pcuif_proto.h patches:
- I49cd762c3c9d7ee6a82451bdf3ffa2a060767947 (osmo-bts)
- I787fed84a7b613158a5618dd5cffafe4e4927234 (osmo-pcu)
- I78f30aef7aa224b2e9db54c3a844d8f520b3aee0 (osmo-bsc)
Add 3-digit flags and use the new RAI and LAI API from libosmocore throughout
the code base to be able to handle an MNC < 100 that has three digits (leading
zeros).
Depends: Id2240f7f518494c9df6c8bda52c0d5092f90f221 (libosmocore),
Ib7176b1d65a03b76f41f94bc9d3293a8a07d24c6 (libosmocore)
Change-Id: I787fed84a7b613158a5618dd5cffafe4e4927234
Move timeslot applicability check outside of nested for loop into
separate functions and document them. Add corresponding tests.
This allows us to clarify types used in TS-related computations.
Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2
Related: OS#2282
Move computation of RX mask into separate function and document it. This
allows to significantly shrink find_multi_slot() function and overall
improve code readability.
Since the test output requires cosmetic adjustment anyway due to change
in the sequence of log messages, use this opportunity to better group
and format log message.
Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392
Related: OS#2282
Many files include unnecessary headers and don't include headers which
are actually used. Because of that combined with the fact that OsmoPCU
is a mixture of C and C++, it makes it hard to modularize code. Fix
this (using iwyu [1] tool):
* add missing headers
* remove unused headers
[1] https://include-what-you-use.org/
Related: OS#1539
Change-Id: I8c9f488a43b099c72b2d30d3245e7ba50872fc00
* move common code into functions
* print error instead of failing test right away
This allows the tests to continue till completion even in case of
intermediate error which simplifies troubleshooting by allowing to
gather more errors in a single test run.
Change-Id: I1c4ad1dc94542835f15bd666f0821e0ccfcc78c1
Related: OS#1759
* add function to set/unset given assignment type
* log assignment type flag changes
* update tests output with additional logs
This enables us to carefully track the TBF assignment type transitions.
Change-Id: I3fe9d52472be8b7f257e8326b2f84e8e7d7bd1f4
Related: OS#1759
If TS allocation fails due to unavailable TFI, print TRX which was
suggested to allocator. This simplifies allocator debugging but requires
cosmetic modifications to test output.
Change-Id: Icaf97d71d71985d52dc0bda448c26b19fe5645e7
Related: OS#2282
* define and use constant for occupied TFI instead copying the same
magic number all over the place
* use libosmocore's define for bit pretty-printer
Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293
Related: OS#2282
* drop unused parameters (from both functions and structs)
* document used parameters and return values
* tighten types used for parameters
* use consistent formatting
Tests are adjusted accordingly but test results are left untouched to
avoid regressions.
Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755
Related: OS#2282
The table B.1 is copy-pasted from 3GPP TS 45.002 and reformatted via
Emacs macros into C struct to avoid typos. The test output expanded
accordingly.
The allocation test expectations and output are adjusted accordingly.
Note: classes 35-45 which need TA offset are not properly supported
yet. This can be extended once we have such devices available for tests.
Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c
Related: OS#2282
So far the allocation was only tested up to hardcoded MS class 29. Drop
that assumption and test for all supported MS classes. Adjust expected
test output as necessary.
Note: using mslot_class_max() forces allocation for MS classes 30 and 31
for which no actual data is available (will be added in follow-up
patches) which current implementation treats differently depending on
TX/RX direction - see gprs_alloc_max_dl_slots_per_ms(). Because of that
we have to adjust the expected number of allocations in
test_successive_allocation() as well.
Change-Id: I7737f303d97197ef159b14a19c3312a11f07b433
Related: OS#2282
* print MS classes
* unify and print test mode description
* print additional info on test completion
This only changes meta info about test run but not the actual test
output.
Change-Id: I30a4b8f561a9677f4e9ded33a051a249bd15a6a2
Related: OS#2282
This function contains 3 independent test cases. Let's split them into
separate functions to simplify further modifications:
* split test cases into separate functions
* use them for mass test as well
* change function names to avoid confusion
* make individual test cases return error instead of failing via assert
on allocation failure
The top-level test_alloc_b() is used as part of exhaustion tests in
test_all_alloc_b() for example, so it's expected that allocation might
fail (due to TFI or USF exhaustion for example) eventually. In this case
it's better to indicate it to caller instead of failing entire program.
The test output does not require any adjustements because we do not
exhaust to the point of allocation failure yet.
Change-Id: Id7e03a85ce96e7d617cecee963759bae589a3a1a
Related: OS#2282
* add functions/macros for setting TBF's UL ack state
* add functions for checking TBF's UL ack state
N. B: this should not be confused with TBF-UL state.
Change-Id: I144483447d4b0b93e775da0e926ee45eb8ab39f3
Related: OS#1539
* add functions/macros for setting TBF's UL/DL state
* add functions for checking TBF's UL/DL state
* move pre-free check into separate function
N. B: this should not be confused with TBF-UL or TBF-DL state.
Change-Id: Idcbf5775d17b1247f2ed01788f9b0788ce66e871
Related: OS#1539
Previously all TBF-related events were logged as part of DRLCMAC which
is too broad to make it practically useful due to excessive amount of
log messages generated. Introduce dedicated log categories for
TBF-related events. Adjust test output as necessary.
Change-Id: I64d660e5971263d5c63d2ba95d50625c16a594aa
We use the same approach for osmo_fsm: when state transition happens,
it's not very useful to always log the transition function itself, it's
much more useful to see where the actual transition comes from.
Change-Id: I348ba89bdda2b44c7019e9c893c764ee08c80bec
Related: OS#1759
Write TAI (if available) when generating Rest Octets for UL
Assignment. This should not affect actual PCU behavior because TAI is
not yet supported by upper layers but we have to adjust corresponding
tests anyway.
Change-Id: I8b17be78a46c0bc17516b7c90f35aa4768010ae4
Use bitvec_set_*() directly without external write pointer tracking to
simplify the code. This is part of IA Rest Octets (3GPP TS 44.018
§10.5.2.16) which is the last part of the message so it should not
interfere with the rest of encoding functions.
The tests are adjusted accordingly.
Change-Id: I44db2eeea7448ff67e688ae716487bc6dbfc96a3
Related: OS#1526
Use bitvec_set_*() directly without external write pointer tracking to
simplify the code. This is part of IA Rest Octets (3GPP TS 44.018
§10.5.2.16) which is the last part of the message so it should not
interfere with the rest of encoding functions.
The tests are adjusted accordingly.
Change-Id: I52ec9b07413daabba8cd5f1fba5c7b3af6a33389
Related: OS#1526