aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-04-16osmo-bts-trx: ul-pwr-controlneels/ul-pwrNeels Hofmeyr1-31/+26
2018-04-16osmo-bts-trx: fix MS power loop: remove extranous incrementNeels Hofmeyr1-3/+1
Increment chan_state->meas.rssi_valid_count only once, to record only valid rssi values, instead of interleaving with zero at every second element. Theoretically, the index within chan_state->meas.rssi[] could even walk past the array end, practically didn't only because the array size is even. To be superficially safer, change the condition from == to >=.
2018-04-09octphy: integrate octasics latest header releasePhilipp Maier4-20/+181
At the moment osmo-bts does not compile with the latest header file release from OCTSDR-2G-02.10.00-B1837-ALPHA as there are struct members removed and new ones added. The changes do not affect actual functionality in the existing code. The only affected parts are vty functions that query status information about the clock sync manager. - Add detection logic in configure.ac to detect if the affected struct members are present - Add conditional compiling to handle the different combinations of available struct members. Change-Id: Ic38d8dc35522205c4ffab583b4e61b5ef03cdba2 Related: SYS#4139 Patch-by: Octasic inc.
2018-04-06contrib: jenkins_bts_model: Fix bashism exprPau Espin Pedrol1-1/+1
In posix shell, = is valid and == is not. Change-Id: I5c027039d12c5e455a8f8a0878f88ab30c168db4
2018-04-05fix activation of osmocom-style dynamic PDCH as TCH/F or TCH/HHarald Welte1-0/+2
in change-id Iebd2571726d1284a7431b3f9b23ad3185e832ed1 we introduced tighter validation on whether the requested channel number matches the underlying physical channel configuration. Unfortunately this broke activation of an osmocom-style dynamic PDCH as TCH/F or TCH/H rsl_lchan_lookup already permitted a chan_nr if the dynamic PDCH was already switched to the given TCH mode, or at least the related switching had already been initiated. However, in the case of the bug, the current type is NONE, which means that the compatibility check of rsl_lchan_lookup will fail Let's relax the checks of rsl_lchan_lookup() slightly to permit matching for "ts->dyn.pchan_is == GSM_PCHAN_NONE" cases. This fixes BTS_Tests.TC_dyn_osmo_pdch_tchh_act and BTS_Tests.TC_dyn_osmo_pdch_tchf_act Change-Id: I14ae4c4ed2aae0966e5cb5116cf024d6bd890237 Related: OS#3134
2018-04-05rsl_tx_dyn_pdch_ack: Add missing FRAME_NR information elementHarald Welte1-4/+7
It seems that the IPA PDCH ACT ACK contains not only the channel number, but also the frame number. Let's make sure we're as close as possible to other implementations to ensure maximum interoperability. Change-Id: Ibe7988e9ef374e8c7d9429777fb32322d90c2024
2018-04-05fox chan_nr_is_dchan() for RSL_CHAN_OSMO_PDCHHarald Welte1-2/+2
When writing chan_nr_is_dchan() in Change-Id: I43a78bec63aeb36dd67043d237b27fe880209349, I apparently only looked at TS 48.058 without considering the osmocom extension to it for PDCH activation. The result is complete breakage for "osmocom style dynamic PDCH" support. This patch fixes the mistake by making the compare more specific. Change-Id: I18e0774fdd48966bc95261e715f798464b8b681f Related: OS#3131, OS#1853
2018-04-04use osmo_init_logging2() with proper talloc ctxNeels Hofmeyr15-40/+23
Completely drop bts_log_init(), call osmo_init_logging2() directly instead: all callers of bts_log_init() passed NULL as category string, so all it ever did was call osmo_init_logging(). The bts_log_info is already declared in the .h. Here and there also define a proper talloc root context instead of using NULL. Change-Id: Ic049f77bef74123b95350bcae182a468e0086b9c
2018-04-03osmo-bts-sysmo eeprom.c Restore ability to read/write EEPROMKeith1-6/+7
This commit restores ability to read write to the SuperFemto EEPROM. Use offsetof() instead of casts to pointers when calculating the address to pass to eeprom_read() and eeprom_write() Fixes: 7cf144b27d75fadfb4ec65019985bb10660a066a Change-Id: Iaa7318387ad7bb248c261b1f428019244039e7d2
2018-03-23cosmetic: remove unused variable in osmo-bts-omldummy/main.cPhilipp Maier1-1/+1
Change-Id: I85d8c77589eae511f47b8b9b7439a2c47fe350d8
2018-03-23cosmetic: remove unused variablePhilipp Maier1-1/+0
Change-Id: Icbec00ec63950b785dcb71e3b9d70541e70be536
2018-03-23cosmetic: remove dead codePhilipp Maier1-8/+0
Patch by Octasic inc. Change-Id: I40ff0b95349308693bec5f4ae56ec7f2f14202e5
2018-03-21l1sap: Avoid assumption that l1sap is at head of msgbPau Espin Pedrol1-11/+15
This assumption used while sending the rx data to gsmtap in l1sap_up was making osmo-bts-virtual crash, since that bts model is allocating the l1sap in the stack rather than inside the msgb. Instead, let's use the assumption that l2h is set correctly in msgb by the bts model lower layer. crash report: Program received signal SIGSEGV, Segmentation fault. 0x00007ffff6234ec3 in __memmove_sse2_unaligned_erms () from /usr/lib/libc.so.6 (gdb) bt 0 0x00007ffff6234ec3 in __memmove_sse2_unaligned_erms () from /usr/lib/libc.so.6 1 0x00007ffff6dbf4c8 in gsmtap_makemsg_ex (type=<optimized out>, arfcn=arfcn@entry=17255, ts=ts@entry=6 '\006', chan_type=<optimized out>, ss=ss@entry=0 '\000', fn=fn@entry=11249, signal_dbm=0 '\000', snr=0 '\000', data=0x5555557d5b50 "", len=4294967263) at libosmocore/src/gsmtap_util.c:179 2 0x00007ffff6dbf6d8 in gsmtap_send_ex (gti=0x555555877f10, type=type@entry=1 '\001', arfcn=arfcn@entry=17255, ts=ts@entry=6 '\006', chan_type=<optimized out>, ss=<optimized out>, fn=11249, signal_dbm=0 '\000', snr=0 '\000', data=0x5555557d5b50 "", len=4294967263) at libosmocore/src/gsmtap_util.c:311 3 0x00007ffff6dbf765 in gsmtap_send (gti=<optimized out>, arfcn=arfcn@entry=17255, ts=ts@entry=6 '\006', chan_type=<optimized out>, ss=<optimized out>, fn=fn@entry=11249, signal_dbm=0 '\000', snr=0 '\000', data=0x5555557d5b50 "", len=4294967263) at libosmocore/src/gsmtap_util.c:330 4 0x0000555555573571 in to_gsmtap (trx=0x7ffff7ef8070, l1sap=0x7fffffffde80) at osmo-bts/src/common/l1sap.c:397 5 0x0000555555573b9c in l1sap_up (trx=0x7ffff7ef8070, l1sap=l1sap@entry=0x7fffffffde80) at osmo-bts/src/common/l1sap.c:1285 6 0x000055555555ec06 in virt_um_rcv_cb (vui=<optimized out>, msg=<optimized out>) at osmo-bts/src/osmo-bts-virtual/l1_if.c:170 7 0x000055555555f5c6 in virt_um_fd_cb (ofd=0x55555587cc30, what=<optimized out>) at osmo-bts/src/osmo-bts-virtual/virtual_um.c:50 8 0x00007ffff6db6991 in osmo_fd_disp_fds (_eset=0x7fffffffe090, _wset=0x7fffffffe010, _rset=0x7fffffffdf90) at libosmocore/src/select.c:216 9 osmo_select_main (polling=polling@entry=0) at libosmocore/src/select.c:256 10 0x0000555555576fbc in bts_main (argc=5, argv=0x7fffffffe288) at osmo-bts/src/common/main.c:364 11 0x00007ffff61b5f4a in __libc_start_main () from /usr/lib/libc.so.6 12 0x000055555555c4ca in _start () In the old code when the sizeof(osmo_phsap_prim) was being substracted it resulted on a negative len which later was casted to unsigned int and became a really big number. Fixes: OS#3092 Change-Id: I51a880328497673a06d153bfb76c428265b8cbb8
2018-03-17debian: Split osmo-bts-virtual from osmo-bts-trxHarald Welte4-1/+24
osmo-bts-virtual also contains osmo-bts-omldummy Change-Id: I1c88ed2f7111a6c061ac5721af8f09d9aca4a156
2018-03-17omldummy: Suppress RSL transmission errorsHarald Welte1-0/+7
In omldummy, we don't have a RSL link and hence any transmission attempts to RSL should silently go to /dev/null rather than printing error messages via libosmo-abis. So check for the OMLDUMMY variant and silently discard any RSL message that the code may want to transmit. Change-Id: I04a9ec7e416822cc1e45c533e6a66628689615ad
2018-03-17fix inverted logic bug in omldummy patchHarald Welte1-1/+1
Change-Id: Ic2e7e78f922cb9634217f03482153950c90848a1
2018-03-17Add 'osmo-bts-omldummy' to bring up only OML without RSLHarald Welte10-4/+294
This is used only in integration testing, where in the TTCN-3 testsuite we currently have no A-bis OML implementation, but only a RSL one. Change-Id: Id8e5f34091e6e32621d8c8673de7ea848dfd252f
2018-03-17virtual: Correctly set+report BTS variant in OML attributesHarald Welte3-0/+3
Change-Id: I76dc47427ec26834859fb737bd319dc379ae8697
2018-03-17Get rid of 'struct gsm_bts_role_bts'Harald Welte36-477/+371
gsm_bts_role_bts was introduced at a time when we still shared gsm_data_shared.[ch] between BSC and BTS, and where we then subsequently needed a BTS-private structure. Since that sharing was abandoned quite some time ago, we can merge gsm_bts_role_bts into gsm_bts and do away with the bts/btsb dualism in a lot of the code. Change-Id: I4fdd601ea873d9697f89a748cc77bcf7c978fa3e
2018-03-17cosmetic: Move agch_queue to sub-structure of gsm_bts_role_btsHarald Welte4-71/+73
Rathert han have 11 direct members of gsm_bts_role_bts, group them into a sub-struct as ew do for other parts like interference, laod, ... Change-Id: Iefecf4b70c1b11c650913f2ae3783718ffb8a36c
2018-03-17gsm_data_shared: Remove unused definitions/members/functionsHarald Welte3-248/+1
What we remove here is a legacy from sharing this header file with openbsc/osmo-bsc-sccplite, which we stopped to do quite some time ago and hence can remove those parts that are only relevant to the BSC but not to the BTS. Change-Id: Icac1656da68f6a006a28c779e3b563bbdd905b3d
2018-03-13common/main.c: track talloc NULL contexts by defaultVadim Yanitskiy1-0/+3
In order to be able to introspect not only the root application context, but also all other contexts, e.g. allocated within libosmocore or other libraries, let's enable tracking the use of NULL contexts using the corresponding talloc API. In order to obserbe all existing contexts, use the following VTY command: OsmoBTS# show talloc-context all ... Example of usage: OsmoBTS# show talloc-context all brief talloc report on 'null_context' (total 1302808 bytes in 5185 blocks) lapd context contains 129 bytes in 5 blocks struct signal_handler contains 40 bytes in 1 blocks struct pcu_sock_state contains 120 bytes in 1 blocks struct lookup_helper contains 24 bytes in 1 blocks struct signal_handler contains 40 bytes in 1 blocks struct signal_handler contains 40 bytes in 1 blocks abis contains 49065 bytes in 19 blocks struct signal_handler contains 40 bytes in 1 blocks struct signal_handler contains 40 bytes in 1 blocks struct signal_handler contains 40 bytes in 1 blocks vty contains 93690 bytes in 5008 blocks logging contains 2862 bytes in 7 blocks OsmoBTS context contains 1156678 bytes in 137 blocks Change-Id: I5e9381902dace7dfd37f98b657e4697b5afcff96
2018-03-13configure: add --enable-werrorNeels Hofmeyr1-0/+21
Provide a sane means of adding the -Werror compiler flag. Currently, some of our jenkins.sh add -Werror by passing 'CFLAGS="-Werror"', but that actually *overwrites* all the other CFLAGS we might want to have set. Maintain these exceptions from -Werror: a) deprecation (allow upstream to mark deprecation without breaking builds); b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds) As a last configure step before generating the output files, print the complete CFLAGS and CPPFLAGS by means of AC_MSG_RESULT. Change-Id: I5b37602a117350159183fb53ac330294b94f4195
2018-03-11sysinfo: Fix scheduling of downlink SACCH informationHarald Welte1-2/+4
The existing algorithm (present since 2012!) failed to work in the sole case that only *one* SACCH filling type was present. So if you had your BTS configured to only broadcast SI5, but not broadcast SI5ter, SI6 or any other SACCH filling, it would send the SI5 message only once on a newly-established channel, and never again. The old code was working for more-than-one SACCH filling, as well as for no SACCH filling at all. Let's also add a NOTICE message if there is no SACCH filling available at all. This is highly unusual and definitely a noticeable event. Change-Id: Ica801f9b9c118f00d9e3dc2780b3123e925f59b4 Closes: OS#3057 Related: OS#2963
2018-03-11cosmetic: Document some SI scheduling related function APIHarald Welte2-1/+17
Change-Id: I7e61639349deda28846810c4f52dbea78dccda38
2018-03-11implement support for 3-digit MNC with leading zerosNeels Hofmeyr3-13/+11
Record the mnc_3_digits flag from SI and pass on via the PCU interface. Instead of changing to e.g. osmo_plmn_id, add the flag separately, and instead of bool use a uint8_t, to not raise any struct packing issues and clarify the flag's size beyond any doubt. Bump the PCU interface version to 9. This is one part of the three identical pcuif_proto.h patches: - I49cd762c3c9d7ee6a82451bdf3ffa2a060767947 (osmo-bts) - I787fed84a7b613158a5618dd5cffafe4e4927234 (osmo-pcu) - I78f30aef7aa224b2e9db54c3a844d8f520b3aee0 (osmo-bsc) Depends: Id2240f7f518494c9df6c8bda52c0d5092f90f221 (libosmocore) Change-Id: I49cd762c3c9d7ee6a82451bdf3ffa2a060767947
2018-03-10sysmobts: Compatibility with older firmware versionsHarald Welte1-1/+12
When using a firmware version < 3.6, the call to l1if_mute_rf() returned an error, which caused an OML CHG ADM STATE NACK. Let's check if the l1if_mute_rf() call is an un-mute for all timeslots (which apparently we do always at start-up). If it is, then acknowledge it even if muting is not supported by earlier firmwares. I suppose the change causing this problem was introduced in: commit b26b8fc77692e851469f3e27b9aeaeff233ffd2e Author: Holger Hans Peter Freyther <zecke@selfish.org> Date: Tue Mar 4 15:03:59 2014 +0100 sysmobts: Do a RF mute at initialization when the RC is locked With the current change applied, we can run the BTS with earlier firmware versions than 3.6.0 again. Tested with 3.1 and 2.4 Change-Id: I1a29c1031d96e65a0111bc812a90f2dbaf2a5aa3
2018-03-09sysinfo.c: SI1 is optional; Send SI2 at TC=0 if no SI1 existsHarald Welte1-1/+3
SI1 is only required if frequency hopping is used or if NCH is used. So it's optional. If OsmoBTS has no SI1 configured, it will transmit the empty SI1 buffer at TC=0, and as a result no valid SI will be broadcast at TC=0. Change-Id: I41ab885c00e943199b2e939e98f30e267ecffbee Closes: OS#3051
2018-03-08fix handover: handle_ph_ra_ind(): evaluate ra_ind before msgb_trim()Neels Hofmeyr3-97/+118
Commit c2b4c668f3510b7b0baace749c5a310959010e90 I3b989580cb38082e3fd8fc50a11fedda13991092 introduces evaluation of ra_ind members below the msgb_trim() call that actually invalidates ra_ind. A symptom is that it breaks detection of Handover RACH, wich always ends up with lchan == NULL and interpreting all RACH as chan_nr == 0x88. Fix: do all evaluation of ra_ind before the msgb_trim(), for osmo-bts-sysmo, litecell-15 and octphy. To guard against similar mistakes in the future, set ra_ind = NULL before the msgb_trim() call. Related: OS#3045 Change-Id: I203021ee57f49cb963679ba8bec5943e2abb67fb
2018-03-06common/vty.c: remove unused variablesVadim Yanitskiy1-2/+0
Change-Id: I289dda64228e81ca4c608121e50146a71e19f1e2
2018-03-05l1_tch: remove dead codePhilipp Maier1-64/+0
the file l1_tch.c in the octphy spcific code has its root in the tch.c file of sysmobts. It contains some sysmobts specific ifdefs which enclose dead code. - Remove the sysmobts specif ifdefs and the dead code Change-Id: I33f3e0fd293ca8387fddf5ed20f642621e9680de
2018-03-05common/l1sap.c: limit the minimal ToA for RACH burstsVadim Yanitskiy1-4/+12
In general, RACH bursts should not arrive with negative offset. Let's limit early signal arrival up to 2 symbols, otherwise it is most likely noise, interference or a ghost. TTCN-3 test case: Icccc88545ed3aabd6da28a40599a8a77d1de477d Change-Id: I662294fe3136cf7a259be13816a3e63f7db9a948
2018-03-05common/l1sap.c: perform noise / ghost filtering for handover RACHVadim Yanitskiy1-14/+17
For some reason, the noise / ghost filtering was performed for normal RACH requests, but not for handover RACH requests. There are also ghost RACH, interference and noise possible, so let's extend the filtering coverage. Change-Id: I94fc15835280d624780200dadc4418210bf565ff
2018-03-05common/l1sap.c: clean up noise / ghost RACH filteringVadim Yanitskiy1-21/+26
It makes sense to combine both existing BER (Bit Error Rate) and ToA (Timing of Arrival) checks into a separate funcition, so this code may be also used for handover RACH. Change-Id: I1ddda238d5212a88a3dd5c4fc5dfcfea018151bd
2018-03-05common/l1sap.c: increment valid RACH counter after all checksVadim Yanitskiy1-5/+5
Previously, the number of RACH slots with valid non-handover RACH burst was incremented between both BER (Bit Error Rate) and ToA (Timing of Arrival) checks. So, if a RACH burst passed the BER check, but was dropped by ToA check, the counter of valid RACH requests could be increased anyway. Change-Id: I31594a8c5dce1f42226ced5b2dc8778152b3d829
2018-03-05common/l1sap.c: increase the BTS_CTR_RACH_DROP in RACH BER checkVadim Yanitskiy1-0/+1
The BTS_CTR_RACH_DROP counter is being increased in case if a RACH request is ignored due to exceeding ToA value, but remains untouched in case of exceeding BER (Bit Error Rate). Let's fix this. Change-Id: Ia02e781d6c47d9d8012a4c8846fe4b731aab74d7
2018-03-05scheduler_trx.c: remove ToA (Time of Arrival) hackVadim Yanitskiy1-9/+0
This was useful for software simulation of burst delay, expressed by ToA (Time of Arrival). Since we have FakeTRX toolkit, ToA value may be simulated in a more flexible way, so let's remove this code. Change-Id: Ied0fcfcf58b93efdc6de9666fbbf8fea104e2543
2018-03-03rsl: remove unused variablePhilipp Maier1-1/+0
The variable btsb in rsl_rx_mode_modif() is set but not used. - remove btsb Change-Id: Ic07edfa04c2184bff4a043e96e69c07df38607e4
2018-03-03ipac: fix log outputPhilipp Maier1-12/+10
The current log output logs connect_ip connect_port speech mode and payload type over multiple lines and without logging context (lchan name). Also the logging level incorrectly set. - shrink log output into one line. - add context (lchan name) - encode ip/port into human readable form Change-Id: I61044edc0672b268aeebf48b59a772887703399f Closes: OS#3001
2018-03-02pcuif_proto: add version 8 featuresAlexander Couzens1-1/+19
Add PCU_IF_MSG_DATA_CNF_DT and PCU_IF_SAPI_AGCH_DT to bring the pccif_proto into sync. Both commands are required to support the rb11 with an osmo-bsc co-located pcu. Change-Id: I6d330aca26249ee94ece5e415079f0b75c6e8b48
2018-03-02pcu_if: move definition PCU_SOCK_DEFAULT into pcuif_proto.hAlexander Couzens4-4/+4
PCU_SOCK_DEFAULT is defined in the pcu counterpart of the file pcuif_proto.h To be consistent with the pcu move the definition pcuif_proto.h The pcuif_proto.h will be exact the same in the pcu repo and bts repo. Change-Id: I67f8ec036e219994cc296d0ed5409da7f3ec681e
2018-03-02common/pcu_sock.c: fix double field assignmentVadim Yanitskiy1-1/+0
The 'data_ind->rssi' variable is assigned values twice. Change-Id: I81eb1ac3dc2aa3597b1c85301b92995412edbc7b
2018-03-01octphy: replace #warning with #pragma messagePhilipp Maier2-2/+2
warning causes the compiler to throw an actual warning. Lets change those intentional warnings to messages. Change-Id: I2fc83a1a07db9c569b93f29835bf3a0fd8ef4ef5
2018-02-28pcu_sock: LOG + drop PCU DATA.req for inactive lchanHarald Welte1-0/+6
Change-Id: I11c622967885d594ef7e1c24b9bafd0fb8fd400c
2018-02-28pcu_sock: LOG + drop DATA.req from PCU for non-PDCH timeslotHarald Welte1-0/+6
Change-Id: I3ae496eca96bc0823dfeca16ce36c200ce000895
2018-02-28pcu_sock: Log an error message and discard PCU primitives for BTS != 0Harald Welte1-0/+4
In OsmoBTS, we (so far?) only have a single BTS inside each process, let's make sure we log an error message if the PCU should ever want to transmit primitives to a non-zero BTS number. Change-Id: I158f935fed12941737c806c0677a8192ea3418a0
2018-02-28pcu_sock: Don't overflow the timeslot arrayHarald Welte1-0/+6
Don't blindly trust that the ts_nr received on the PCU socket will be small enough to not overflow our timeslot array! Change-Id: Ie9964c8dc0ca7b049da7dfec0ac0a0d3f1aedd45
2018-02-28pcu_sock: Discard messages that are too shortHarald Welte1-0/+6
The downstream code of pcu_sock.c doesn't contain any length checks, so let's discard any messages that are shorter than the primitive length. Change-Id: I35ac84d4db6d21ea61afbd1864c810bbf601d69b
2018-02-28pcuif_proto: correct indention of gsm_pcu_if_dataAlexander Couzens1-5/+5
Change-Id: I39f3bc1f0a1e238f8f00cb00e2d1e5193f118c16
2018-02-27Add high-accuracy ToA value to Uplink Measurement ReportsHarald Welte3-0/+41
Normal Abis RSL MEasurement Results contain only the "MS Timing Offset IE" in units of full symbols. In some use cases it is important to have higher-accuracy timing information exposed to the BSC. We do this by adding the average timing offset value during the last measurement interval in 1/256th symbol accuracy to the "Supplementary MEasuremen Information" part of the TS 48.058 9.3.25 Uplink Measurements IE. In order to avoid any compatibility issues, this feature is only enabled if the new vty config command "supp-meas-info toa256" at the bts node is enabled. Change-Id: Ie85e53b47d4041cc4e6d7b78406ae8b79b2d9397