aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-10-24WIPpespin/ttcn3Pau Espin Pedrol2-6/+12
Change-Id: I5cb26f6dc0a323b6075832e87e4531340b4050eb
2018-10-22Convert lchan CCCH_LCHAN to chan_nr BCCH and viceversaPau Espin Pedrol2-4/+8
Before this patch it was being coded as SDCCH4 TS0 SS 0, and as a result the state LCHAN_REL_ACT_OML applied in opstart_compl in abused SDCCH4 TS0 SS 4 was not being checked when deciding whether to send a Chan Act ACK in rsl_tx_chan_act_acknack. Fixes: OS#3513 Change-Id: I1641960c9ffbb3ed0de74ab5b53e24e5b4ff3397
2018-10-22gsm_pchan2chan_nr: Fix conversion of CCCH_LCHANPau Espin Pedrol1-1/+1
Previous implementation made no sense, since chan_nr is never read before being set below from lchan_nr. Furthemore, if lcahn_nr=CCH_LCHAN=4, then: cbits = 0x4 + lchan_nr = 0x8 = b1000 which then becomes SDCCH8 according to GSM 08.58 9.3.1, so it's totally wrong: SDCCH/8 + ACCH 0 1 T T T Change-Id: Id1dee716991e6faa406f02c029e998af5780162a
2018-10-21scheduler_trx.c: Switch to osmo_timerfd() of libosmocore >= 0.12.0Harald Welte2-72/+10
Change-Id: I721d493659fde57eca1543b2e63171df1be1279d Fixes: Coverity CID#178646
2018-10-10rsl_rx_chan-activ: Improve logging informationPau Espin Pedrol1-2/+3
Change-Id: I9b9a666e195ea729503ecd707e1582268c190e09
2018-10-10l1sap: Log name of chan_nr instead of hex valuePau Espin Pedrol1-25/+27
Change-Id: If98e130d17f1d153a13ba28f48a0a563731fde41
2018-10-10lchan_meas_check_compute: Log value during incorrect num of SUB ↵Pau Espin Pedrol1-1/+2
measurementes detected Change-Id: I5dacbed5517b2aa2a6bbc66ec125f0bdfd1f5b2b
2018-10-07common/pcu_sock.c: cosmetic: explicitly address lchanVadim Yanitskiy1-2/+2
In the most cases a PDCH time-slot has only one logical channel allocated. In case of both osmo-bts-trx and osmo-bts-virtual, there are two kinds of logical channels: PDTCH and PTCCH, but since they share the same chan_nr value, deactivating one of them would trigger deactivation of another one. Let's explicitly address the first logical channel in array. Change-Id: I8edcb46e887c4db63a425eba89cec4374165763e Closes: OS#3023
2018-10-03abis: inp_s_cbfn: Improve logging signal related informationPau Espin Pedrol1-1/+3
Change-Id: Ia63b69882c74155bcae2e027a21ea7e319647256
2018-09-30sysmo, virtual: properly handle BS-AG-BLKS-RES as received from BSCHarald Welte2-2/+3
Change-Id: Ifd9a3be6189b3288526e12260d68a982b089404e
2018-09-30Fix computing CCCH block number from frame numberHarald Welte5-6/+41
The existing implementation used a simplistic macro, which was wrong in many ways: 1) it returned a negative value for "fn % 51 < 5" conditions without raising any error message or asserting 2) it returned a wrong block number for many different input frame numbers, as it didn't account properly for the FCCH/SCH gaps between the blocks Let's replace the simplistic macro with a proper lookup table based on TS 05.02, and let's OSMO_ASSERT() if this is ever called with non-CCCH frame numbers. Change-Id: I11fd6cc558bb61c40c2019e46f56c1fe78ef39f5 Closes: OS#3024
2018-09-30paging_test: Fix AGCH/PCH split test for second half of 102 multiframeHarald Welte2-13/+13
* we have to use modulo 51, not 50 * the check for FACCH/SCH has to be applied to to the fn % 51 result Change-Id: I540a7eeef3ea3ed7347f0f1b5a5a6fe7ce0ec8bb
2018-09-30contrib/jenkins_*.sh: drop rudimentary '--with-osmo-pcu'Vadim Yanitskiy2-2/+0
The '--with-osmo-pcu' flag dates back to a time where the 'pcu_interface' header was not copied in both repositories and you had to point one to the other. Change-Id: I79e494484cb099cc9ca8c27c38b785c5ea8c3bc6 Closes OS#3514
2018-09-26vty: mark 'rtp bind-ip' deprecated, not hiddenNeels Hofmeyr1-1/+1
The command implementation says "deprecated", so then the vty command attribute should also be DEPRECATED. It will be hidden from online docs and vty reference. Change-Id: I23e620f1b947e129989fe69c6380c91b9abf7021
2018-09-25lc15bts_mgr_vty: Ensure writing well-formed config filesHarald Welte1-5/+5
Every new node level should only add one additional space, not two! Change-Id: Ic890429a6ff1e0c89fe1c6a159c6ee6ecbcf9a5a
2018-09-25ensure all config file examples are well-formedHarald Welte10-193/+193
We used to permit multiple spaces to enter a new node in the config, but modern osmo* code writes config files well-formed where every node equals exactly one indent level. Change-Id: I3da56b34e87503c46e6bf3c7505b83ec5e6aaa20
2018-09-21lc15: led_sleep_cb: pass correct ptr to llist_move_tailPau Espin Pedrol1-1/+1
Fix compilation warning. At runtime it's not a big issue because the "list" field is the first field of the led_list (struct lc15bts_led_timer_list) variable. Hence, the address passed is the same. Change-Id: Ib8bf07990800d74bfb3ad7a55eccfc65e40cd480
2018-09-19common/rsl.c: tweak log message in lapdm_rll_tx_cb()Vadim Yanitskiy1-2/+3
During the investigation of OS#3559, it was discovered that the log message, which warns that an RSL message was dropped due to inactive logical channel, has incorrect log level - LOGL_INFO. This is not informative kind of message, so let's increase the log level, and additionally let's print the hexdump of message and it's length. Change-Id: I26eac5e4466c493ffe08dbb89de20f5e1c2bb85d
2018-09-17CBCH: Some more scheduler_mframe cleanupHarald Welte1-14/+14
As the CBCH replaces SDCCH sub-slot-2 in downlink, we should mark the uplink as IDLE, just as the associated SACCH in uplink and downlink. Also, there are no burst_numbers in IDLE slots. Change-Id: Ib8565d1d0080bfce5d2aec77609709a445a2171c
2018-09-17CBCH: Fix CBCH implementation for osmo-bts-trxHarald Welte1-2/+6
Unfortunately the code in Icc15603079a1709ec094f400a9bcf0008211890f was incomplete as it missed a few spots where the CBCH-enabled channel types weren't yet covered. Using this patch I can both still perform RACH / Location Update as well as actually receive SMSCB messages on an attached phone (Galaxy S5). Change-Id: I311b141668549ef37054cbe74be66bf17ac1d7e6 Closes: OS#1617 Closes: OS#3559
2018-09-17CBCH: sprinkle some OMSO_ASSERT() and guard against talloc failureHarald Welte1-0/+5
Change-Id: I85fdecbf20de83a6f925765a46b5cd14765da03e
2018-09-17CBCH: Add FIXME comments on queue overflow/underflow handlingHarald Welte1-1/+4
Change-Id: Ida97f25ab4bf7e4d0f03b13396cb37cdfe99ef40
2018-09-17get_lchan_by_chan_nr(): Fix resolution of CBCHHarald Welte1-1/+12
The CBCH (as per GSM specs) always maps on sub-slot 2 of either the SDCCH/4 or SDCCH/8 that it replaces. However, the way how we express it as RSL-style channel number (0xC8) doesn't allow room for any sub-slots. The top 5 bits are used for expressing CBCH, while the bottom 3 bits are used for the timeslot number (TN). So when transforming from channel number to lchan, we must handle the CBCH case specially by using a hard-coded sub-slot number of 2. Change-Id: I44e2f763d5d25311167f435f2ca7e030b2a3f009 Related: OS#1617
2018-09-17CBCH: Fix CBCH via L1SAP for osmo-bts-{sysmo,octphy,litecell15}Harald Welte3-3/+9
This fixes a bug introduced in "CBCH: Move processing via L1SAP" commit 02d99db08b13589e1417c3448a07747f8805ba88 Author: Harald Welte <laforge@gnumonks.org> Date: Fri Aug 24 23:37:45 2018 +0200 where the full channel number 0xc8 was used instead of the (right-shifted) C-bits only. Change-Id: I0fd8d7762e9cc3319a534f261e8857a1aa2220e0
2018-09-17l1sap/scheduler: Consistently print chan_nr as hex numberHarald Welte2-7/+7
It's very confusing if some log messages log chan_nr as decimal, while most log it as hexadecimal. Let's standardize on hex everywhere. Change-Id: Ia6566d5bbee8124fb7c689c962ce34d714208503
2018-09-16lc15: rewrite and refactor code to print hwversion descriptionPau Espin Pedrol4-35/+26
Also print a newline at the end of print_hwversion(). In the process of rewrite, fix several warnings in the few lines of this functions: osmo-bts/src/osmo-bts-litecell15/main.c: In function ‘print_hwversion’: osmo-bts/src/osmo-bts-litecell15/main.c:162:12: warning: passing argument 1 to restrict-qualified parameter aliases with argument 4 [-Wrestrict] snprintf(model_name, sizeof(model_name), "%s Rev %c", ^~~~~~~~~~ model_name, (char)rev); ~~~~~~~~~~ osmo-bts/src/osmo-bts-litecell15/main.c:168:12: warning: passing argument 1 to restrict-qualified parameter aliases with argument 4 [-Wrestrict] snprintf(model_name, sizeof(model_name), "%s (%05X)", ^~~~~~~~~~ model_name, model); ~~~~~~~~~~ osmo-bts/src/osmo-bts-litecell15/main.c:162:47: warning: ‘ Rev ’ directive output may be truncated writing 5 bytes into a region of size between 1 and 64 [-Wformat-truncation=] snprintf(model_name, sizeof(model_name), "%s Rev %c", ^~~~~ osmo-bts/src/osmo-bts-litecell15/main.c:162:3: note: ‘snprintf’ output between 7 and 70 bytes into a destination of size 64 snprintf(model_name, sizeof(model_name), "%s Rev %c", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ model_name, (char)rev); ~~~~~~~~~~~~~~~~~~~~~~ osmo-bts/src/osmo-bts-litecell15/main.c:168:47: warning: ‘ (’ directive output may be truncated writing 2 bytes into a region of size between 1 and 64 [-Wformat-truncation=] snprintf(model_name, sizeof(model_name), "%s (%05X)", ^~ osmo-bts/src/osmo-bts-litecell15/main.c:168:44: note: using the range [0, 4294967295] for directive argument snprintf(model_name, sizeof(model_name), "%s (%05X)", ^~~~~~~~~~~ osmo-bts/src/osmo-bts-litecell15/main.c:168:3: note: ‘snprintf’ output between 9 and 75 bytes into a destination of size 64 snprintf(model_name, sizeof(model_name), "%s (%05X)", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ model_name, model); ~~~~~~~~~~~~~~~~~~ Change-Id: I079b056a04fe77d2f7f361ff5899232cb70b5a93
2018-09-16lc15: fsync requires fd instead of file streamPau Espin Pedrol1-3/+3
Change-Id: I7efb7280363b3a021b30c3b4eacb3aab70e9c8da
2018-09-16lc15: vty: Add missing include for lchan_deactivatePau Espin Pedrol1-0/+1
Fixes following compilation warning: osmo-bts/src/osmo-bts-litecell15/lc15bts_vty.c:244:3: warning: implicit declaration of function ‘lchan_deactivate’ Change-Id: Id9b144d068d53393e1c1887aad285ae757156ec6
2018-09-16osmo-bts-trx/l1_if.c: cosmetic: fix typo in debug msgVadim Yanitskiy1-1/+1
There is a big difference between both L1 and L2 frames. In the first case, a TDMA frame is assumed, while a L2 frame is the result of decoding a few bursts (e.g. 4 for xCCH) arrived on a few TDMA frames. Anyway, the purpose of l1if_process_meas_res() is to handle measurements, not frames. Change-Id: Ic4362c2869e658c2f42664b4009a30e777f8048c
2018-09-14doc/examples/Makefile: Install bts-mgr cfg files used by systemd servicesPau Espin Pedrol1-2/+2
Change-Id: Iaf362da2a9ebd6829391637252812c2be93e9c60
2018-09-13measurement: fix unit-test test_lchan_meas_process_measurementPhilipp Maier3-5/+8
The unit test that tests lchan_meas_process_measurement() only inputs test data to lchan_meas_process_measurement() but it is not checked if the interval end could be detected or not. - Add a return code to lchan_meas_process_measurement() - Ensure that the return code is checked in the unit-test Change-Id: I9e00ce683e8c44528804f65181dbfed9e85e3aed Related: OS#2975
2018-09-13measurement: remove missed interval end detectionPhilipp Maier4-733/+2
The function is_meas_overdue() was introduced to allow lchan_meas_process_measurement() to detect when the end of a measurement interval has been missed. Interval ends may be missed when the SACCH block of the related measurement interval gets lost. This is due to the fact that the SACCH block is used as a trigger to start the measurement result computation. The idea behind is_meas_overdue() was to check the frame number of the current measurement against the frame number of the previous measurement in order to see if there was a measurement for SACCH in between or not. Unfortunately SACCH and TCH Voice data is not necessarly processed in order by each phy. Depending on the phy there may be a jitter between the timing of SACCH and TCH Voice. Depending on the phy this jitter may be enough to mess up the timing so that we see a SACCH block earlier than expected. So we can not use the current frame number of TCH Voice measurements to check for missed SACCH blocks. Change-Id: Idfdbf64c1f965f35c12559b3995e2b746c74ee9e Related: OS#3502 Related: OS#2975
2018-09-13cosmetic: fix typo in commentPhilipp Maier1-1/+1
Change-Id: I6a1147e2a3858475c99c99ceb33d7d416f3cac6c
2018-09-12Install sample cfg file to /etc/osmocomPau Espin Pedrol12-14/+20
Change cfg file names so they don't overlap when installing different osmo-bts versions, and make systemd services look for correct new name. Remove unneeded duplicated EXTRA_DIST files from root dir Makefile.am Change-Id: I75fdd06cc52ce50628efb1f9b007d2e3926db27d
2018-09-12Install systemd services with autotoolsPau Espin Pedrol14-25/+45
Change-Id: I87299134696bbfc6721b1226d4de6c73854aa846
2018-09-11fix handling of odd pchans in bts_supports_cm()Keith Whyte1-2/+11
Convert the if-cascade to a switch(). For any unexpected pchan kind, reject the chan mode immediately instead of going on to invoke gsm_bts_has_feature on feature = _NUM_BTS_FEAT, and log the error. Tweaked-by: neels Change-Id: Ieaded9258554b15fcc4b7f05d5a8847175b7962f
2018-09-11log: add error log for RSL Chan Mode ModifKeith Whyte1-1/+4
Add log context to chan_mode error in rsl_rx_mode_modif(). Tweaked-by: neels Change-Id: I945cf1ca8660ad5daf097edab1833bbc74b6185f
2018-09-11fix RSL Chan Mode Modif for dyn TSNeels Hofmeyr1-1/+1
Fix the chan mode checking for RSL Chan Mode Modif: do not reject all modes on dyn TS. In rsl_rx_mode_modif(), bts_supports_cm() should never be fed with dynamic pchan kinds (e.g. GSM_PCHAN_TCH_F_TCH_H_PDCH). Feed instead the return value of ts_pchan() that is to say, the actual pchan type (e.g. GSM_PCHAN_TCH_F). Change-Id: I7f0c835b25289931bccf96e982ea5564c8be4192
2018-09-09CBCH: Use llist_first_entry_or_null() instead of reinventing itHarald Welte1-4/+2
Change-Id: I376111e71d1c7be35a8fd7e392488adc34e21941
2018-09-09CBCH: Implement CBCH support for osmo-bts-{trx,virtual}Harald Welte6-2/+223
This patch adds scheduler support for the channel combinations that substitute SDCCH index 2 for a CBCH in either a SDCCH/8 or SDCCH/4. Change-Id: Icc15603079a1709ec094f400a9bcf0008211890f Closes: OS#1617
2018-09-09CBCH: Move processing via L1SAPHarald Welte5-15/+16
for some historical reason, CBCH handling was not using the normal L1SAP boundary. Let's change that and traverse L1SAP just like for e.g. BCCH which is quite similar to CBCH handling. This also has the added benefit of logging CBCH via GSMTAP. Change-Id: Ibdba4c5e808330f8406f441a97fe0e81170fce97 Closes: OS#3534
2018-09-09[sysmo,lc15]: Consider CBCH channel combinations in chan_nr_by_sapi()Harald Welte2-0/+8
Whenever a CBCH is used, this results in a new physical channel combination on the relevant timeslot. The chan_nr_by_sapi() function must handle those cbch-enabled PCHAN types. Change-Id: I963909bcec8392ec445d0bcf53a2a8d7d9535444
2018-09-09CBCH: Fix rejecting SMS-CB related RSL messagesHarald Welte1-2/+6
Normally, the "Common Channel" related RSL messages should actually contain such a common channel. However, since cell broadcast is implemented inside what's essentially a downlink SDCCH, we should add some explicit exceptions. Before this patch, any RSL SMS BC CMD would have been discarded and an RSL Error Indiciation returned. Change-Id: I2f7f1dd43505cc27cd33489d8b0e8c981cd93880 Closes: OS#3533
2018-09-06Move systemd service to contrib/systemdPau Espin Pedrol4-30/+32
Move it there and have only a symlink in debian/, like we do in all other projects. Change-Id: I213d3816a66e88069c31f85b3fbf462d1222aa43
2018-09-06measurement: display fn_mod when measuremnet is addedPhilipp Maier1-7/+32
When adding a new measurement also log the frame number by the modulus of the measurement interval to simplify debuggung Change-Id: I77a4d947dab32de0d5717ebf13bd8de6179dfe6a
2018-08-31paging: add unit-test to check different bs_ag_blks_res settingsPhilipp Maier4-3/+91
The parameter bs_ag_blks_res, which is loaded into the BTS via the SI3 setting, defines how many of the CCCH blocks shall be used for AGCH. The remaining CCCH blocks will then be available as PCH for paging. Unfortunately there is no unit-test yet that verifies that all of the 8 different settings for bs_ag_blks_res. - Separate the the decision logic that checks if a given fn is part of an AGCH into a function to have it available in the unit-test. - Add a test that checks all possible bs_ag_blks_res settings. Change-Id: Ib9652f4013a4da3766852f8f03ce9ec5590f6989 Related: OS#1575
2018-08-30measurement: add SUB measurements in test_lchan_meas_process_measurementPhilipp Maier2-417/+66
The unit-test function test_lchan_meas_process_measurement() does not tag measurements as SUB. Lets make the test function more realistic by setting the is_sub flag at the correct positions. - Add SUB-Measurements in the correct position - Print log lines when adding measurements for sub, also fix minor bugs in the log printing. Change-Id: I25c361b21a406c0017ee586f0492c38f2e737e57 Related: OS#3502 Related: OS#2975
2018-08-30measurement: substitue missing measurementsPhilipp Maier4-96/+859
At the moment the measurement calculation of osmo-bts works by collecting the measurement reports the phy emits during a measurement interval. Normally one would expect a well defind fixed number here, but some phys will not emit a measurement report for lost blocks. Also blocks and their reports may get lost because of cpu overload etc. The computation that is executed at the end of the measurement interval computes over all received measurement. This evenutally means that missing measurements will not taken into account and the result will look better than it is in reality. To fix this, the interval must be of a defined size and in cases where less measurements as expected were collected, the algorithm must assume they have been received with a 100%BER and take that into account. However, all RSSI and TA/TOA related computations should continue to rely on actual measurement data. - make sure the algorithm works over a fixed interval - replace missing measurements with 100%BER - fix and extend unit-tests Change-Id: Idd30fc07603ad7d042c1fb416e247c3bf7d35c8b Related: OS#2987
2018-08-29cosmetic: test_is_meas_overdue() does not test is_meas_complete()Philipp Maier2-2/+2
The function is_meas_overdue() does not use is_meas_complete() anymore and therefore the related log output is wrong. Lets correct this. Change-Id: I9b7aa2f7a7c75bc3eed0c94b6ef9d17e7e36ce96 Related: OS#2975
2018-08-29cosmetic: rename *_meas_rep_fn10* to *_meas_rep_fn10*_by_*sPhilipp Maier1-16/+16
The lookup table that control the measurement interval endings do not make clear what their indexes refer to. Lets give them more distinct names. rename sdcch8_meas_rep_fn102 to sdcch8_meas_rep_fn102_by_ss rename sdcch4_meas_rep_fn102 to sdcch4_meas_rep_fn102_by_ss rename tchf_meas_rep_fn104 to tchf_meas_rep_fn104_by_ts rename tchh0_meas_rep_fn104 to tchh0_meas_rep_fn104_by_ts rename tchh1_meas_rep_fn104 to tchh1_meas_rep_fn104_by_ts Change-Id: I3dc891e1860109f803c1bfa46445e8fef35586d9 Related: OS#2975