aboutsummaryrefslogtreecommitdiffstats
path: root/src/libbsc/abis_nm.c
AgeCommit message (Collapse)AuthorFilesLines
2018-05-24fix misaligned memory write access in abis_nm_ipaccess_rsl_connect()Stefan Sperling1-1/+1
Use memcpy() to avoid unaligned access, instead of writing through a pointer cast to uint32_t. Problem spotted by address sanitizer: abis_nm.c:2802:24: runtime error: store to misaligned address 0x7ffc95396706 for type 'uint32_t', which requires 4 byte alignment 0x7ffc95396706: note: pointer points here 81 0b bb 80 00 00 00 00 ed 79 28 56 00 00 e0 9c 00 00 a0 61 00 00 ... ^ Related: OS#3196 Change-Id: I8e591a56ae522b371da01ea968151a7e6fa24bb9
2018-05-05dyn ts, bts_ipaccess_nanobts.c: init PDCH on Chan OPSTART ACKNeels Hofmeyr1-1/+10
Sending PDCH activation upon RSL bootstrap is too early. Introduce OPSTART ACK handling to call dyn_ts_init() only when the dynamic timeslot is indeed ready to receive a PDCH activation. Related: OS#3205 Change-Id: Icf6e25ff068e8a2600562d52726ead65e864ec02
2018-04-13fix handling of state changes in acc rampingStefan Sperling1-5/+9
Take both the operative and administrative states into account when deciding whether to start ACC ramping, and examine old/new state values to avoid triggering ramping for a no-op state change. This requires a fix to gsm_trx_lock_rf(): This function overwrote the old administrative state of a trx before enqueuing a state change request towards the BTS. The BTS will confirm this request with an ACK, at which time a signal is generated which the ACC ramp code listens to. We must not overwrite the old state value until the signal has been handled, otherwise the signal handler cannot tell what the old state was. Tested with a virtphy setup, nanobts, and osmo-bts. Change-Id: Ib3291439655598fb5ddc891a3e4cc35b0bad250f Related: OS#2591
2018-03-22cosmetic: abis_nm: use osmo_cell_global_id, parse 3-digit MNCNeels Hofmeyr1-16/+4
Instead of a local redefinition, use osmo_cell_global_id. This change is cosmetic because the decoded PLMN is currently actually never used. Change-Id: I38ac98a4d25159cfd4f686efbfbaf8f00625a6d8
2018-03-17abis_nm: Improve and fix OML loggingHarald Welte1-87/+68
This code is among the oldest surviving parts of old bsc_hack/OpenBSC, and it shows. We used arcane constructs to puzzle together log messages, attempting to switch the log level between a LOGP and LOPGC [which doesn't work], not properly used log levels in general, ... Let's fix this up by using the new abis_nm_dump_foh() function introduced in libosmocore I9b2c2afec28882b817d104d5b062651ade7aadd8 Change-Id: Ibd757836c39edd2d1ce59e528342f8923a9e75e4
2018-03-12gsm_data: use feature list from libosmocorePhilipp Maier1-3/+4
In order to avoid code duplication the feature list (bit masks) and the desciptive value strings as well as the function to set and get the feature bits have been moved to libosmocore. - use feature list functionality provided by libosmocore Depends: libosmocore Change-Id Id0c35aef11aa49aa40abe7deef1f9dbd12210776 Change-Id: I3e80517539cc5d0e5d8189d434a5e3cc0fdea1a0
2018-03-05gsm48_ra_id_by_bts(): struct gsm48_ra_id* instead of bufNeels Hofmeyr1-4/+6
Move from using deprecated gsm48_construct_ra(), which uses a buf, to gsm48_encode_ra(), which uses a gsm48_ra_id argument. Pass struct gsm48_ra_id around instead of a buf. struct gsm48_ra_id is the "encoded" representation of the bytes in a typical MCC-MNC-LAC-RAC (04.08 Routing Area Id IE, 3GPP TS 24.008 § 10.5.5.15). Using the struct spares using magic numbers for byte offsets. In the process, fix a sanitizer warning for unaligned access by using memcpy() instead of pointer assignment: osmo-bsc/src/libbsc/abis_nm.c:2857:27: runtime error: store to misaligned address 0x7ffe8e0d6695 for type 'uint16_t', which requires 2 byte alignment Note that (besides removing a now unnecessary cast) the gsm0408_test and abis_test tests of RAI / CGI encoding remain stable, which indicates that the new code is still correct. Change-Id: I0d3908fb8ca1e2e669d257b5d59b40675fa85d06
2018-02-14libcommon: eliminate talloc_ctx.cNeels Hofmeyr1-1/+1
Interestingly enough, talloc_ctx_init() actually had not a single caller. While dropping it, see to it that the few contexts that are actually used in osmo-bsc.git are indeed initialized in all the main scopes. Also initialize two void* ctxts as NULL explicitly, to allocate under the NULL context in case some main scope forgets to branch it off another root context. (That's bsc, fle and paging, all others actually come in from other libraries.) Change-Id: I344a3d07e146999e154824837ed95db2b9879356
2018-02-13Make RSL connection attempts time out.Stefan Sperling1-3/+25
If a BTS/TRX does not respond to the "IPA RSL Connect" command, pretend that the BTS has sent a NACK for the connection. To ensure that osmo_timer_del(&trx->rsl_connection_timeout) is not called before this timer is initialized with osmo_timer_setup(), the E1 layer now drops incoming RSL messages from a BTS/TRX in LOCKED administrative state. We cancel the timeout if we receive an RSL Connect ACK or NACK from the BTS, and if the underlying E1 link does down. While here, add a missing message buffer free() in bts_isdn_sign_link(). The callers do not free it. Change-Id: Ia72b65a0f15f47dcb8a6f944f6c3695a4a64b923 Related: OS#2716
2017-12-10OML: expand status reporting checksMax1-0/+17
* check GPRS state: if GPRS is enabled for the BTS but NSE, CELL or both NSVC are locked than report it as degraded * check TRX usability: use already available function to check that TRX is actually usable when reporting OML status via CTRL * fix tests linking: libbsc is using gsm48_create_mm_serv_rej() which is defined in libcommon-cs but neither libbsc itself nor tests using it are actually linked against libcommon-cs Related: OS#2486 Change-Id: I9dce1d3b0cabe149a90cfca58a3fe55f8d6a72bc
2017-11-29compiler warnings: constify in abis_nm.cNeels Hofmeyr1-4/+5
Constify in- and output arguments for Parse Attribute Response Info chain to avoid compiler warnings, and more clearly indicate const data in the first place. Change-Id: Ib7d069fe1fda69e89dfd171cd76b1ed6d6db0ceb
2017-11-29cosmetic: tighten function type signaturesMax1-1/+1
* change return type to bool * constify parameters The nm_is_running(), trx_is_usable() and ts_is_usable() always return boolean value and are always used as such anyway. The also do not change their parameters. Change-Id: I6a572fc78371c69f5308edbad0ebe15e143d0505
2017-11-29OML: consider administrative state when reportingMax1-1/+6
Report state as degraded if BTS or any of its TRX are administratively locked. Change-Id: Ic9ee998d972ca870ce5d039c3ed95edb6ba8b36f Related: OS#2486
2017-11-02Check OML state per-BTSMax1-9/+1
To properly decide if a given OML link is degraded we have to use BTS-specific information about MO state. * move check function into BTS-specific part * add generic wrapper Related: OS#2486 Change-Id: Iddc7a4d20fbb95a6566eed1487a12733e5adb9e2
2017-10-09OML: consider RSL link stateMax1-0/+28
OML link state is available via vty ("sh bts 0" command) and ctrl ("oml-connection-state" RO variable). When showing OML link state, take into consideration RSL link state as well: if OML is up but RSL is missing show it as degraded. That's implemented via BTS model-specific functions (currently Sysmo- and Nano- BTS only) Change-Id: I5952fc59e4d82e0aa627ad91d20f964d9559a4c4 Related: OS#2486
2017-09-08Make TRX rf locking more visibleMax1-2/+6
* log administrative state transitions * log what's caused it * while at it, mark boolean variable as such Change-Id: I3e25a19fac4d0b4886d825c9876771b1f66efe58 Related: SYS#3864
2017-09-06move include/openbsc to include/osmocom/bscNeels Hofmeyr1-5/+5
Change-Id: I39e7b882caa98334636d19ccd104fd83d07d5055
2017-08-27Fix BTS attribute requestsMax1-1/+8
* fix BTS numbers: use 0 to indicate given BTS and 0xFF to indicate all BTS' as it's explained in 3GPP TS 52.021 §9.3. * only request attributes from supported (OsmoBTS) types Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Related: OS#2317
2017-08-27move openbsc/* to repos rootNeels Hofmeyr1-0/+2917
This is the first step in creating this repository from the legacy openbsc.git. Like all other Osmocom repositories, keep the autoconf and automake files in the repository root. openbsc.git has been the sole exception, which ends now. Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7