low-level text decodes of CSN.1 messages certainly are not NOTICEable
events, but rather something used for debugging.
Right now we get various text CSN.1 log output of osmo-pcu in it's
default configuration. Despite all log levels being relatively high
(NOTICE), we still see those messages as they simply are logged
at the wrong level.
Related: OS#2577
Change-Id: I7b42c9e21ad8d8a5b54e7a3b68490934ce3d3198
This commit is basically a revert of
f4bb42459c, which disabled the code. That
commit claimed the SGSN may have providen inacurate or wrong data at the
time, but then it should be fixed in the SGSN.
Related: OS#1525, OS#3499
Change-Id: Ie36ae23203110018d4b5ae47591e0a64989e23a0
We should really be using monotonic clock in all places that
gettimeofday is used right now. Since clock_gettime() uses timespec,
let's move all code to use timespecs instead to avoid having to convert
in several places between timespec and timeval.
Actually use osmo_clock_gettime() shim everywhere to be able to control
the time everywhere from unit tests.
Change-Id: Ie265d70f8ffa7dbf7efbef6030505d9fcb5dc338
Both csnStreamDecoder() and csnStreamEncoder() shall not return 0
prematurely if no more bits left in the input / output bit-vector.
Returning CSN_ERROR_NEED_MORE_BITS_TO_UNPACK might make more sense,
however we don't know in advance (i.e. without entering the loop)
whether it's an error or not. Some CSN.1 definitions have names
like 'M_*_OR_NULL', what basically means that they're optional
and can be ignored or omitted.
Most of the case statements do check whether the number of remaining
bits is enough to unpack / pack a value, so let's leave it up to
the current CSN_* handler (pointed by pDescr) if no bits left.
Return CSN_ERROR_NEED_MORE_BITS_TO_UNPACK only if the number of
remaining bits is negative as this is an error in any case.
Change-Id: Ie3a15e210624599e39b1e70c8d34efc10c552f6c
Port from wireshark.git de028e81c53f9c45ccc5adb3bffd2f16ae2017bf
This commit breaks transcoding of the test vectors containing
the MS RA Capability IE due to the reasons explained in [1].
The more fields we add, the longer gets the output of the CSN.1
encoder. This is not critical, since we never need to encode
messages containing the MS RA Capability IE on practice.
[1] Ibb4cbd3f5865415fd547e95fc24ff31df1aed4c0
Ported-by: Pau Espin Pedrol <pespin@sysmocom.de>
Change-Id: Ibb4cbd3f5865415fd547e95fc24ff31df1aed4c0
This change fixes a bug that was reported by Keith Whyte and
confirmed in [1]. The problem is that a user-defined handler
in case of CSN_SERIALIZE may parse only a part of the given
bit-stream, leaving some bits unhandled. This is expected
because the sender (i.e. the MS) may use more recent RLC/MAC
message definitions containing new fields at the end.
Those bits that were left unhandled by serialize() shall not be
interpreted as continuation of the message, they shall be skipped.
Note that the encoded vector in the RLCMAC unit test still does
not match the original one. That's a known bug explained in [2].
[1] If5873355d52d7ddb06c2716154a88d34100f6ab5
[2] Ic46d6e56768f516203d27d8e7a5adb77afdf32b7
Change-Id: Id4cc042fed68fc54aca0355dcb986cab3f6b49ea
Related: OS#4338
Move the call to send_gsmtap() before the call to decode_gsm_rlcmac_uplink() as if
the latter returns error we return and never get to see the packet on the GSMTAP.
Change-Id: Ia6af9f40590f28fcae3fef50d9c601d8435412cd
The main idea of this change is to demonstrate a weakness of the
CSN.1 codec that most likely causes a unit test breakage in [1].
The problem seems to be that the transitional structures, where
the CSN.1 decoder stores the results, do not contain any details
about presence of the optional fields (such as M_UINT_OR_NULL).
In other words, it's impossible to know whether some optional
field is omitted in the encoded message (NULL), or is it just
set to 0. This means that the encoder will always include all
optional fields, even if they're not present in the original
message.
[1] Ibb4cbd3f5865415fd547e95fc24ff31df1aed4c0
Change-Id: Ic46d6e56768f516203d27d8e7a5adb77afdf32b7
As seen in OS#4420, setting the MetaInfo.recv_time outside of
llc_queue before calling llc_queue::enqueue() and later on using that
value in llc_queue itself at dequeue time is not a good idea, since it
can provoke errors if the recv_time was not set correctly.
For instance, LlcTest was not setting the value for recv_time on some
test, which ended up with a huge millisec value when substracting now()
from it:
"""
llc.cpp:215:29: runtime error: signed integer overflow: 1582738663 * 1000 cannot be represented in type 'long int'
"""
This issue only appeared when started building on a raspberrypi4.
Let's better set/store the MetaInfo.recv_time internally during
llc_queue::enqueue(). Then, enqueue() only needs the
MetaInfo.expire_time, so let's change its arg list to only receive that
to avoid confusions.
Take the chance to move the llc_queue APIs to use osmo_gettimeofday,
since we need to fake the time now that the API itself sets that time.
Also take the chance during this refactor to disallow passing null
pointer by default since no user needs that.
Finally, update the LlcTest accordingly with all API/behavior changes.
Related: OS#4420
Change-Id: Ief6b1464dc779ff22adc2b02da7a006cd772ebce
Found while doing differential analysis (comparison against the
original implementation from Wireshark).
Change-Id: Ibd0b7400d78f7873c2a8d45267332f511b5c6fbb
Found while doing differential analysis (comparison against the
original implementation from Wireshark).
Change-Id: I9f7fa9c3f2f4ff5213dded930cee7ec509b9d799
Found while doing differential analysis (comparison against the
original implementation from Wireshark).
Change-Id: Id2a4f03035cd8354d3fba0ad37571453d3986d21
The implementation of CSN.1 codec was taken from Wireshark, where
it's implemented in pure C. For some reason it was mixed with C++
specific features, mostly using references in parameter
declaration. Not sure what are the benefits.
Change-Id: I56d8b7fbd2f9f4e0bdd6b09d0366fe7eb7aa327a
This would allow us to catch more bugs. Note that I had to remove
printing of pointer address to make the output deterministic.
Change-Id: I1a77441eb957353c919bc73f8e3a2e38f4a383a9
As was discovered recently (see OS#4388), bitvec_read_field()
would never return a negative value because its return type
is unsigned (uint64_t).
We don't really need to get more than one bit, so let's just
use the bitvec_get_bit_pos() instead.
Change-Id: I763a295cd955cd33f542292c85d97ff82f6b49bc
Related: OS#4388
After the recent changes [1], it was noticed that one of the unit
tests fails. In particular, a decode-encode cycle of Packet
Polling Request produces a different vector:
vector1 = 49 13 e0 08 50 88 40 13 a8 04 8b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b
vector2 = 49 13 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b
vector1 == vector2 : FALSE
As it turns out, the original (input) vector itself is malformed
because it contails no valid identity, and thus violates the
specs. The CSN.1 decoder from Pycrate [2] throws an exception
while trying to decode it. I believe we should do the same.
Let's stop decoding the bit stream and return an error in case
if neither of a given list of the choice items matched.
[1] Ia0f8cc224a4c38e80699f834fd83d4c0d99322ea
[2] https://github.com/P1sec/pycrate
Change-Id: I420144773ed5e80372534e0f18db5e74cdb2999d
Fixes: OS#4392
The problem is that bitvec_free() is not NULL-safe. Ideally we
need to fix it in libosmocore [1], but let's also fix it here,
so OsmoPCU can be safely used with older libosmocore versions.
[1] https://gerrit.osmocom.org/c/libosmocore/+/17114
Change-Id: I7647d17b3d03f8e193ef6e793a2d3c1967744eef
Fixes: CID#208181, CID#208179
Output was incorrect before this patch. LOPC was being called without
having any initial LOGP, and trailing newline was usually missing at the
end.
Since csnDecoder/encoder functions are recursive, it's difficult to
handle logging state in a coherent way inside them. Let's better simply
control start/end of logging related topics in the callers of those
functions, and simply use LOGPC everywhere in csn1.cpp.
Change-Id: I50da7560939fac360b7545e2a6bfaf45ed0c4832
It was noticed that OsmoPCU leaks memory when trying to reconnect
to the BTS. It could be easily fixed, but we don't really need to
allocate the PCU socket state on heap as we never have more than
one connection.
Change-Id: Iea8930f443caa16f522f7c5375e0004e4e2315cb
Since I2b32b4fe20732728db6e9cdac7e484d96ab86dc5, go_parent_cb()
is completely optional. It no longer has the task to determine
the correct parent node. The is_config_node() callback is no
longer needed too. Get rid of them.
Since Ic5e69a396df659933fd4d50298b9925e837a6861 we depend on 1.3.0.
Change-Id: Id7ce8c4e1ac43747ad40a06d01433c366da07b42
As was discovered by pespin, changing logging level of DCSN1 makes
the CSN.1 decoder behave differently (see OS#4375). In particular,
this makes RLCMACTest (encode / decode test) fail.
I did a quick investigation and noticed that some of the logging
statements call bitvec_read_field(). By definition this function
moves the internal pointer (current bit position) of a given
vector and increments readIndex by a given amount of bits.
The problem is that LOGPC would not evaluate its format string if
the logging message is not going to be printed, e.g. if a given
logging level is lower than the current one, or in case if
logging is not enabled at all.
The first two conditional calls to bitvec_read_field() are related
to CSN_PADDING_BITS, so that's not critical because padding is
always in the end of messages. The later two are related to
CSN_RECURSIVE_ARRAY and CSN_RECURSIVE_TARRAY respectively.
Let's use bitvec_get_uint() instead to keep readIndex unchanged.
Change-Id: Ia331048db9f790ca407fd341ced01df12d10a233
Fixes: OS#4375
Same API is kept to more easily keep code compatibility with wireshark's
packet-csn1.c implementation.
Change-Id: I1ce2c52e2357841aa1f31babfdce9011435f866b
The 'gprs_llc' is defined as a pure C structure with C++ specific
extensions (methods), so it's rather a class. Accessing its field
'frame' statically causes Clang to throw a compilation error:
gprs_bssgp_pcu.cpp:111:29: error: invalid use of non-static data member 'frame'
if (len > sizeof(gprs_llc::frame))
Let's avoid this and use LLC_MAX_LEN as the size limitation.
God knows what to expect from such a mix of C++ and C...
Change-Id: I7f84bd776cc780a45880f136107f6e0bc56241d1
This is rather a cosmetic change aimed to make ASAN / Coverity happy.
In general, we never pass any input from an untrusted source.
Change-Id: I26d654da4c3bf5fd86a298c3027fd9820c932308
It does not make sense since INT_MAX is always less than LONG_MAX.
Found by Clang [-Wtautological-constant-out-of-range-compare].
Change-Id: I9934e05aa050bf93b3c795376f5dca3a848a7e11
(as they are part of the RlcMacUplink_t structure that is also used to call csnStreamDissector function).
Port from wireshark.git commit 9f8b638cfa8a660fb64c54dcadb83e6747db0a15.
Ported-by: Pau Espin Pedrol <pespin@sysmocom.de>
Change-Id: If46f8cc3f21f527f911dcac6ff1b78f182104a00
Port of wireshark.git 8626bb4cbb4d9926f7b56663585d9ef66252f93f.
We don't really need the other fields added there, let's keep only the
value out of the union.
Change-Id: Ia8889252ee7518a919a15d749815c2803b4b23cd
Port of wireshark.git commit 6aca10831f86c562970b13efa811f46e25ee3091.
From Mike Morrin:
Fix pedantic compiler warnings in csn.1 dissectors.
There is some tricky casting going on in csn.1 structures. To eliminate all
the warnings, the function pointers needed to be moved out of the object
pointer unions. Fortunately macros (mostly) hide these changes from the
protocol dissector tables.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7686
svn path=/trunk/; revision=44899
Change-Id: Ia1a8c50c4b024ca6df4e3fbbf891cd33591ccc9b
This is a port of wireshark.git commit
2f024256bf337400ef3a82fa75e6d48d5707e059.
From 78516187d821b8d19d16987b1d6bc855ee7cbe10 Mon Sep 17 00:00:00 2001
From: Sylvain Munaut <tnt@246tNt.com>
Date: Sat, 4 Feb 2012 10:00:22 +0100
Subject: [PATCH 4/6] packet-csn1: Allow CHOICE elements to re-process the bits used for the choice
We may want to display more detail, or the sub-element should be
displayed with its headers or whatever ...
Change-Id: I3a5a95d5f918b8f17a2400a6d0c4d855ecacea7e
Port of wireshark.git 2f024256bf337400ef3a82fa75e6d48d5707e059.
From c6ee558d3bb00bfd25cca7c534448bf60df3c7cf Mon Sep 17 00:00:00 2001
From: Sylvain Munaut <tnt@246tNt.com>
Date: Sat, 4 Feb 2012 10:24:01 +0100
Subject: [PATCH 6/6] packet-csn: Extend CSN_SERIALIZE to allow 0 bit of length
In some coding there is no 'length' field at the top of a serialized
block, or it's more complex than a single field, in which case we
have to rely on the serialize decoder to consume the correct number
of bits.
We extend the CSN_SERIALIZE processing so that if a '0 bit' length
field is specified, then the length is not displayed and the
consumed bits by the serialize function is taken as the length
at posteriori.
The processing keeps the same behavior for any length > 0.
Change-Id: I9fadc99218594447001f7bb9943f4514b9877799
So that they always occur next to an increment of bit_offset.
Port from wireshark.git 1c81971d4292438ffdf83e9f9b9ab96c133c785b.
Ported-by: Pau Espin Pedrol <pespin@sysmocom.de>
Change-Id: I7474e9d632e068d6e33b0a502b81d4fff1f48802
Port from iwireshark.git commit cc6d4341e65ef2e8d8488fe0ac0f236ece0dd844.
It looks like it makes no difference to us now, but other EGPRS messages
may use it in the future.
Ported-by: Pau Espin Pedrol <pespin@sysmocom.de>
Change-Id: I34039370c292e62790a38abb59f55c69fffa88e8
Currently code using that function in osmo-pcu is disabled, allegadly
because SGSN was sending incorrect values, but it looks more like a CSN1
issue.
Related: OS#1525, OS#3499
Change-Id: I92c86397f988afaa791871d823a45fa85054f3bb
P-TMSI is optional IE, but IE is mandatory and hence always available.
Since the encoding is actually a Mobile Identity, the IMSI is used in
case P-TMSI is not available.
Change-Id: I4dbf8db04e81f98352a42ce34a5d91326be9bfd1
It's not really needed to have those together in some function calls,
and makes it more difficult to follow the code. Furthermore, new callers
not having content already aligned (len+value) will be using these
functions in forthcoming commits.
Change-Id: Ifb9d3997bfb74b35366c3d1bc51ce458f19abf16
Others projects don't contain a dash in there, and it seems to cause
problems with TTCN3 VTY expectations.
Change-Id: I3430abb5fc622dec293457466e760de95fa3a05c
Some are used to control (M)CS values for downlink while some do it for
uplink. Let's make clear which one is used for what. Take the chance to
document the fields a bit better than they were.
Some more information about the origin of cs_downgrade_threshold can be
found in the commit introducing it: 70b96aa232.
Related: OS#4286
Change-Id: I4e890e924b094a1937fbd3794de96704cf0421a8
So far there was a memory leak, because free()ing 'the_pcu.bctx'
would cause ASAN to complain. And that's reasonable, because it
needs to be freed properly. Moreover, 'the_pcu.bctx' may simply
be uninitialized in some cases, e.g. when OsmoPCU is terminated
before connecting to the SGSN.
Let's use the new bssgp_bvc_ctx_free() from libosmogb.
Change-Id: I274e79e1746c7678b81720ec11e8a564befe38ba
Depends: Ia78979379dbdccd6e4628c16f00d0c06d9212172
Both BSSGP SUSPEND ACK and NACK messages use BVCI=0 (signaling),
which always exists. Claiming that BVCI=0 is unknown is wrong.
Instead of adding both BSSGP_PDUT_SUSPEND_{ACK,NACK} to the 'if'
statement, let's rather avoid rejection for all BVCI=0 messages,
as there may be other unlisted message types.
Change-Id: I780657c1e8f67e0bef0e92a31db7ba61b57d7ec4
Related: OS#4111
Recent commit added an assertion to check for buffer boundaries and it
actually gets hit.
One of the 2 code paths calling pcu_l1if_tx_pch() was passing a buffer
of 23 bytes while one of maximum 22 is expected (because plen is not set
in the buffer but set inside pcu_l1if_tx_pch()).
So it seems before the assert, that code path was actually writing 1
byte outside the boundaries of data buffer, since bitvec_pack() uses
data_len field of bitvec.
Related: OS#4228
Fixes: 8dc09e73d0
Change-Id: I84c5dfd4d5580e9d4c00ed21887cb51bd9abbd2e
For a long time the VTY command to show all active TBFs was broken.
The TBF filtering (by allocation origin) logic allows one to show
TBFs allocated on CCCH, PACCH, or on both of them. In the latter
case we have been checking whether a TBF was allocated on both
logical channels at the same time.
Let's fix this by passing a flag-mask instead of boolean arguments.
To be able to use GPRS_RLCMAC_FLAG_* definitions from "tbf.h", let's
exclude them from "#ifdef __cplusplus ... #endif" block.
Change-Id: I1c9f401368af880a97d32905c4cce0da481ffc21
paging group is 3 bytes and imm assign with plen prepended is 23 bytes,
so there's 1 extra byte not needed and makes code confusing.
Change-Id: Id7835e5aa1506505ff54e019b38f30111f79b5dc
Otherwise, a new meas object is allocated in the stack in upper layers
which doesn't contain the link_qual information (have_link_qual=0),
outputting following error:
osmo-pcu/src/gprs_ms.cpp:644 Unable to update UL (M)CS CS-2 because we don't have link quality measurements.
Change-Id: I1980ca325c8d65f3f6310fa697dd810eec7ab077
Move code in rcv_block_gprs() only needed for rcv_control_block() into
the later. This way rcv_block_gprs() is simplified and shows similar
code paths with regards to rcv_data_block().
It can now be seen that the main difference between both is the meas
param no being passed in the control case.
Change-Id: I2a0133463edced93c72ccc743a0cf00d1d6922cf
This commit would also remove the option from config_write_pcu() since
it's automatically filled in by osmo_tdef, but there was actually a bug
because that param was never printed when saving the config...
Change-Id: Id8e70b0f44ef2f7e20ecdb3fd8ca93ae2a05b9a3
Receive an Application Information Request from the BTS via PCU
interface. Construct a Packet Application Information message from it
(3GPP TS 44.060 11.2.47) and send it to all MS with active TBF.
The TTCN-3 test infrastructure to test this feature is not quite ready
yet, so I've added C unit tests instead.
Related: OS#4048
Change-Id: Ie35959f833f46bde5f2126314b6f96763f863b36
This will allow for configuration of some of the timers by the user,
and allow him to inspect current values being used.
It will be also useful for TTCN3 tests which may want to test some of
the timers without having to wait for lots of time.
Timers are splitted into 2 groups: BTS controlled ones and PCU controlled
ones. The BTS controlled ones are read-only by the user (hence no
"timer" VTY command is provided to change them).
TbfTest.err output changes due to timers being set up correctly as a
consequence of changes. Other application such as pcu_emu.cpp and
pcu_main.cpp had to previosuly set the initial values by hand (and did
so), but apparently TbfTest.c was missing that part, which is now fixed
for free.
Depends: libosmocore.git Id56a1226d724a374f04231df85fe5b49ffd2c43c
Change-Id: I5cfb9ef01706124be262d4536617b9edb4601dd5
Since [1], OsmoPCU already starts to retransmit downlink blocks before
the MS has had a chance to receive them and/or send the related
acknowledgement in uplink. Make this optional with the new VTY option
"no dl-tbf-preemptive-retransmission".
[1] e25b5b91f6 ("tbf: Only create dummy frames if necessary")
Related: OS#2408
Change-Id: Id08aed513d4033aa0d4324c6ce07cbb2852f2f92
Those namings my collide with usual osmocom "T" variable name associated
to a timer number, which will be added in following patches.
Change-Id: Ic2b5068a4882e4a043bf81496be30a378fdb9a09
The following message is printed by the pcu_tx_txt_ind():
DL1IF INFO pcu_l1_if.cpp:113 Sending XXX TXT as PCU_VERSION to BTS
There is no need to print it twice:
DL1IF INFO osmobts_sock.cpp:74 Sending version XXX to BTS.
DL1IF INFO pcu_l1_if.cpp:113 Sending XXX TXT as PCU_VERSION to BTS
Change-Id: Ic2793f20cf9df2fa08c45070a8f81ef1c08b925a
We don't really need to use the message buffer (on heap), because
it's never getting passed to pcu_rx(). Let's use a buffer on stack.
Change-Id: I4cb8ca80513df7b71e1438da2e82799be6be1fa0
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.
Related: OS#4138
Change-Id: Ic1ac815eafab49577ff883a5d700ecca5936d216
Ubsan complains about shifts into the sign bit due to automatic int
promotion, so cast explicitly.
Change-Id: I6387c7313832f6c7c920e1016b74562b66d6b68e
Related: OS#4029
The recent versions of OsmoBTS do provide the following measurements:
- RSSI (Received Signal Strength Indication),
- ToA (Timing of Arrival),
- BER (Bit Error Rate),
as well as C/I (Carrier-to-Interference ratio) since [1] (OS#4006).
[1] https://gerrit.osmocom.org/r/Ia58043bd2381a4d34d604522e02899ae64ee0d26
Change-Id: I0fd6c35e8cf0b1314f4e3c336b233b5f7e42dfc6
Related: OS#1855
In most cases the length field was present and this field takes 7
bits of the maximum available 110 rest bits.
The length field was only removed when encoding huge bitmaps usually
only happen on lossy connections with packet lost.
However the cases without length field were encoded incorrect,
because all remaining bits must be used by the uncompressed bitmaps,
but the PCU violates this by encoding always the "release 5" bit.
Rather than fixing the encoding without length field, simply remove it
and always encode with length field. This also reduces the code
complexity.
Change-Id: I7bc2e18d647b72b8f17ba7a5c9c5e421d88275fb
The ESN, SSN and uncompress bitmap len are uint16_t. The Window is using uint16_t in
function arguments and return values. Don't do so many integer conversions.
Change-Id: If62fa09d7bfa8e91ce707824f7019edb1b83da9e
search_runlen() must know the exact size in bits when parsing
the bits otherwise it read over the buffer.
Fixes testcase #7 which was wrongly decoded.
Change-Id: Ie34a0651e7e7efea4e9ecff1e3a467588113cf47
The i value will only count forward and is limited to 11 bit. The integer is also
converted when returning to uint16_t
Change-Id: Ib8a9081bbcb8b4344498254c58941002d17f9381
The last bits of the CRBB (compressed receive block bitmap) was incorrect
encoded when the CRBB is not byte aligned.
Related: OS#3728
Change-Id: I7261aa71b37d7ead52992f8db462f72a3804988e
The instance bssgp_nsi is a global instance to be used by all
NS related functions. Previous the PCU allocated and initialized
the bssgp_nsi instance when (re-)connecting and freeing on disconnect.
The problem of the implicit initialisation is gprs_ns_vty_init(bssgp_nsi).
All vty init functions must be called before the configuration is read,
otherwise a previous vty written configuration is invalid.
Furthermore the vty modifications to the `ns` object were lost when the PCU has to
reconnect to the SGSN.
Fixes: OS#4024
Change-Id: I2aa53ea54e9352577f6280ad7b9d1d9da9f57eaf
rename the function sgsn_ns_cb -> gprs_bssgp_ns_cb.
To allow writing and reading the same configuration, the pcu needs to register
all vty commands before reading the configuration. This callback
is required to register NS based vty commands
Related: OS#4024
Change-Id: I440c0df2e32fe22bf43288c00bb4aa3a0c6a3a51
In 3GPP TS 44.060 the selection of MCS for retransmissions is defined as
separate tables (8.1.1.1 and 8.1.1.2) depending on the value of
resegmentation bit (which is opposite to the way EGPRS_ARQ are defined
in the source code). Let's follow the same idea and explicitly check for
resegmentation bit value and use separate tables. This also makes it
easier to add proper support for special cases (MCS-6-9 and MCS-5-7) and
padding in future independently for different ARQ types. The code is
also moved to c to avoid unnecessary conversions to and from cpp class.
Change-Id: Ia73baeefee7a58834f0fc50e3b8bf8d5e3eb7815
Problem:
TA provided from L1 PH-DATA-IND is a relative amount of TA adjustment to actual TA
being used for given TBF. The current TA update algorithm in PCU simply applies the relative
amount of TA to given TBF but does not take into account of current TA.
As a result, the PCU will request wrong TA jump for given TBF if the MS is moving away from
BTS more than 2 km.
Related issue: http://osmocom.org/issues/2611
Fixes:
- The PCU needs increase or decrease current TA of given TBF on receiving of relative
amount of TA adjustment provided by PH-DATA-IND from L1.
- The PCU needs to set absolute TA of given TBF on receiving absolute TA provided by
PH-RA-IND from L1.
From-Commit: 139ad3f42193
From-Remote: https://gitlab.com/nrw_noa/osmo-pcu
Change-Id: I7665586dd5722bbe04632ee5673d3033bc082324
Write initial bits of 3GPP TS 44.018 §10.5.2.16 IA Rest Octets the same
way as write_ia_rest_*() routines do.
This should also fix the issue addressed in
I75dd5bebc74eea85edf9582607c774d0bba0d2a6 initially by properly encoding
L/H bits.
Change-Id: I7ed5270bf95c3f6e9e026ff447eef8539f6f0314
* use enum CodingScheme directly instead of converting it to class and
back
* drop useless mode check
* log errorneous update attempt
Change-Id: I763136c2f356d63aa3d28d09c57fd5faf5336258
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
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.
That's partially based on reverted commit 93d947f5e8.
Change-Id: Ibe294b26ac374b9264a734db9663cacc105a4474
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
This is a much safe way, it allows for modifications of the debug
subsystem enum member values without breakage. Also, the syntax
introduced here is what we do in all other Osmocom CNI projects.
Change-Id: I2be88586ca44b0b8361f96cf3c034c8459244c2c
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. As of
Change-Id I3c1af662c8f0d3d22da200638480f6ef05c3ed1f, OsmoBTS forwards
this via the PCU socket, so we need to pick it up and send it via BSSGP
to the SGSN.
Change-Id: I7b4beb413a6f974373a404b5a11c44d86ba695d3
Closes: OS#2249
In Change-Id I787fed84a7b613158a5618dd5cffafe4e4927234 in February 2018
we accidentially introduced a change that would erroneously swap
the endianness of the CellID on the way between PCUIF socket and
BSGSP. This meant that all OsmoPCU based BTSs would report the
wrong CellId to the SGSN.
Closes: OS#3854
Change-Id: I2f6cc930c5dbf8dac386b24b0756df2efe8199e4
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
bts.h needs pdch.h whether we're compiling C or C++ code so move it out
of the #ifdef.
make[1]: Entering directory '/home/daniel/scm/osmo/oc2g/osmo-pcu-oc2g/src'
CC osmo-bts-oc2g/oc2g_l1_if.o
In file included from osmo-bts-oc2g/oc2g_l1_if.c:39:
./bts.h:74:26: error: array type has incomplete element type ‘struct gprs_rlcmac_pdch’
struct gprs_rlcmac_pdch pdch[8];
^~~~
Change-Id: Ib39e4424f73c677b34f921917440f211e400e14f
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
The TAI is described as { 0 | 1 < TIMING_ADVANCE_INDEX : bit (4) > } in
3GPP TS 44.018 §10.5.2.16.1 so it should be encoded with if-else.
Change-Id: I54482790e1cf3cb13a635a99a481250576deabaf
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
Add method to explicitly cleanup BTS singleton similar to GprsMsStorage
class and use it from main(). The destructor becomes trivial wrapper
around cleanup() method.
This prevents annoying SIGABRT on exit of OsmoPCU caused by
rate_ctr_group_free() being called after talloc_free() which removes the
context in which counter group is allocated.
Change-Id: I796d56a7de3f3a1f9d59708995c8e3e9b05a2747
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
Moving from header-defined inline function allows us to hide
egprs_mcs_retx_tbl definition and simplify further changes.
Change-Id: I95258d1558a3b918ae83f1a69e7c3de2b97e5627
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
Previously MAX_GPRS_CS was used for both EDGE and GPRS which means that
we waste extra memory in GPRS case. It also leads to misleading
name. Let's fix this by introducing separate definitions for GPRS and
EDGE cases and use them as appropriate in limit checks.
Change-Id: I3ae1ee64ec8e80247b8fe669cc79505b4dadf58f
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
As a preparation for (M)CS fixes in follow-up patches, remove unused
operators from GprsCodingScheme class.
Change-Id: Ieef3b095a6732300e5efa395b989843112b9ca78
This change add support for the recently-introduced GPRS Gb interface
auto-configuration using the NS IP Sub-Network Service (SNS) procedures.
It requires a Change-Id I84786c3b43a8ae34ef3b3ba84b33c90042d234ea of
libosmocore.
Related: OS#3372
Depends: I84786c3b43a8ae34ef3b3ba84b33c90042d234ea (libosmcore)
Change-Id: I256b40ac592d3b6e75dd581bf7b9512f69b11e83
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.
That's partially based on reverted commit 529ce88545.
Change-Id: I143b3dd02aa54b9ce206d9e780a5554f6d9fd118
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.
That's partially based on reverted commit 529ce88545.
Change-Id: I19cc4226e7e831e7d7f70212b2078f5589a87ff0
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.
That's updated version of commit with the same topic reverted earlier.
Change-Id: Ie180733d2584ebb16fb80b84526d0dbc70e3d441
Related: OS#3014
In preparation for upcoming patches with 11 bit RACH and TA support,
let's restructure existing encoders to simplify further modifications:
* move consistency checks to top-level Imm. Ass. encoder
* use consistent formatting
* constify pointers where appropriate
* split SBA and MBA encoders into separate functions
Those changes also make it obvious which parameters are necessary for
Rest Octets in each specific case (DL, UL-SBA, UL-MBA, UL-SBA-EGPRS,
UL-MBA-EGPRS).
There're no functional code changes so there's no need to adjust tests.
Change-Id: I0ad1bc786c3a8055ea9666f64ae82c512bd01603
Related: OS#1548
Both OsmoBTS and OsmoBSC use their own copies of this header nowadays so
we can simplify our installation slightly by making it local only.
Change-Id: I4a87395d4ab7212fe2fc055dae0a737e10d20c69
In Change-Id I7d22e7b5902c230efeae66eb20c17026a4037887 we
introduced the use of timespecsub(). Unfortuantely, we also
accidentially removed the call to osmo_clock_gettime() along
with it, leaving now_tv completely uninitialized.
Change-Id: Ieced0c62700b2fe4ab0208258183154cc701490b
Related: OS#3225
Fixes: Coverity CID#188872
In pcu_l1if_open(), use osmo_strlcpy() instead of strncpy() and check for
overflow. This catches overlong and non-NUL-terminated socket paths.
Change-Id: I825190cbb34d052b797e9fb5208884d6f5992839
Related: OS#2673
The '.' is illegal character in counter names, as they are exported
via CTRL interface, where '.' has a special meaning that cannot be
used by strings comprising the variable name.
Change-Id: Ieb7496e1a30ab4f2bfe36c7b664dcdc034010a15
Wrap-around of var handling next id will luckly happen
long after initially assigned TBFs are already released.
Change-Id: I90ef64133986c556c1a529f5b966e847e6cabbad
The return code from bssgp_tlv_parse() was not checked for a parsing
error. In case of a parsing error the stored return code could have
been overwritten later in this function.
Explicitly check for a parsing error, log corresponding packets,
and return an "invalid mandatory information" error status to
the sender. To avoid loops, do not respond with an error status
to STATUS PDUs.
Change-Id: I56e10a97cda7fd2d40bc7b4b2e6202f97772e1b3
Related: OS#3178
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
The previous implementation unconditionally subtracted nanosecond
values from different time measurements, causing overflow if the
current measurement was taken in less of a fraction of a second
than the past measurement. Use timespecsub() instead, which
accounts for nanoseconds correctly.
Also, fix calculations of KBit/s throughtput. It was not being
calculated correctly, since it was actually accounting for one
KB per 128th-part-of-a-second.
Change-Id: I7d22e7b5902c230efeae66eb20c17026a4037887
Related: OS#3225
There have been test failures on the osmo-pcu Jenkins builders due
to apparent clock drift. Switch relevant code from gettimeofday()
to clock_gettime() with CLOCK_MONOTONIC to prevent time from going
backwards and causing negative time deltas in calculations.
Change-Id: I775d85d0d3ac740330879e588bdab6fce7f0b46c
Related: OS#3225
Address sanitizer uncovered a one-byte stack overrun due to an
off-by-one in the size of the 'data' buffer in pcu_l1if_tx_pch().
Fix the problem and add an assertion which triggers before the
overrun can occur.
Change-Id: I08a879d72fcb916f78f175612fd90467d7bdd57c
Related: OS#3289
As warned by gcc 8.1.0:
osmo-pcu/src/tbf.cpp: In constructor ‘gprs_rlcmac_tbf::gprs_rlcmac_tbf(BTS*, gprs_rlcmac_tbf_direction)’:
osmo-pcu/src/tbf.cpp:222:33: error: ‘void* memset(void*, int, size_t)’ clearing an object of type ‘struct gprs_rlc’ with no trivial copy-assignment; use assignment or value-initialization instead [-Werror=class-memaccess]
memset(&m_rlc, 0, sizeof(m_rlc));
^
In file included from osmo-pcu/src/tbf.h:24,
from osmo-pcu/src/bts.h:37,
from osmo-pcu/src/tbf.cpp:22:
osmo-pcu/src/rlc.h:234:8: note: ‘struct gprs_rlc’ declared here
struct gprs_rlc {
^~~~~~~~
Change-Id: Ifb0529b9ae6cd4300e5cbbd9151054792edbfe06
In libosmocore, we normally register a SIGHUP handler for log file
rotation.
However, the osmo-pcu code so far installed its own signal handler,
which did exactly nothing in the SIGHUP case.
Let's fix this by removing SIGHUP handling here, letting libosmocore
take care about this.
Change-Id: Ifa20d79770bc4d88d40601b008a3a2a79d083c04
Closes: OS#3265
Add pointers to relevant parts of the spec. Tweak comments to be
more specific about the values being written and abbreviations used.
Change-Id: Ia5bf3f7f8846198b7b4e25ff1accf6206764be74
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.
Currently, the log output lacks the frame number.
- make get_current_fn() public
- add frame number to the log statements in pcu_l1_if.cpp
Change-Id: Idce994dbf86a2bbf861907d75418a2a3867244db
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
This reverts commit 529ce88545,
I2139fb347b3290621bbc3f6a031f7f213d372e65.
Commit I52ec9b07413daabba8cd5f1fba5c7b3af6a33389 /
896574e92b was found (empirically) to be a
regression, rendering GPRS service fatally unreliable.
This reverted commit seems to be related to the regression and is reverted
along with it.
Related: OS#3013
Change-Id: I3e8cc0e8ba3ba5bd444124fd4cb95ef92a71fdfb
This reverts commit 896574e92b,
I52ec9b07413daabba8cd5f1fba5c7b3af6a33389.
This commit was found (empirically) to be a regression, rendering GPRS service
fatally unreliable.
Related: OS#3013
Change-Id: Idcba0381f70eb7f7c9aefdee9dfeafd5de96a9be
This reverts commit 93d947f5e8,
I44db2eeea7448ff67e688ae716487bc6dbfc96a3.
Commit I52ec9b07413daabba8cd5f1fba5c7b3af6a33389 /
896574e92b was found (empirically) to be a
regression, rendering GPRS service fatally unreliable.
This reverted commit seems to follow after the regression and is reverted along
with it.
Related: OS#3013
Change-Id: If7038127e9a663c93006475b3add961adc0b1922
This reverts commit 6298fbb7b2,
I8b17be78a46c0bc17516b7c90f35aa4768010ae4.
Commit I52ec9b07413daabba8cd5f1fba5c7b3af6a33389 /
896574e92b was found (empirically) to be a
regression, rendering GPRS service fatally unreliable.
This reverted commit seems to follow after the regression and is reverted along
with it.
Related: OS#3013
Change-Id: I5e0fd8c9c3b89e519e7382e3d0bb24e0aeddeff6
Avoid runtime error seen on jenkins admin-deb9build slave, when building
osmo-pcu with_dsp=None,with_vty=False, during ts_alloc and tbf regression
tests:
+../../../src/mslot_class.c:271:36: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
+../../../src/mslot_class.c:272:22: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
This time it seems that these are all.
The master-osmo-pcu breaks on this since moving to a debian9 build slave.
Change-Id: I976a1dca9da19a05afc85a17b7ba60545b7bc1e5
Avoid runtime error seen on jenkins admin-deb9build slave, when building
osmo-pcu with_dsp=None,with_vty=False, during ts_alloc and tbf regression
tests:
+../../../src/mslot_class.c:242:22: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
The master-osmo-pcu breaks on this since moving to a debian9 build slave.
Change-Id: I0cdf10e5fbc1173a7a09bd4fed8a66d06f80aeb1
Commit 741d25cb6f commented the only user
of the function but forgot to comment too the function itself.
Change-Id: I8b291b45aaedfb0421cd28c0d9e24cefa5547b09
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
* store N310* counters in shared array similar to corresponding timers
* add functions to increment/reset counters
This avoids direct access to TBF counters from PDCH.
Change-Id: I8ffff9c7186f74bde7e6ac5f6e98f0b3e4c35274
Related: OS#1539
Don't use PDCH from free TFI lookup routine. This allows for simpler
function which can be moved to mslot_class.c alongside with other
similar helpers.
Change-Id: Ie154866900453d232a890f7b9a30911b451525a1
Related: OS#2282
The PDCH class and corresponding functions are rather self-contained and
independent from BTS implementation. Let's move them into separate file
to make bts.cpp more manageable. As additional benefit it allow us to
somewhat untangle all the different cross-dependent includes.
Change-Id: Ie05e25361e6741a81b024679f9675c98d4923683
Related: OS#1539
* move USF allocation into separate function
* document USF allocation
This allows to clearly see where selected UL TS is forced into single TS
in algorithm B allocator.
Change-Id: I563dc10827ce68295553f88f3bf2e1fc0ba595c1
Related: OS#2282
* generalize TS allocation and move it into separate function
* move single-slot allocation into separate function
* use common functions for TS allocation on both UL and DL
Change-Id: Ied45ae380c345bc76fe9d6fd9a6184d1109f83f2
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
Having explicit include above the douible-include guard defines is
potential source for hard to track bugs. Let's move it inside the guard
statement.
Change-Id: I5114a63ce00b03c8eed23565d52969250bd505cc
Related: OS#1539
Previously paging was prepared inside BTS function and than handed over
to PDCH function. Move the actual preparation into PDCH to better
decouple PDCH from BTS.
Related: OS#1539
Change-Id: I389fb16b6e54040770c21f88edbcb8e045636928
After the PCU socket becomes available, the BTS might send an
INFO_IND message with the 'ACTIVE' flag cleared. If this happens,
do not exit immediately, but keep retrying until an INFO_IND
message with the 'ACTIVE' flag arrives.
Note that this change only affects behaviour at process start-up time.
If the BTS switches from active to inactive state then osmo-pcu will
still exit. If this behaviour should be changed as well it could be
done in a follow-up patch.
Tested against osom-bsc + osmo-bts-virtual.
Change-Id: Ic42a5601a43b81d260721fef5d9fa52447f9d309
Related: OS#2689
Replace unreadable if-else ladder in is_single_block() with regular
switch-case. This enables implementation of 11-bit RACH support in
follow-up patches.
Related: OS#1548
Change-Id: I9180478152f9341f11bb3dffe61671da683f24d8
* 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
Move TRX check inside local tfi_find_free() wrapper to make main
algorithm easier to follow.
Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171
Related: OS#2282
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
* document used parameters and return values
* use consistent formatting
* constify function parameters where appropriate (adjusting parameter
types if necessary)
Change-Id: I211b10b4da59c73d509b719346774515c761886a
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
Assign reserved_*_slots only when multislot masks are found to avoid
reassignment and make code easier to follow.
Change-Id: I9b0482f4ea75ead9855cd78e33c8e70d0ccf4484
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
* add functions/macros for setting TBF's poll state
* add function for checking TBF's poll state
Change-Id: I6db1c4e7bd0a49aeb5e391afe371c36b96c6a702
Related: OS#1539
* 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