aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc
AgeCommit message (Collapse)AuthorFilesLines
42 hoursabis_rsl: check if emergency calling is disabled before premptionPhilipp Maier1-10/+11
If an emergency call arrives at the BSC while all TCH are busy, one TCH is cleared in favor of the emergency call. However, if emergency calls are disabled (system information), it is still possible that an MS might try an emergency call anyway or that due to interference a regular call might look like an emergency call (channel request reason). In those cases the preemption must not happen and the emergency call must be rejected. Change-Id: I1af1f4fefcbe6a886bb5396901ce0cb2368a0e19 Related: OS#4976
6 daysbsc_vty: fix acch_repetition ber threshold stringsPhilipp Maier1-7/+8
When setting the BER threshold for ACCH repetition the VTY displays wrong threshold values in the online help. Change-Id: I4c89ad130da328aba99663e5a2931a4007772bca Related: SYS#5114
9 dayshodec2: fix congestion balancing on dyn TSneels/hodecNeels Hofmeyr1-17/+102
When balancing congestion, not only look at TCH/F or TCH/H separately, but also to take into account the effects on the other TCH kind from using/freeing dynamic TS. Related: OS#5298 Change-Id: I433df6f343650f9056b1bab926bc19ac1d867ad5
9 dayslchan_avail(): omit logging for handover decision 2Neels Hofmeyr3-22/+24
Add bool log argument to lchan_avail_by_type() and omit logging when passed as false. From handover_decision_2.c, pass 'log' as false, from all other callers pass true, i.e. for unchanged behavior. Rationale: Usually, we use lchan_avail_by_type() to select a new lchan to initiate actual service. For that, it is interesting to see how osmo-bsc decides which lchan will be used. For handover decision 2, we since recently call lchan_avail_by_type() for each and every handover candidate, to determine whether it will occupy a dynamic timeslot or not (to know whether we would congest the other TCH kind). So this happens for each permutation of source lchan and target cell. That produces a lot of logging, out of proportion of being useful to the maintainer. Change-Id: Ia403f8fc853ca9ea9e81f7a7395df6b23845ebed
9 dayshodec2: fix congestion resolution on dyn TSNeels Hofmeyr1-2/+28
For handover algorithm 2, properly figure out what effects the target cell will see for the *other* TCH kind when a handover would occupy a dynamic timeslot. Before this, only TCH/F or TCH/H would be regarded at a time. This introduces detection of whether a dynamic timeslot would be occupied by a handover, and how losing one unused dynamic timeslot affects the congestion situation for the TCH kind that is not targeted by the handover. In other words, if a handover to TCH/F causes congestion in TCH/H because of a dynamic timeslot becoming occupied, the handover will not be performed. Before this, oscillation situations could occur. A subsequent patch will do the same for congestion balancing. Related: SYS#5297 Change-Id: I1536b60f03cb0aeb6ba14a72b518aec82fa572fe
10 daysstats: Add granularity to SDCCH/TCH/LU activity.Michael Iedema4-1/+108
Change-Id: I4df275e4770c5ff3643c79ba828e736986f8bb47
13 daysgsm_data: return early if MS Power class remains the sameVadim Yanitskiy1-0/+5
The following message makes no sense: DRLL DEBUG gsm_data.c:844 MS Power class update: 4 -> 4 because nothing really changed, MS Power class remains 4. Neither it makes sense to call lchan_update_ms_power_ctrl_level(). Change-Id: I519d2d1575cbb5352cc381a60513db8e0e2cb0a0
14 daysvty: fix 'codec-list' command: check all given arguments firstVadim Yanitskiy1-8/+11
Allocating a new list of supported codecs *before* checking the command arguments is a bad idea. The operator may simply mistype one of the codecs and will end up with a list of NULL pointers. The functions calling audio_support_to_gsm88() assume that this list always does contain valid pointers, so if a new subscriber connection gets established, or the operator simply invokes 'show running-config', osmo-bsc would crash due to NULL pointer dereference. Steps to reproduce: 1. In the VTY, do: 'en' -> 'configure terminal' -> 'msc'; 2. Configure any invalid codec list, e.g. 'codec-list Boom!'; 3. Invoke 'show running-config', boom! Let's check the input before changing the internal structures. Change-Id: I35b740a39c9cf3716d286e717486ef505bc61522 Fixes: OS#4946
14 dayspower_control: fix: properly initialize per-lchan BS powerVadim Yanitskiy1-9/+6
My assumption that lchan_reset() is called on CHANnel ACTIVation was wrong - it's actually called on CHANnel RELease. Therefore (re)setting per-lchan BS power value must be done in the other function that is responsible for channel activation. Change-Id: I056c448ce017458dc4a004374ddca86d44dc35b4 Related: SYS#4918
2021-01-14vty: fix writing empty IP address for unconfigured NSVCsVadim Yanitskiy1-13/+9
config_write_bts_gprs() currently writes the remote address of an NSVC even if osmo_sockaddr_str_from_sockaddr() returns non-zero code. Thus saving a configuration with only one configured NSVC to a file would produce the following: bts N ... gprs nsvc 0 nsvci 101 gprs nsvc 0 local udp port 23023 gprs nsvc 0 remote ip 127.0.0.1 gprs nsvc 0 remote udp port 23000 gprs nsvc 1 nsvci 0 gprs nsvc 1 local udp port 0 gprs nsvc 1 remote ip and next time osmo-bsc would refuse to start due to: Error occurred during reading the below line: gprs nsvc 1 remote ip The related condition consists of the following two parts: - checking if osmo_sockaddr_str_from_sockaddr() != 0; - checking if 'remote.af != AF_UNSPEC'. The first one is wrong, because osmo_sockaddr_str_from_sockaddr(), like many other functions, returns 0 on success. Let's fix this. After the fix, the second part does not seem to make sense, because remote.af would remain AF_UNSPEC (0) if the function call succeeds. Printing the remote port alone does not make sense, let's avoid printing it if the address cannot be parsed into a string. Change-Id: I5d6cbde4f605c8184db4ade87de5644a849c05db Fixes: I621360cab1e12c22248e33d62a9929995053ce04
2021-01-14vty: use 'const' for *nsvc in config_write_bts_gprs()Vadim Yanitskiy1-2/+1
Change-Id: I869944cc692c7954b2862ecff32c6034d20babef
2021-01-14hodec2: to balance congestion, use overload percentNeels Hofmeyr1-8/+37
For balancing load across congested cells and across congested TCH/* kinds, instead of comparing the number of lchans above the configured congestion threshold, compare the percent of lchans of overload. In short, using a percentage prevents cells with less min-free-slots to fill up 100% while neighbor cells still may have several free lchans available. An obvious example of why this is desirable is illustrated by test_balance_congestion_by_percentage.ho_vty: Cell A has min-free-slots 2, and has all slots occupied. Cell B has min-free-slots 4, and has 2 slots remaining free. If we count congested lchans as in current master: cell A has a congestion count of 2: two more lchans in use than "allowed". If we move one lchan over to cell B, it ends up with a congestion count of 3, which is worse than 2. So when counting lchans, we decide that cell A should remain full. Instead, when comparing percentage of remaining lchans, we would see that cell A is loaded 100% above congestion (2 of 2 remaining lchans in use), but when moving one lchan to cell B, that would only be 75% loaded above its treshold (3 of 4 remaining lchans in use). So a percentage comparison would cause a handover to cell B. Related: SYS#5259 Change-Id: I55234c6c99eb02ceee52be0d7388bea14304930f
2021-01-13Introduce Neighbor Resolution ServicePau Espin Pedrol5-2/+213
This new CTRL interface allows users of this BSC (such as attached PCU) to gather neighbor information. This interface is needed for PCU to translate ARFCN+BSIC keys provided by MS in the Um side into CGI + RAC keys used to identify target cells in RIM procedures against SGSNs on the Gb interface. This patch extends the already existing neighbor information storage in the VTY by allowing storage of CGI + RAC (RAC couldn't be stored beforehand). Related: SYS#4909 Depends: libosmocore.git Change-Id If48f412c32e8e5a3e604a78d12b74787a4786374 Change-Id: Ib07c9d23026332a207d4b7a0f7b4e76c0094e379
2021-01-12hodec2: fix congestion oscillation bugNeels Hofmeyr1-6/+9
When evenly distributing congestion across cells, count the number of occupied lchans surpassing congestion, and not the overall number of free lchans -- which disregards congestion thresholds. Fix the bugs shown by test_congestion_no_oscillation.ho_vty test_balance_congestion_tchf_tchh.ho_vty This implements a simple calculation for congestion load by counting lchans in use above congestion. An improvement of this calculation using percent follows in I55234c6c99eb02ceee52be0d7388bea14304930f. Related: SYS#5259 Change-Id: Icb373dc6bfc9819446db5e96f71921781fe2026d
2021-01-12hodec2: add ho_candidate.{current,target}.free_tchNeels Hofmeyr1-32/+46
Store the number of free lchans and the min-free-slots settings in ho_candidate, instead of figuring those out in various places, to make it easier to read. Prepare for upcoming patch which also requires these values to fix a bug. Change-Id: Ie6ca5af5e8d0ebb8deaaaa637e2728008ecba517
2021-01-12hodec2: reduce check_requirements() argsNeels Hofmeyr1-83/+82
Instead of passing single args, pass the ho_candidate struct. No functional change. Change-Id: I086aef9cc47ad8a5376f18179024c486f6f8b779
2021-01-12hodec2: cosmetic: clarify ho_candidate.{current,target}Neels Hofmeyr1-97/+107
So far it is often confusing which cell a specific member refers to. Clarify lchan, bts, ... to current.lchan, target.bts, ... Also move the rxlev_{current,target} to {current,target}.rxlev. Eliminate numerous local variables to make it easier to read which side is being used (e.g. "c->target.bts" instead of just "bts"). No functional change. Change-Id: I06898eb745a5be548df0b76fa760ce790cfab3ed
2021-01-12power_control: add increase / reduce step size recommendationsVadim Yanitskiy1-3/+21
Change-Id: I82e762c0c2b5e0dd739850ee494ab0a798e353de Related: SYS#4918
2021-01-11hodec2: fix candidate choices in congestion checkNeels Hofmeyr1-130/+59
Fix flaws in picking a candidate for congestion resolution, shown in recently added tests. - For TCH/H->TCH/F upgrading, do not favor moving to a weaker neighbor cell. - When comparing dynamic timeslots on the same cell, favor a dynamic timeslot that frees an entire dyn TS even though the target rxlev differs. Do not separate the passes for inter-cell and intra-cell candidates: before, the inter-cell pass would already pick a candidate and start handover, even though the subsequent intra-cell pass would have revealed a better candidate. Join the intra-cell considerations into pick_better_lchan_to_move(). The intra-cell pass was separate, because it would find the *weakest* current rxlev, to give a TCH/H to TCH/F upgrade to the currently weakest lchan. Instead of the separate pass for weakest rxlev, in addition to the target cell's rxlev, also consider the rxlev *change* in pick_better_lchan_to_move(): For candidates that do not change the rxlev (usually those that stay in the same cell) and that upgrade to TCH/F, favor a candidate with weaker current rxlev. Completely revisit the conditions in pick_better_lchan_to_move() to yield the desired prioritization of candidate preferences. In three handover tests, remove the "FAIL" comments and adjust to now expect the actually desired behavior. Related: SYS#5032 Change-Id: I2704899c85c35dfd4eba43468452483f40016ca2
2021-01-05hodec2: cosmetic: clarify afs_bias, simplify pick_better_lchan_to_move()Neels Hofmeyr1-50/+36
Instead of passing the TCH/H -> TCH/F bias (AFS bias) in local variables, rather store it in the ho_candidate struct next to the other rxlev related values. Add the AFS bias to the compared rxlev in pick_better_lchan_to_move(). Modify pick_better_lchan_to_move() to simpler semantics of returning either a or b. No functional change. Change-Id: I73860abdf2a77270ca4851ad58c09767d1bb08f1
2021-01-05hodec2: clarify current and target rxlev per candidateNeels Hofmeyr1-48/+51
Store the rxlev of the current lchan and the target BTS in the ho_candidate, to clarify the code. No functional change, cosmetically prepare for I2704899c85c35dfd4eba43468452483f40016ca2. Change-Id: Ie6c165e17bb3c99eebc967a6bb02529db8bdfc98
2021-01-05hodec2: code dup / cosmeticsNeels Hofmeyr1-194/+133
In handover_decision_2.c, instead of repeating a similar loop four times, put that loop in a function and parameterize it. Prepare for a fix of two problems in handover decision 2, see I2704899c85c35dfd4eba43468452483f40016ca2. Change-Id: I7c32d08e490a88a7f044b0a71dc4b07d748dd572
2021-01-05hodec2: cosmetic: add dBm unit to rxval loggingNeels Hofmeyr1-7/+7
Change-Id: I58a5ae721b674576339360b1f03e91b015a1bf46
2021-01-05ericsson_rbs2000: fix unreachable code in inp_sig_cb()Vadim Yanitskiy1-1/+0
Change-Id: I20674945ddb80ceb1a1917e1be8572595764b370 Fixes: CID#215885
2021-01-04smscb: Fix adding of SMSCB messages when no message with lower period existsHarald Welte1-0/+2
Adding SMSCB messages to a BTS so far only worked if there were existing messages with a lower scheduling period than the new message. Before this patch, it fails for new messages if they are of equal or lower scheduling period than the existing messages. Change-Id: I69a05b22200b3a1ee406b0673553e135603d723b
2021-01-04vty: fix wrong attributes for UL/DL ACCH repetition commandsVadim Yanitskiy1-39/+42
None of those commands apply immediately, they only affect newly established logical channels. The reason is that the related IEs are only getting sent on channel activation / assignment. Change-Id: I06c7851115fb31d1eb92c400d9724f4f051bd171 Related: SYS#5114
2021-01-04vty: join UL/DL SACCH repetition commands togetherVadim Yanitskiy1-45/+20
Both commands are basically doing the same thing, so we can merge them into a single command by adding a parameter to the command string. The VTY syntax remains the same: do-something foo do-something bar becomes: do-something (foo|bar) This change reduces code duplication. Change-Id: Ibe98718d8f4933926eed0e622109c9c82537f526 Related: SYS#5114
2021-01-03power_control: vty: do not print 'no (rxlev-avg|rxqual-avg)'Vadim Yanitskiy1-1/+1
Presence of these lines in the config file does not necessarily mean that the BTS will not perform measurement pre-processing. It actually means that the BSC would not include the optional IEs related to the measurement pre-processing, so the BTS may still apply its default averaging algorythm with default parameters. In order to avoid potential confusion, let's avoid printing them. Change-Id: I585b5bf4fde93d66e47666e0fa9903f21a268b51 Related: SYS#4918
2021-01-03smscb: Avoid scheduler array overflowHarald Welte1-1/+4
This fixes the following heap overflow in the SMSCB scheduler: ==109051==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60d00003a9a0 at pc 0x55d77e4bedf1 bp 0x7fff8cdc4240 sp 0x7fff8cdc4238 READ of size 8 at 0x60d00003a9a0 thread T0 #0 0x55d77e4bedf0 in bts_smscb_sched_add_before /space/home/laforge/projects/git/osmo-bsc/src/osmo-bsc/cbch_scheduler.c:64 Change-Id: If529aa905336a1b9e7a36e931c165df0ba9899ad
2021-01-02abis_om2000: Handle DP object in get_om2k_mo()Harald Welte1-0/+3
This was somehow forgotten for the DP MO... Change-Id: Ie2ef736eb712e01a3c657ae30c8422c9aa32062a
2021-01-02om2000: Add "show bts 0 om2k-mo" commandHarald Welte1-0/+72
Change-Id: Ib81c717bf29aa29c8ac634a959abd12accd1046e
2021-01-02abis_om2000: keep OM2K FSMs around, don't terminateHarald Welte2-73/+221
The existing code uses short-lived FSMs which are allocated straight before START, and which are free'd after DONE state is reached. While that works, it makes state introspection a bit hard, as one cannot show the FSM states, etc. Let's change to a different model where the per-OM2k-MO FSMs are always around (in state INIT after object creation). While at it, also introduce a RESET event that can reset each FSM instance back to INIT state, i.e. in case of OML link failure. Change-Id: Ia37cffff5c451e1d79a52ccae41ab5718b4661d4
2020-12-30vty: fix NULL-pointer dereference in cfg_bts_rep_dl_facch()Vadim Yanitskiy1-1/+1
There is only one parameter in command: repeat dl-facch (command|all) so indeed argv[0] must be used instead of argv[1]. Change-Id: I01efff109a33791e13b0149fc47c792d3266da71 Related: SYS#5114
2020-12-29power_control: vty: some commands are not vendor specificVadim Yanitskiy1-2/+0
Change-Id: I43cad92ea50f819ee56101d131d0060c2f8e174f Related: SYS#4918
2020-12-29abis_om2000: Mark om2k_mo_fsm_start() as staticHarald Welte1-3/+2
It's not used anywhere outside of the source file Change-Id: If9ebf07ac662607826270df0b0966c8dd5026f1c
2020-12-29[cosmetic] abis_om2000: Re-format to use longer linesHarald Welte1-188/+97
For several years now we are using line lengths longer than 80chars, let's re-format this code more in-line with our new style. Change-Id: I8143280358c0e23ca7e32b882e952eac991e105b
2020-12-29abis_om2000: make om2k_mo_name() an exported functionHarald Welte1-20/+20
Change-Id: Idb05bcad8059ab2b2be6c7057495d0279a4b62c7
2020-12-29Add a bts_model->bts_init() and trx_init() call-back functionHarald Welte2-0/+20
This allows a given BTS model driver to initialize data structures specific cor this BTS instance (or a TRX for this BTS instance). Change-Id: Icbad9cdc12221c9ad997267d77e5414edcbac538
2020-12-29power_control: enable dynamic MS power control for osmo-btsVadim Yanitskiy2-2/+5
Before the recent changes, the MS Power Parameters IE would always be included empty in RSL CHANnel ACTIVation messages iff the BTS type is 'osmo-bts'. Then this behavior was changed, so the user would need to enable dynamic power control explicitly. This is a regression, let's revert it back to the old behaviour. Change-Id: Idb453fc894584ccf4f5f8b45a24421db958e9478 Related: SYS#4918
2020-12-27power_control: fix swapped lower/upper RxQual threshold valuesVadim Yanitskiy2-7/+8
According to 3GPP TS 45.008, section A.3.2.1: c) Comparison of RXQUAL_XX with L_RXQUAL_XX_P (XX = DL or UL): Increase XX_TXPWR if at least P3 averaged values out of N3 averaged values are greater (worse quality) than L_RXQUAL_XX_P. d) Comparison of RXQUAL_XX with U_RXQUAL_XX_P (XX = DL or UL): Decrease XX_TXPWR if at least P4 averaged values out of N4 averaged values are lower (better quality) than U_RXQUAL_XX_P. Given that RxQual is a value in range 0 .. 7, where 0 is the best and 7 is the worst: L_RXQUAL_XX_P must define the worst quality, while U_RXQUAL_XX_P must define the best quality value. Change-Id: I0f37b23ed360782f3c1f4275234c4e18a17aa89b Related: SYS#4918
2020-12-25power_control: encoding of H_REQAVE and H_REQT for ip.accessVadim Yanitskiy1-2/+2
Change-Id: I761401d13b72e8f7c07f3a4ed5002dffc735a210 Related: SYS#4918
2020-12-23vty: cosmetic: make all 'struct cmd_node' definitions staticVadim Yanitskiy1-5/+5
Change-Id: I7bc8fcb53aef8dbee120e8a6457d8ce4227c7698
2020-12-23power_control: reflect MS/BS Power difference in the VTY promptVadim Yanitskiy1-1/+9
Change-Id: I66d414a5f761eeec042a47207fc7d295e073cd10 Related: SYS#4918
2020-12-22power_control: add VTY command to set static / maximum BS PowerVadim Yanitskiy3-0/+52
Change-Id: I11ca856aba46aaf84d94cbbdf4c39a01ee8289b9 Related: SYS#4918
2020-12-22power_control: add VTY command for re-sending default parametersVadim Yanitskiy1-2/+37
Change-Id: I35e9147d5536f9901ac63f605d87ae112c024401 Related: SYS#4918
2020-12-22power_control: add VTY commands for per-BTS configurationVadim Yanitskiy2-0/+470
Change-Id: Ifd6ea29c3b9dbaccf92856131d5fb2e352b84eb2 Related: SYS#4918
2020-12-21OM2K: Skip the entire CON MO if there are no connection groupsHarald Welte1-5/+10
If the user doesn't specify any CON connection groups in the config file, then the CON is not used. The current code runs into an error condition, as abis_om2k_tx_con_conf_req() never sends the CON CONF REQ if the groups list is empty, but we still wait in the FSM for the arrival of a CFG REQ ACCEPT. The CON FSM eventually times out in T10 and we proceed with the IS, ignoring the error. With this patch, we simply skip the entire CON MO in case there is no related configuration. Change-Id: Ia4d5bd96734686381f04aa3b380b17a161a31174
2020-12-21OM2K: Permit transition from WAIT_CONF_RES -> WAIT_ENABLE_ACCEPTHarald Welte1-1/+2
This is how the DP MO FSM is doing, so let's permit it. Change-Id: I9df44f840a2818ebc877453c74bde127dce9b3e9
2020-12-21abis_om2000: Force TRX NM state to UNLOCKED once TRX is upHarald Welte1-0/+5
In I68ae0bc51a565f903b47cf72f3e3dd6f1a2d2651 we started to initialize all (TS 12.21) NM MO state to LOCKED by default, which means BTSs not using TS 12.21 are stumbling across a general check in bts_isdn_sign_link() and will fail to process and uplink RSL messages. Change-Id: I4450cc47ede4005bf4bbd4af8d5a22c78377d4cd Related: OSE4914
2020-12-19power_control: make use of MS/BS parameters in RSL messagesVadim Yanitskiy1-17/+52
Change-Id: I586b1c9e16390757b015c2871a36abc3975e0fc4 Related: SYS#4918