aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2018-02-21Simplify TS alloc: move slot check into functionsMax3-123/+103
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
2018-02-21Simplify TS alloc: move slot assignmentMax3-41/+83
Move into separate functions: * move timeslot reservation * move UL timeslot assignment * move DL timeslot assignment Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Related: OS#2282
2018-02-20TBF: make network counters internalMax5-35/+88
* 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
2018-02-20Simplify TS alloc: constify max dl slot funcMax2-2/+2
Constify parameters of gprs_alloc_max_dl_slots_per_ms(). Change-Id: Ic90930d98560459eab0054cb9e1625cb99db61c8 Related: OS#2282
2018-02-20Simplify TS alloc: don't use PDCH for free TFIMax4-19/+21
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
2018-02-19Move PDCH-related functions into separate filesMax16-1020/+1125
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
2018-02-19Simplify TS alloc: split USF/UL allocationMax1-19/+42
* 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
2018-02-19Simplify TS alloc: split allocationMax3-57/+105
* 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
2018-02-19Simplify TS alloc: separate capacity computationMax3-40/+50
Move TRX capacity computation into separate function and document it. Change-Id: Ifd88fc7ff818ea2a041eae61c5d457926a0df0f2 Related: OS#2282
2018-02-19Simplify TS alloc: split off RX mask computationMax3-46/+54
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
2018-02-19Update header includesMax24-30/+115
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
2018-02-19Move include guard to the topMax2-5/+6
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
2018-02-19Move paging generation into PDCHMax2-12/+14
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
2018-02-19Use explicit type for pcu_lsb()Max1-2/+1
It's only used for byte-long input so we can specify input and output types explicitly. Change-Id: Id0bef691e17e4331c7c4b491661e36173d85388a
2018-02-14Make osmo-pcu wait for BTS to become available at start-up time.Stefan Sperling3-7/+27
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
2018-02-07RACH: improve single block detectionMax1-44/+28
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
2018-02-03vty: drop unused functionMax3-7/+1
Change-Id: I01f3773ca6a9b6d4e28ca2f59c944c6d48918dd1
2018-02-03TBF: show assignment kind in vtyMax1-3/+5
Change-Id: Ic4e40d9c141ab7ee3f7c4dceec007dbe16359f93 Related: OS#1759
2018-02-03TBF: add helpers for assignment type handlingMax3-9/+54
* 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
2018-02-03TBF: decrease logging verbosity for trafficMax2-3/+3
Change-Id: If43aa9895abf58602556c986a633ff93a6f00b06
2018-01-31Simplify TS alloc: internalize TRX checkMax1-11/+10
Move TRX check inside local tfi_find_free() wrapper to make main algorithm easier to follow. Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Related: OS#2282
2018-01-31TS alloc: print suggested TRX on allocation errorsMax1-1/+1
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
2018-01-26Simplify TS alloc: adjust function signaturesMax3-51/+61
* 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
2018-01-26Simplify TS alloc: use defines for constantsMax3-5/+6
* 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
2018-01-26Simplify TS alloc: avoid TS reassignmentMax1-5/+5
Assign reserved_*_slots only when multislot masks are found to avoid reassignment and make code easier to follow. Change-Id: I9b0482f4ea75ead9855cd78e33c8e70d0ccf4484 Related: OS#2282
2018-01-26Simplify TS alloc: fix allocation callsMax2-3/+4
Using the semantic patch below, adjust allocation-related calls to match updated allocator signatures. // spatch --c++ --dir src -I src --sp-file callfix.spatch --in-place --recursive-includes // spatch --c++ --dir tests -I src --sp-file callfix.spatch --in-place --recursive-includes @@ expression A, B, C, D, E; @@ tbf_alloc_ul_tbf(A, B, C, D, E, ( - 1 + true | - 0 + false ) ) @@ expression A, B, C, D, E; @@ tbf_alloc_dl_tbf(A, B, C, D, E, ( - 1 + true | - 0 + false ) ) Change-Id: I43c76cb49093b40eb854d324e898e821270053dc Related: OS#2282
2018-01-26Simplify TS alloc: adjust allocator signaturesMax6-57/+58
* 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
2018-01-25cosmetic: fix whitespace issue with include filesMax1-3/+3
Change-Id: I401fe88f5bd1665becd6fe6d4204b3877d548ccc
2018-01-25Add multislot classes from latest specMax3-11/+39
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
2018-01-25Add tests for find_multi_slots()Max2-1/+4
* make function public * add tests Change-Id: I4174703808335c19341cd5b5f4422496d958967f
2018-01-24TBF: make poll state internalMax7-14/+43
* add functions/macros for setting TBF's poll state * add function for checking TBF's poll state Change-Id: I6db1c4e7bd0a49aeb5e391afe371c36b96c6a702 Related: OS#1539
2018-01-24TBF: make UL ack state internalMax4-10/+35
* 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
2018-01-24TBF: make UL/DL state internalMax5-39/+72
* 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
2018-01-19TBF: add dedicated log categoriesMax6-295/+247
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
2018-01-17Set V_N and V_B to known initial stateMax1-0/+2
Reset V_N and V_B in UL/DL window class constructors to make sure we always start from known initial state. Related: OS#1759 Change-Id: I8e14ffa913b49c5394229220de9165cdfaabdf19 Fixes: CID70468, CID70469.
2018-01-17TBF: log source of state transitionsMax5-24/+27
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
2018-01-17Allow specifying sysmocom headers explicitlyMax1-1/+1
The headers for LC1.5 are specified explicitly. Add corresponding option to specify sysmoBTS headers location and use it in jenkins build. While at it, unify header fixup code with the one used in OsmoBTS. Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462
2018-01-17Use Timing Advance Index in UL assignmentsMax1-2/+6
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
2018-01-17Rewrite Packet Uplink AssignmentMax1-48/+48
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
2018-01-17Rewrite Packet Downlink AssignmentMax1-48/+73
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
2018-01-17Rewrite EGPRS Packet Uplink AssignmentMax1-55/+117
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. Reusable fragments are split into static helpers. Change-Id: I2139fb347b3290621bbc3f6a031f7f213d372e65 Related: OS#1526
2018-01-12Don't access TBF internals in vty functionsMax1-2/+2
Obtain corresponding window object of UL/DL TBF by using proper accessor function instead of direct access to private member. Change-Id: I89bcd2c2b0b6f120d40d20fd43c1e516de3e3950
2018-01-12TBF: unify EGPRS window calculationMax4-36/+23
Move actual calculation into shared function and use it to set window size for TBF. TBT test output requires cosmetic adjuestements due to extended debug output. Change-Id: Ib9f4a277082da3c71007f5f3b4f2acac8b994540 Related: OS#1759
2018-01-12TBF-DL: move priority computation into functionMax2-26/+37
Improve readability by moving priority computation into separate function. Change-Id: Icdca0106a544036eaa94a25f0d4f84e4282f4568
2018-01-12TBF: move window parameters to UL/DL levelMax5-22/+32
The UL and DL TBF use different classes implementing window management. Hence it's better to use it explicitly instead of using the common window management superclass inside common TBF superclass. While at it, also remove the direct access to window class - use accessor functions instead. Related: OS#1759 Change-Id: I0b55aa8947db65f7206adcf53ea32b74a831d9e6
2018-01-12TBF-UL: add simpler test helperMax1-0/+7
Add function to set both V_R and V_Q values to 0 which is useful for TBF test. Related: OS#1759 Change-Id: I719abfbd5b88c694cbbd69d5c4dcb42baaca91b2
2018-01-12Clarify RACH-related interfacesMax2-82/+87
* make is_11bit parameter into bool * remove is_single_block() from public interface and mark it as static * move logging outside of if ladder * move side-effects from is_single_block() into separate static functions * simplify UL-TBF allocation in case of 11-bit RACH This immediately makes it obvious that priority is never actually used despite being computed - seems like a leftover from merge of incomplete patch series. Change-Id: If189b7166a29a87ffb17a7a9bc560f674851fd53 Related: OS#1548
2018-01-12TBF: cleanup state flag handlingMax5-33/+36
* introduce generic function to check whether particular flag was set for'a TBF and clear it if necessary. Use this instead of clear_poll_timeout_flag() * add function to explicitly set assignment and appropriate state flags Overall this makes the code easier to read and debug. Related: OS#1759 Change-Id: Ic4560280c72f91700f2e19c6c7f6658dc29625c2
2018-01-12Make TBF state privateMax2-5/+2
Let's make sure no external function can mess with the TBF state. Change-Id: I217f4c4bac21dd584c8682928a080a1a6e9507e1
2018-01-04cosmetic: clarify coding scheme and puncturingMax5-45/+45
* use appropriate types for coding scheme parameters * add comment regarding possible number of RLCMAC blocks The code in create_dl_acked_block() has underlying assumption that rlc.num_data_blocks can never be more than 2, which is true and is enforced by appropriate asserts but is not obvious when looking at the function code alone. It's equally hard for Coverity which leads to false positives in scan. Lets' make this assumption explicit by putting it into for(;;) condition alongside with corresponding comment. Fixes: CID143070 Change-Id: If599a6c8a6ef56d847604fcf41bb71decccd8a78