aboutsummaryrefslogtreecommitdiffstats
path: root/tests/edge
AgeCommit message (Collapse)AuthorFilesLines
2023-05-03pcu_l1_if_phy: fix API function namesPhilipp Maier1-2/+2
The functions l1if_open_pdch and l1if_close_pdch have a misleading naming since what they actually do is opening and closing the TRX since they return and accept a context (obj) that is valid for a whole TRX. This also explains why the other functions accept a timeslot as parameter in addition to the context. Let's rename those functions so that it is clear what they do. Related: OS#6022 Change-Id: I395a60b2fba39bac4facec78989bac20f0cef0d3
2023-03-14Update libosmogsm deprecated includePau Espin Pedrol1-1/+1
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
2023-02-27pcu_l1_if_phy: add new PHY API function to disconnect PDCHPhilipp Maier1-0/+1
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
2022-12-16Rename gprs_rlcmac_ts_alloc.cpp -> alloc_algo.cpp & create own .h filePau Espin Pedrol1-0/+1
First commit towards trying to have alloc algorithm as isolated as possible from others parts of the code trying to avoid state changes on data structures. Change name also because the alloc_algo not only allocated TS, but TFIs and USFs. Change-Id: I33a6c178c64a769f05d3880a69c38acb154afa62
2022-03-31llc: Convert to CPau Espin Pedrol1-47/+47
There's no real reason (other than historical) why code in llc should be kept as c++ code. Let's rewrite it as C so that it can be included by existing C code without having to add C->C++ shim, ifdefs all around, etc. This simplifies code and easies modification/improvement of the related objects. Change-Id: I250680ba581167d7398b2f734769c756cbb61c48
2021-02-19tests: Replace deprecated API log_set_print_filenamePau Espin Pedrol1-1/+1
Change-Id: Idcc4875592c81f17ac98c4f6098492b3d9dd33d2
2021-02-19tests: Explicitly drop category from logPau Espin Pedrol1-0/+2
Let's disable category here since we don't care about its formatting here. In any case, every test relying on logging output validation should always explicitly state the config to avoid issues in the future if default values change. Change-Id: I7f9c56313cfaa74ebe666f44763a83d8102f5484 Related: OS#5034
2021-01-20Allow multiple bts objects in PCUPau Espin Pedrol1-2/+2
This patch doesn't really tests whether osmo-pcu can work on a multi-bts environment, but it prepares the data structures to be able to do so at any later point in time. Change-Id: I6b10913f46c19d438c4e250a436a7446694b725a
2021-01-19Unify BTS into a C usable structurePau Espin Pedrol1-11/+10
Previous work on BTS class started to get stuff out of the C++ struct into a C struct (BTS -> struct gprs_glcmac_bts) so that some parts of it were accessible from C code. Doing so, however, ended up being messy too, since all code needs to be switching from one object to another, which actually refer to the same logical component. Let's instead rejoin the structures and make sure the struct is accessible and usable from both C and C++ code by rewriting all methods to be C compatible and converting 3 allocated suboject as pointers. This way BTS can internally still use those C++ objects while providing a clean APi to both C and C++ code. Change-Id: I7d12c896c5ded659ca9d3bff4cf3a3fc857db9dd
2021-01-18Split PCU global PCU object from BTS objectPau Espin Pedrol1-3/+7
Currently the BTS object (and gprs_rlcmac_bts struct) are used to hold both PCU global fields and BTS specific fields, all mangled together. The BTS is even accessed in lots of places by means of a singleton. This patch introduces a new struct gprs_pcu object aimed at holding all global state, and several fields are already moved from BTS to it. The new object can be accessed as global variable "the_pcu", reusing and including an already exisitng "the_pcu" global variable only used for bssgp related purposes so far. This is only a first step towards having a complete split global pcu and BTS, some fields are still kept in BTS and will be moved over follow-up smaller patches in the future (since this patch is already quite big). So far, the code still only supports one BTS, which can be accessed using the_pcu->bts. In the future that field will be replaced with a list, and the BTS singletons will be removed. The cur_fn output changes in TbfTest are actually a side effect fix, since the singleton main_bts() now points internally to the_pcu->bts, hence the same we allocate and assign in the test. Beforehand, "the_bts" was allocated in the stack while main_bts() still returned an unrelated singleton BTS object instance. Related: OS#4935 Change-Id: I88e3c6471b80245ce3798223f1a61190f14aa840
2021-01-05Convert GprsMS and helpers classes to CPau Espin Pedrol1-4/+3
As we integrate osmo-pcu more and more with libosmocore features, it becomes really hard to use them since libosmocore relies heavily on C specific compilation features, which are not available in old C++ compilers (such as designated initializers for complex types in FSMs). GprsMs is right now a quite simple object since initial design of osmo-pcu made it optional and most of the logic was placed and stored duplicated in TBF objects. However, that's changing as we introduce more features, with the GprsMS class getting more weight. Hence, let's move it now to be a C struct in order to be able to easily use libosmocore features there, such as FSMs. Some helper classes which GprsMs uses are also mostly move to C since they are mostly structs with methods, so there's no point in having duplicated APIs for C++ and C for such simple cases. For some more complex classes, like (ul_,dl_)tbf, C API bindings are added where needed so that GprsMs can use functionalitites from that class. Most of those APIs can be kept afterwards and drop the C++ ones since they provide no benefit in general. Change-Id: I0b50e3367aaad9dcada76da97b438e452c8b230c
2020-11-04Get rid of bts->egprs_enabledPau Espin Pedrol1-1/+0
BTS simply notifies the PCU about the supported MCS, and PCU is responsible for providing correct data formatting supported for the BTS and the target MS. Related: OS#4544 Change-Id: Ifcf23771bd23afc64ca6fea38948f98f2d134ecb
2020-05-20Get rid of class GprsCodingSchemePau Espin Pedrol1-86/+76
We have same kind of object splitted into two layers, in coding_scheme and gprs_coding_scheme. Let's merge them together and get rid of the class, which is not really useful because it's only a set of functions operating on one enum value. This change also fixes gcc 10.1.0 error about memseting a complex type in rlc.h init(). Change-Id: Ie9ce2144ba9e8dbba9704d4e0000a2929e3e41df
2019-08-05Remove undefined param passed to {logging,osmo_stats}_vty_add_cmdsPau Espin Pedrol1-1/+1
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
2019-03-26MCS: add mcs_is_*() helpersMax1-8/+8
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
2019-03-24MCS: move Mode enum outside of class definitionMax1-7/+7
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
2019-03-19MCS: use value_string for conversionMax1-1/+1
Change-Id: I212ebb892ab162821633974d5a6c7e315d308370
2019-03-19MCS: move HeaderType enum outside of class definitionMax1-5/+4
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
2019-03-12MCS: move Coding Scheme enum outside of class definitionMax1-52/+52
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
2019-03-05EDGE tests: remove no-op checkMax1-2/+0
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
2019-02-26EDGE tests: reduce code duplicationMax1-8/+15
* move duplicated code into helper function * use proper parameter types Change-Id: I8a9528032629e5df629996da5cd8b808efede017
2018-04-01use osmo_init_logging2() with proper talloc ctxNeels Hofmeyr1-1/+1
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
2018-03-11implement support for 3-digit MNC with leading zerosNeels Hofmeyr1-0/+1
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
2018-02-19Update header includesMax1-0/+2
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
2017-10-29tests: Don't use private version of log_info but global gprs_log_infoHarald Welte1-28/+2
There's no need for each test case to carry their own log_info and filter function. They can simply use the global gprs_log_info and configure the stderr log verbosity according to their needs. Change-Id: I8706a624e5d06e062d1198711aa197fbd0860769
2017-02-08main, tests: use msgb_talloc_ctx_init() (new)Neels Hofmeyr1-1/+1
msgb_set_talloc_ctx() is deprecated since libosmocore commit f45334be29016a36594aacc07c90e262e4994525 / change-id I747fbbf977c4d2c868c8dead64cfc5fd86eb8d4c Change-Id: I8d40abec428b739460ed545c9983d1b63021bd08
2017-02-08tests: edge, tbf: assert return valuesNeels Hofmeyr1-0/+6
Numerous calls assign a return value without asserting its value. Add assertions and thus also eliminate compiler warnings about unused values. Change-Id: I7f14198cfd747dae68b8aaa3b8d6ff7fc49ab824
2017-02-08Fix dozens of compiler warnings across the boardNeels Hofmeyr1-18/+7
Change-Id: I166109dc05d3323b92cd2a42f0c7e6009950e15d
2016-09-15EGPRS: Fix issue with row 4 of Table 10.4.14a.1 of 44.060 version 7.27.0 ↵Aravind Sirsikar1-17/+7
Release 7 row 4 of Table 10.4.14a.1 of Spec 44.060 version 7.27.0 Release 7. Says "The previous RLC data block contains a Upper Layer PDU, or a part of it, that fills precisely the previous data block and for which there is no length indicator in that RLC data block. The current RLC data block contains a Upper Layer PDU that either fills the current RLC data block precisely or continues in the next RLC data block." So when we receive block with 1st LI: value=0 and Value of E bit in the same octet as 1, we expect 2 chunks with 1st chunk as length as 0 and complete and 2nd chunk as length non zero. But with this bug we see only 1 chunk causing incorrect assembling This issue has been fixed in this patch. Related: OS#1811 Change-Id: I2cd0fca3ed28a553ede3f4b8a7d3267284dd2c9b
2016-09-15EGPRS: add test case to show LI decoding bugAravind Sirsikar1-0/+28
This patch adds a test case test_tbf_li_decoding which expects a current bug with LI decoding for row 4 of Table 10.4.14a.1 in 44.060 version 7.27.0 Release 7. The test's expectation is corrected along with the bug fix in a subsequent commit Related: OS#1811 Change-Id: Ida410dab1aa4b0cf3e15b2090586377eb19b2469
2016-08-25Modify EGPRS DL TBF flow to support SPBAravind Sirsikar1-18/+20
Modify the EGPRS DL TBF flow to support Split block during Retx. This patch will also Upgrade the test suite with test cases to validate the EGPRS Downlink SPB for Retransmission Scenarios like MCS6->MCS3, MCS4->MCS1, MCS5->MCS2, MCS9->MCS3 MCS7->MCS2, MCS8->MCS3 have been simulated and Integration tested in NuRAN 1.0 hardware thoroughly. Change-Id: I242afdd8ae7622dec8593b26382ad66bad5b9516
2016-07-14egprs: Use RLC/MAC headers from libosmocoreTom Tsou1-36/+37
EGPRS Type 1, 2, and 3 headers are used by OsmoPCU and OsmoBTS. Move the header definitions to libosmocore to be shared by both packages. Modify the struct variable naming to use *_hi/*_lo instead of *_a/*_b in order to be consistent with existing naming used in libosmocore. Change-Id: I98687ad981d27502aec42729611937ba1caf207c
2016-06-17Add test cases for Header type1 in EGPRS ULAravind Sirsikar2-0/+124
Update test suite with test cases for Header type 1 in EGPRS UL Change-Id: I21811bb126dbe151b0708a964d3143bc2fd52389 Reviewed-on: https://gerrit.osmocom.org/272 Tested-by: Jenkins Builder Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-06-15Add test cases for Header Type 2 in EGPRS ULAravind Sirsikar2-1/+128
Updates the test suite to add test cases for Header type 2 parsing in EGPRS UL. Change-Id: I1dd46010065a6d6da21e8e45af71e6d5f649b0b0 Reviewed-on: https://gerrit.osmocom.org/271 Reviewed-by: Harald Welte <laforge@gnumonks.org> Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-06-07encoding/rlc_copy_from_aligned_buffer: export written payload bytes via an ↵Alexander Couzens1-26/+81
argument Require to count statistics for rlc_dl_payload_bytes. Change-Id: I0e622acb1f13f7489946baf049de4ba1cde6a1fc Reviewed-on: https://gerrit.osmocom.org/142 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-02-08rlc: Add with_padding argument to gprs_rlc_data_info_init_dl/ulJacob Erlbeck1-18/+18
The offsets of the data areas change when padding is used (see TS 44.060, 9.3.2.1 and Annex J for details). Extend the parameter lists to pass the with_padding flag and use that information to compute the correct offsets. Sponsored-by: On-Waves ehf
2016-02-08cs: Add GprsCodingScheme::optionalPaddingBitsJacob Erlbeck1-1/+2
Return the amount of optional padding bits, which is 6*8 for MCS-3 and MCS-6 and 0 for all other coding schemes. The padding is needed the encode 68 byte data blocks (MCS-8) with these schemes. See TS 44.060, 9.3.2.1 and Annex J for details. Sponsored-by: On-Waves ehf
2016-02-08cs: Add family related methodsJacob Erlbeck1-0/+13
Add family handling and the related methods family, isFamilyCompatible, isCombinable, decToSingleBlock to GprsCodingScheme. Sponsored-by: On-Waves ehf
2016-02-05edge: Support MCS data block encodingJacob Erlbeck1-0/+243
Currently only GPRS data block encoding is supported. This commit adds rlc_data_to_dl_append_egprs which does the EGPRS specific extension and chunk handling. It extends Encoding::rlc_data_to_dl_append to use that function for MCS coding schemes. Sponsored-by: On-Waves ehf
2016-02-05edge: Select implementation by mode in rlc_data_to_dl_appendJacob Erlbeck1-13/+13
Currently the GPRS data block encoding is applied to every coding scheme, even if an MCS is selected. This commit renames the actual encoding function to rlc_data_to_dl_append_gprs (not exported) and puts selection code into Encoding::rlc_data_to_dl_append. This requires an additional cs argument. Sponsored-by: On-Waves ehf
2016-02-05edge: Add Encoding::rlc_data_to_dl_appendJacob Erlbeck2-0/+253
This function appends a single chunk to an RLC downlink data block. The implementation is basically taken from the gprs_rlcmac_dl_tbf::create_new_bsn method without the TBF related functionality and any side effects. Note that it still only supports GRPS. Sponsored-by: On-Waves ehf
2016-02-05edge: Add encoder for downlink RLC data blocksJacob Erlbeck1-0/+70
Currently the (GPRS) RLC block encoding is done by setting the header fields directly in gprs_rlcmac_dl_tbf::create_new_bsn. This is much more complex with EGPRS, since the data fields are not byte aligned, the header formats depend on the header type, and the mapping of bits to bytes is LSB first. This commit adds Encoding::rlc_write_dl_data_header which writes the header according to the given gprs_rlc_data_header structure. Encoding::rlc_copy_from_aligned_buffer is also added to copy byte sequences into the message. Note that the actual encoding of data units is not yet present. Sponsored-by: On-Waves ehf
2016-02-05edge: Add init functions for gprs_rlc_data_infoJacob Erlbeck2-0/+20
Add the functions gprs_rlc_data_info_init_dl/ul which initialise a gprs_rlc_data_info structure depending on the coding scheme. The fields num_data_blocks, data_offs_bits, cs, and the data_blocks are valid after this call. The other fields are set to 0. The data blocks are initialised to the correct data_len, e == 1 (no extension header field), cv == 15 (not a final block). The other data block fields are set to 0. The gprs_rlc_data_block_info can also be initialised separately by using the gprs_rlc_data_block_info_init function. Sponsored-by: On-Waves ehf
2016-02-05edge: Fix RLC message sizeJacob Erlbeck1-4/+4
Currently the RLC message length that is obtained from the DSP is reduced by 1 if the last byte of the buffer includes spare bits. While this worked well with GPRS, these bits are being used to encode RLC blocks in EGPRS mode. Thus this last byte must not be chopped off. The functionality of the code is not affected by this, since the modified length value is not used. This commit adds GprsCodingScheme::usedSizeDL/UL to return the number of bytes needed to encode the message block. If there are single bits at the end that are to be used (EGPRS), the functions return the number of full bytes plus 1 (which is the buffer size reported by the DSP and returned by sizeUL/sizeDL). The commit also removes the len parameter from rcv_data_block_acknowledged. Sponsored-by: On-Waves ehf
2016-02-05edge: Rename gprs_rlc_ul_header_egprs and gprs_rlc_ul_data_block_infoJacob Erlbeck1-1/+1
These struct names are more specific than necessary. They are used for GPRS (uplink) already. In downlink direction, only a few fields will be added to the header struct. Add addition, gprs_rlc_ul_header_egprs does not map directly to an encoded header, like many other 'header' structs do. Change the names to fit both modes and both directions: gprs_rlc_ul_header_egprs -> gprs_rlc_data_info gprs_rlc_ul_data_block_info -> gprs_rlc_data_block_info Sponsored-by: On-Waves ehf
2016-02-01edge: Add methods and operators to GprsCodingSchemeJacob Erlbeck1-3/+4
Add a few new operators and methods to support the use of GprsCodingScheme instead of the plain integer currently used. Sponsored-by: On-Waves ehf
2016-02-01edge/test: Rename test_rlc_decoder to test_rlc_unit_decoderJacob Erlbeck2-4/+4
This test only covers RLC data units and not whole RLC messages. Sponsored-by: On-Waves ehf
2015-12-16edge: Add test cases for rlc_data_from_ul_dataJacob Erlbeck2-0/+314
This checks the example test cases given in appendix B of TS 44.060. Sponsored-by: On-Waves ehf
2015-12-15edge: Add information about data blocks to GprsCodingSchemeJacob Erlbeck1-0/+4
This commit adds the methods maxDataBlockBytes and numDataBlocks which provide information about the data areas within RLC messages. In these areas, the extension bytes, TLLI, and the LLC data are stored. Sponsored-by: On-Waves ehf
2015-12-15edge: Add header type property to GprsCodingSchemeJacob Erlbeck1-0/+6
The header type depends on the coding scheme, for GPRS there is a single data header type per direction, for EGPRS there are 3 per direction. In addition, control block header types are used with CS-1 only, so there is one of the per direction altogether for GRPS and EGPRS. This commit adds the header type enum and two methods headerTypeData and headerTypeControl. Sponsored-by: On-Waves ehf