aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/bsc_init.c
AgeCommit message (Collapse)AuthorFilesLines
2021-05-04stats: add BTS uptime counterMichael Iedema1-0/+16
Change-Id: Ib17674bbe95e828cebff12de9e0b30f06447ef6c
2021-04-23Revert "update neighbor ARFCNs on startup and config changes"Pau Espin Pedrol1-12/+0
This patch caused major breakage in my setup, with BSC printing at startup: "(bts=0,trx=0) Failed to generate System Information". And bts-trx printing all the time: "sysinfo.c:162 PH-RTS-IND: Unable to determine actual BS_AG_BLKS_RES value as SI3 is not available yet, fallback to 1" This reverts commit c1a5310a3ed75ff24dc2d6a48c09d8dfc89d944c. Change-Id: I5da365c93aedc6668a77b82ee9b68cbec64967e3
2021-04-22update neighbor ARFCNs on startup and config changesNeels Hofmeyr1-0/+12
The effects of the neighbor configuration depend on the LAC, Cell Identity, ARFCN, BSIC configuration of neighbor cells. Make sure that the neighbor ARFCN list in the System Information is updated. This may seem rather aggressive: updating the SI of all BTS if only one config item changed. But indeed even modifying one config item of one BTS may cause a change in the neighbor relations that many other BTS may have to the changed BTS. For example, if many BTS configure a 'neighbor lac-ci 42 23', and this cell's config changes to LAC 43, all of those other BTS need to update their neighbor ARFCNs. Also update the system information even before the BTS are connected and started up. The main benefit here is that the VTY 'show bts N' command then already lists the correct neighbor ARFCNs. In gsm_bts_trx_set_system_infos(), make sure that the updated SI is only sent to TRXes that are actually usable, otherwise abis_rsl_sendmsg() spams the log with complaints that a message's dst == NULL. Still return an error rc in case a TRX is not connected, so that the CTRL command bts.N.send-new-system-informations accurately returns whether SI were actually sent to all TRXes. The desire to have the ARFCNs listed in the VTY before starting up BTSes came during analysis for Ifb54d9a91e9bca032c721f12c873c6216733e7b1, which fixes a bug that is now much easier to verify being fixed. Change-Id: I2222e029fc225152e124ed1e8887f1ffd4a107ef
2021-03-24fix/refactor neighbor configNeels Hofmeyr1-1/+0
The neighbor configuration storage is fundamentally broken: it requires all local cells to be configured before being able to list them as neighbors of each other. Upon config write-back, the neighbor config however is placed back inline with the other config, and hence a written-out neighbor config no longer works on program restart. The cause of this problem is that the config is stored as explicit pointers between local cells (struct gsm_bts), which of course requires the pointer to exist before being able to reference it. Instead, store the actual configuration that the user entered as-is, without pointers or references to objects that need to be ready. Resolve the neighbors every time a neighbor is needed. Hence the user may enter any config at any place in the config file, even non-working config (like a BTS number that doesn't exist), and the relation to actual local or remote neighbor cells is made at runtime. Abort program startup if the initial neighbor configuration contains errors. Related: OS#5018 Change-Id: I9ed992f8bfff888b3933733c0576f92d50f2625b
2020-10-09LCS: implement the bulk of Location ServicesNeels Hofmeyr1-0/+1
Depends: I4d7302a4853518916b6b425e710c10568eb2ffe5 (libosmocore) Change-Id: I28314ba97df86a118497e9b2770e2e6e2484e872
2020-08-29CBSP: add local bind to client modeNeels Hofmeyr1-0/+1
Add the ability to set a local bind address for the CBSP client mode. Change-Id: I56a420d204a9a487b27dd460f4cc52e0b4093d69
2020-08-29CBSP: rewrite the CBSP link setup and 'cbc' VTY sectionNeels Hofmeyr1-5/+5
Firstly, make CBSP server and client mutually exclusive: Do not allow osmo-bsc to be configured as CBC client *and* CBC server at the same time. cbsp_link.c expects at most one CBSP link to be established, and, upon sending CBSP messages, probes whether to send the message to a CBSP server or client link. When both listen-port and remote-ip are configured (regardless of an actual CBSP connection), osmo-bsc gets confused about where to send CBSP messages. One solution would be more accurate probing for an actual established TCP connection. But the simpler and less confusing solution is to force the user to configure only server or only client mode, never both. Introduce 'cbc' / 'mode (server|client|disabled)'. Secondly, clarify the 'cbc' config structure into distinct 'server' and 'client' subnodes. Refactor the 'cbc' VTY node in such a way that the IP addresses for server and client mode can remain configured when the CBSP link is switched between server/client/disabled modes. To implement the above, switch the struct bsc_cbc_link to use osmo_sockaddr_str for address configuration. Related: OS#4702 Related: I7eea0dd39de50ed80af79e0f10c836b8685d8644 (osmo-ttcn3-hacks) Related: I9e9760121265b3661f1c179610e975cf7a0873f1 (docker-playground) Change-Id: Icaa2775cc20a99227dabe38a775ff808b374cf98
2020-08-24Add bts counters to count BTS events where we don't have a btsDaniel Willmann1-11/+23
In some (error-) cases we might be unable to determine which BTS to use when counting handover events. We don't want to loose these events because then ctr(bsc) == sum(ctr(bsc->bts)) would not be true anymore. Those events are now counted by a counter in struct gsm_network which uses an index that is out of range for regular BTS (65536). Change-Id: Ic0f3edd5dc014c4eac5e8423133633a3e5d4c13e Related: SYS#4877
2020-07-18Move gsm_bts_{trx_}set_system_infos APIs to bts{_trx}.*Pau Espin Pedrol1-149/+0
Change-Id: I2aa83b499d6e5d06a0fa1001fee3111f7e639c94
2020-07-18Move struct gsm_bts: gsm_data.* => bts.*Pau Espin Pedrol1-18/+1
Place all code related to the object into the related file. Having all the data model in one file made sense in early stage of development to make progress quickly, but nowadays it hurts more than helps, due to constantly growing size and more and more bits being added to the model, gaining in complexity. Currently, having lots of different objects mixed up in gsm_data.h is a hole of despair, where nobody can make any sense were to properly put new stuff in, ending up with functions related to same object in different files or with wrong prefixes, declarations of non-existing functions, etc. because people cannot make up their mind on strict relation to objects in the data model. Splitting them in files really helps finding code operating on a specific object and helping with logically splitting in the future. Change-Id: I00c15f5285b5c1a0109279b7ab192d5467a04ece
2020-05-31bsc_bts_alloc_register(): fix possible NULL-pointer dereferenceVadim Yanitskiy1-0/+1
Change-Id: I4560a7037a0a016636c4626c9fb3ceddfe98058e
2020-05-29flatten: move network->bsc_data->* to network->*Neels Hofmeyr1-14/+8
The separate struct osmo_bsc_data is like another separate struct gsm_network for no reason. It is labeled "per-BSC data". These days, all of this is a single BSC and there will not be different sets of osmo_bsc_data. Drop struct osmo_bsc_data, move its members directly into gsm_network. Some places tested 'if (net->bsc_data)', which is always true. Modify those cases to rather do checks like 'if (net->rf_ctrl)', which are also always true AFAICT, to keep as much unmodified logic as possible in this patch. Change-Id: Ic7ae65e3b36e6e4b279eb01ad594f1226b5929e0
2020-05-09stats: report a number of configured BTS to a stats gauge.Alexander Chemeris1-0/+18
It's useful to know how many BTS are actually configured to compare it to a number of connected BTS's. Change-Id: I41cb60f9cb962003227e4a7b63db05acbcdb6f4c
2019-09-02Cell Broadcast: CBSP and CBCH scheduling supportHarald Welte1-0/+15
This adds code to handle CBSP (Cell Broadcast Service Protocol) from the CBC (Cell Broadcast Centre), as well as BSC-internal data structures for scheduling the various SMSCB on the CBCH of each BTS. There are currently one known shortcoming in the code: We don't yet verify if keepalives are received within repetition period. Change-Id: Ia0a0de862a104d0f447a5d6e56c7c83981b825c7
2018-12-14Add VTY option to avoid sending empty Full BCCH Info for disabled SIPau Espin Pedrol1-6/+10
According to 3GPP TS 08.58 ยง8.5.1 BCCH INFORMATION: "If the Full BCCH information element is not included this indicates that transmission of the indicated SYSTEM INFORMATION message shall be stopped." However, some ipaccess nanoBTS firmware versions are known to not support some SI elements and also to dislike receiving BCCH Information for those SI, even if received with empty BCCH Information meaning they should not be used. Upon receival of this kind of message, nanoBTS sends a Failure Report with following text: Type=processing failure, Severity=critical failure, Probable cause=Manufacturer specific values: Fatal software error, Additional Text=l2_bch.c:1149 **** ** l2_bch.c#1149:BCHbcchSItypeValid( prim_p->infoType ) ** IPA_SW_FATAL_ERROR ** In task "TRX Proc:L2_BCH" @ (325). **** This kind of issue only appears with some fw versions, since it's known to work fine in other ones, so let's not disable this kind of mesage by default on all BTs of type "nanobts". Instead, add a VTY command that allows disabling this kind of message in order to be able to operate those nanoBTS units. Fixes: OS#3707 Change-Id: Idec1daabc21de4eea5c55edd1dbb0e0775720fc7
2018-10-30vty: add 'show rejected-bts'Oliver Smith1-0/+1
Print IDs and IPs of recently rejected BTS devices. Example output: OsmoBSC> show rejected-bts Date Site ID BTS ID IP ------------------- ------- ------ --------------- 2018-10-25 09:36:28 1234 0 192.168.1.37 Related: OS#2841 Change-Id: Iba3bfe8fc9432b7ae8f819df8bd71b35b3ec507e
2018-07-28rename gsm_04_08_utils.[hc] to gsm_04_08_rrNeels Hofmeyr1-1/+1
"utils" suggests thin helpers to aid using a proper API, while this .c file actually *is* the proper RR API. Rename from "utils" to "rr". Change-Id: I0ffff63d57f03cb324df8e40e41caea5b55a2c85
2018-07-28fix / clarify rsl dtap cacheNeels Hofmeyr1-0/+1
In certain situations like handover or assignment, DTAP must not go out via RSL directly but is cached to be submitted later. Make sure that all RSL DTAP sending adheres to this: gscon_submit_rsl_dtap() is the new "public" API to request an RSL DTAP to be sent. Depending on the gscon's state, this ends up in the cache or is sent directly. When caching, there is no way to tell whether sending will succeed or not, so semantically it does not make sense to even return a result code. Just return void. Change all "public" callers to gscon_submit_rsl_dtap(). Merge gsm0808_submit_dtap() and submit_dtap() guts to gsm0808_send_rsl_dtap(), static in bsc_subscr_conn_fsm.c: directly send DTAP, assume a conn->lchan to be present, or otherwise trigger a BSSMAP Clear Request. The static submit_dtap() becomes a thin convenience wrapper. Move ho_dtap_cache* functions to bsc_subscr_conn_fsm.c and rename to gscon_dtap_cache_* -- they are not only for handover, also for assignment. Function gsm0808_submit_dtap() m Introduce function gscon_submit_rsl_dtap() Change-Id: I6ffd7aa641c8905292c769400048c96aa0949585
2018-07-28inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cellsNeels Hofmeyr1-0/+1
Depends: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd (libosmocore) Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf
2018-06-07dissolve libbsc: move all to src/osmo-bsc, link .o filesNeels Hofmeyr1-0/+288
Move all of libbsc/ into osmo-bsc/, and separate/move some implementations to allow linking from utils/* and ipaccess/* without pulling in unccessary dependencies. Some utilities use gsm_network and gsm_bts structs, which already include data structures for fairly advanced uses. Move initialization that only osmo-bsc needs into new bsc_network_init() and bsc_bts_alloc_register() functions, so that the leaner tools can use the old gsm_* versions without the need to link everything (e.g. handover and lchan alloc code). In some instances, there need to be stubs if to cut off linking "just before the RSL level" and prevent dependencies from creeping in. - abis_rsl_rcvmsg(): the only program currently interpreting RSL messages is osmo-bsc, the utils are merely concerned with OML, if at all. - paging_flush_bts(): ip.access nanobts models call this when the RSL link is dropped. Only osmo-bsc actually needs to do anything there. - on_gsm_ts_init(): the mechanism to trigger timeslot initialization is related to OML, while this action to take on init would pull in RSL dependencies. utils/ and ipaccess/ each have a stubs.c file to implement these stubs. Tests implement stubs inline where required. From src/utils/, src/ipaccess/ and tests/*/, link in .o files from osmo-bsc/. In order for this to work, the osmo-bsc subdir must be built before the other source trees. (An alternative would be to include the .c files as sources, but that would re-compile them in every source tree. Not a large burden really, but unless linking .o files gives problems, let's have the quicker build.) Minor obvious cleanups creep in with this patch, I will not bother to name them individually now unless code review asks me to. Rationale: 1) libbsc has been separate to use it for osmo-nitb and osmo-bsc in the old openbsc.git. This is no longer required, and spreading over libbsc and osmo-bsc is distracting. 2) Recently, ridiculous linking requirements have made adding new functions cumbersome, because libbsc has started depending on osmo-bsc/*.c implementations: on gscon FSM and bssap functions. For example, neither bs11_config nor ipaccess-config nor bts_test need handover_cfg or BSSMAP message composition. It makes no sense to link the entire osmo-bsc to it, nor do we want to keep adding stubs to each linking realm. Change-Id: I36a586726f5818121abe54d25654819fc451d3bf