aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx/loops.c
AgeCommit message (Collapse)AuthorFilesLines
2019-07-31osmo-bts-trx: Don't attemtp to adjust MS power if fixedHarald Welte1-0/+3
If the BSC has instructed the BTS via RSL to not autonomously perform MS power control, we are storing this in lchan->ms_power_ctrl.fixed. However, osmo-bts-trx would simply ignore that flag in loops.c and continue to compute new MS power values based on measurement results. Change-Id: I628d1f4f1094c22248d372c11c2ecc504135b757
2019-07-31osmo-bts-trx: Don't increment rssi_valid_count twiceHarald Welte1-1/+0
In the ms_power_val() function, don't increment the number of valid RSSI values counter twice. Change-Id: I19d9d933a69f7ad6252cbe51751d5db41790c698
2018-12-23osmo-bts-trx/loops.c: Make code control flow more readableHarald Welte1-20/+9
Use the 'else' construct where applicable to avoid too many return paths from functions Change-Id: I819f0c80e90855e8b3252795c837f8e3053b6e87 Related: OS#1622, OS#1851
2018-12-23osmo-bts-trx/loops.c: Use lchan name based loggingHarald Welte1-56/+36
The loops.c code dates back to ancient times when we printed the TRX number and the raw channel number to identify a logical channel. We meanwhile have gsm_lchan_name() and should use it to log messages related to this lchan in a common format. This commit introduces the LOGPLCHAN() helper macro [similar to osmo-bsc], and uses it from loops.c. As a result, some functions don't need a chan_nr argument anymore, while some need to add a new lchan argument. Change-Id: I6976dd7444c26b1f52741bc367b0311ebbef1718 Related: OS#1622, OS#1851
2018-12-23osmo-bts-trx/loops.[ch]: Make functions "void" if they always return 0Harald Welte1-50/+31
The concept of a return value only makes sense if there's actually ever something non-constant to return, and if the caller actually processes that return value. If we always "return 0" and ignore it on the caller side, functions should be of "void" type. Change-Id: I3575a2cef75f3fd4c3f95eddb40719d28a055b54 Related: OS#1622, OS#1851
2018-12-23osmo-bts-trx/loops.c: Add comments documenting TA + MS power control loopHarald Welte1-0/+30
The loops.c code is not very easily understood, so let's add some comments to it. As can be seen, there are functions of integer type which always return 0, and whose callers don't check for the return value. This will be adressed in subsequent patches. Change-Id: Iafea07eb751ed85d29b214576bb0d31ea919cd72 Related: OS#1622, OS#1851
2018-11-22Fix deprecated gsm_arfcn2band(), use gsm_arfcn2band_rc()Vadim Yanitskiy1-6/+5
Change-Id: I45aae70f4bc3f4f85d267dafb757debdef1bb7d7
2018-02-27trx/scheduler: Use integer math for TOA (Timing of Arrival)Harald Welte1-14/+17
There's no need to express TOA as a float: * We receive it as signed 16bit integer in units 1/256 symbol periods * We pass it to L1SAP as signed integer in 1/4 symbol periods So turn it into an int16_t with 1/256 symbol period accuracy throughout the code to avoid both float arithmetic as well as loosing any precision. Change-Id: Idce4178e0b1f7e940ebc22b3e2f340fcd544d4ec
2017-08-24osmo-bts-trx: remove global variables from loopsMax1-10/+8
* move TA related globals into phy_link * move power loop related globals into phy_link * prefix corresponding vty vars with osmotrx Change-Id: I01d7c1abad67e51b886a4ecf2de072929d67da27 Related: OS#1848
2017-08-19osmo-bts-trx: Remove an unused variable. Resolves a compiler warning.Alexander Chemeris1-4/+0
Change-Id: I2464e872f81021cbc3ccbc4e2e32c394d6afcf70
2017-08-19osmo-bts-trx: Fix MS power control loop.Alexander Chemeris1-11/+11
The following two commits from 2014-12-06 introduced a new variable to control MS power - ms_power_ctrl, but kept the old ms_power variable in place. They have also changed the meaning of the ms_power variable - it now keeps original RSL configured value. So when much later osmo-trx-bts code was merged to master the code was compiling fine and this change in the meaning was overlooked. In osmo-bts: 579651bf300de002731dfd3bd39985c9fd15616c power/sysmobts: Add a manual ms power level control In OpenBSC: f6f86b0eec18da165db136b14bf2db87fde4b4ac osmo-bts: Introduce new struct for a power loop in the BTS code Change-Id: I713e39b882db32a0d17aa04790d16fa79afa1fb1
2016-02-15TRX: factor out the scheduler from remaining codeHarald Welte1-39/+44
The L1 scheduler is a generally useful component that is unfortunately tied quite a bit into the OsmoTRX support. Let's try to separate it out by having separate per-trx/per-ts/per-chan data structures pre-fixed with l1sched_ Using this patch it should be one step easier to use the scheduler for other BTS models, such as the intended upcoming virtual BTS.
2015-11-05TRX: catch up with trhe amr_mode naming changesHarald Welte1-3/+3
OpenBSC introduced a naming change in 615ed46a6ab25f71a7ab0d8201d33b4dbf8fc5b0 but osmo-bts fixes were only about osmo-bts-sysmo, not osmo-bts-trx. This updates osmo-bts-trx accordingly.
2015-09-22trx: Cleanup unused parts of loops.cAlexander Chemeris1-7/+2
2015-09-22TRX: Support for AMR full speechAndreas Eversberg1-0/+97
2015-09-22TRX: Code cleanup, prepare for other codecs than GSM full rateAndreas Eversberg1-5/+1
2015-09-22TRX: Implementation of MS power and timing advance loopsAndreas Eversberg1-0/+251