Commit Graph

1343 Commits

Author SHA1 Message Date
Harald Welte 9b97d0f683 TRX: permit transmission of all-zero loopback frames
For some reason, osmo-bts-trx attempted to interpret/validate the
contents of the downlink TCH block that it was about to transmit.  If
such checks are made, they should clearly be in the common part above
L1SAP, and not in the bts-model specific part.

Also, having the checks in place didn't allow us to send an all-zero
downlink block, as is required for detection of uplink FER in a loopback
testing setup, e.g. with CMU-300.

Change-Id: I6388de98e4a7e20843a1be88a58bba8d2c9aa0d5
2017-07-02 07:02:29 +00:00
Harald Welte a38d34112f l1sap: Don't enqueue PTCCH blocks for loopback
When we're in loopback testing mode for PDTCH, we must make sure to
avoid adding PTCCH blocks to the queue. Only PDTCH blocks must be
enqueued. For the transmit (downlink) side, we already had the PTCCH
check in place.

Change-Id: I7ef40d9bdf74a99375bc6568ed9483499664bf6f
2017-07-01 07:38:40 +00:00
Harald Welte cc1602f592 TRX: don't free l1h in trx_phy_inst_close()
l1h is allocated in bts_model_phy_instance_set_defaults() and not in
trx_phy_inst_open().  Hence, trx_phy_inst_close() should not free() it!

Change-Id: I0ac4e57a882e5a31143499c1662d8d8e52320938
2017-07-01 07:38:03 +00:00
Harald Welte f2eaba8869 TRX: merge/simplify l1_if and trx_if code
Related code / function structure still dates back to the pre-phy_link
days.  Let's clean this up to make things less convoluted and reduce the
number of non-static symbols needed between code split over two files.

Change-Id: I1f30ae1f547a5c01c516d4a05032193294c25f2d
2017-07-01 07:38:01 +00:00
Harald Welte cdf20fec7c TRX: Rename trx_if_data() -> trx_if_send_burst()
The new name makes it clear what the function actually does: Send burst
data via the trx interface.

Change-Id: I5031541d4ae4244a62a18acf71139db2874927fa
2017-07-01 07:38:01 +00:00
Harald Welte bb71947829 trx_if: Improve error handling
There ware some error conditions that the previous code didn't catch
and/or report, such as unparseable TRX control strings, non-terminated
buffers, ...

Change-Id: I354d0c121880553ce1bd59b7394d52b104b7d6da
2017-07-01 07:38:01 +00:00
Harald Welte c19ab9ed2f TRX: trx_if: Improve code description / comments
Change-Id: I4e19d68782a12e52ba1d3ba2665060275d04866c
2017-07-01 07:38:00 +00:00
Pau Espin 7738f5282f litecell15/tch.c: Clean up use of empty buffer
Make code easier to read and avoid reading first byte of the buffer if size is 0.

Change-Id: Ib9ee967c0f42098b3a0569e9d84f23832eb4f2d5
2017-06-30 08:48:34 +00:00
Pau Espin 0ada527bc0 sysmo/tch.c: Clean up use of empty buffer
Make code easier to read and avoid reading first byte of the buffer if size is 0.

Change-Id: I5ecfc4df5a3fcad3d3ad50bf3dd3db65b694481a
2017-06-30 08:47:57 +00:00
Philipp Maier dd3c7815a5 osmo-bts-litecell15: Fix missing frame number in MEAS IND
The layer 1 interface (l1_if.c) for osmo-bts-litecell15 does not include
the frame number into the measurement indications it forwards
to higher layers. The frame number is required to properly
detect the end of a measurement period.

change process_meas_res() to properly include the frame number into the
l1sap primitive (struct osmo_phsap_prim *l1sap)

Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237
2017-06-29 17:41:01 +02:00
Philipp Maier b7425f3642 osmo-bts-trx: fix missing frame number in MEAS IND
The layer 1 interface (l1_if.c) for osmo-bts-trx does not include
the frame number into the measurement indications it forwards
to higher layers. The frame number is required to properly
detect the end of a measurement period.

Change-Id: Ife3c791ff50e8a866a97b9783ac7ef3ef2402a70
2017-06-29 17:29:56 +02:00
Philipp Maier 8d645dd0e5 Revert "sysmobts: normalize frame number in measurement indication"
This reverts commit 88b2cc30a6.

Change-Id: I30f37a9feef24a45e254377502615d717dba9765
2017-06-29 13:18:11 +00:00
Harald Welte 250d77f8df Add loopback support for PDTCH
This add support for BTS-side lookback of PDTCH channels.

If lchan-loopback is enabled, We take the uplink frames as received in
PH-DATA.ind and put them into the dl_tch_queue for that lchan.  When we
receive PH-RTS.ind, we dequeue frames from that queue and transmit them
in downlink. If no frame is found in queue, we transmit an empty
(all-zero) frame of 23 bytes (CS-1).

Change-Id: Idd07a3f4a88c38398d3e844333c0104e2de23864
2017-06-28 23:43:28 +00:00
Harald Welte 53ce11ab95 TRX: Use timerfd and CLOCK_MONOTONIC for GSM frame timer
using gettimeofday() is not suitable for the GSM frame timer, as it
relies on the normal 'wall clock' system time, which may be adjusted by
ntp, gps or other means at runtime.

Switching to a different clock source means we cannot use
osmo_timer_list anymore, but timerfd integrates just fine with our
libosmocore select() loop handling.

Change-Id: I51b19adde14ebb7ef3bb863d45e06243c323e22e
Closes: #2325
2017-06-28 23:43:28 +00:00
Philipp Maier 59d0c2cca6 octphy: remove log output
When handle_ph_data_ind() runs BER and RSSI is logged. Remove
this log output by removing the call to dump_meas_res

(Patch by Octasic Inc.)

Change-Id: I5e755465daa3daec2e2b4f61bc8d779c49196e9a
2017-06-28 13:21:51 +00:00
Philipp Maier 5047fbe3b8 octphy: initalize nmsg only when needed
nmsg is initalized every time the function runs, even when it
is not needed. Move the initalization into the if (msg) body
so that nmsg is only initalized when we really need it.

(Patch by Octasic Inc.)

Change-Id: If51dc50a9f4bdb4aba62c0ae5fbfac552806f0c0
2017-06-28 13:21:51 +00:00
Philipp Maier 521ab50dcc octphy: initalize l1msg and only when needed
l1msg is initalized when the variable is declared. This means
the allocation always runs right on the beginning. Even when
the buffer is not needed at all.

do a prober l1msg initalization only when needed and check the
return code.

(Patch by Octasic Inc.)

Change-Id: Ia71d49b9cc109af53d997a687a7fb1b5ed062d1c
2017-06-28 13:21:51 +00:00
Philipp Maier ae7ece1064 octphy: improve log output
Printing the RX payload size is strictly informative, so the
loglevel LOGL_ERROR is wrong. This commit changes it to
LOGL_DEBUG

(Patch by Octasic Inc.)

Change-Id: I712cdd79cbba93f457705d38871bd8d4b7f4e897
2017-06-28 13:21:51 +00:00
Max 4962ed1811 RSL: receive and send multiple SI2q messages
* change BCCH Info handler to explicitly support multiple SI2quater
  messages sent from BSC
* change SI scheduler to send SI2q in round-robin way

That's resubmission of 340cff51f4 and
186c6bac07 with memory initialization
order change to fix the issue detected by osmo-gsm-tester - see OS#2338.

Change-Id: Ib595733cde108387bc7ee76b1b11ada6a235f13c
Related: OS#1660, OS#2338
2017-06-28 07:56:32 +00:00
Philipp Maier d0846651a3 measurement: improve log output
The code that receives the uplink measurement data from L1 does not
print the number of already received uplink measurements. Since
this is a valuable information when debugging the log output will
now print this information as well.

(Patch by Octasic Inc.)

Change-Id: I79926f25de088571fcc2c14388c72fc968c2d382
2017-06-26 13:48:10 +00:00
Max 620bd83b12 Add missing include for abis.h header file
This fixes compilation warning:
implicit declaration of function ‘abis_bts_rsl_sendmsg’

Change-Id: I956561b2f953c7d380a26442fad84bc8262ea129
2017-06-26 10:54:28 +00:00
Minh-Quang Nguyen 2a4c5fa2b3 LC15: properly handle BS-AG-BLKS-RES as received from BSC
Closes: OS#2014
Change-Id: Icf437e621d1991f6185e31a0953773309e2bf5ac
2017-06-24 12:56:08 +02:00
Harald Welte 4699ebaa26 l1sap: if lchan is in loopback, don't accept incoming RTP
When the lchan is in loopback mode, we loop back all uplink blocks into
downlink blocks.  We do not processs any RTP frames for that lchan
anymore.  Rather, we discard those RTP frames to avoid mixing
looped-back samples with those received from remote.

Change-Id: I29ef4963e9c491c94c413cbc10436a2388c04d9b
2017-06-24 12:56:08 +02:00
Harald Welte 7a6b178fc0 osmo-bts-sysmo/l1_if.c: PH-DATA.ind belongs to L1P, not L1C
L1C is control, while L1P is data primitive.

Change-Id: I5a0ef08df96a67cd25b11eb23c60934011b01c29
2017-06-24 12:56:08 +02:00
Harald Welte 53216b5d1f l1sap.c: Factor out function to limit message queue
Change-Id: I0fe0fc6b17cefdbf6b2d9f30ed08306998d30687
2017-06-24 12:55:11 +02:00
Harald Welte 50f8165540 measurement: Remove dead code
We used to have trx_meas_check_compute() and call that from the
bts-specific code in order to iterate over all timeslots and all lchans
in the timeslots if we have to send measurement reports.  This was
executed once per frame, and created unequal CPU load over time, which
in turn might increase different per-ts jitter.

Since 2f028c4e2c in April 2017 we have
lchan_meas_check_compute(), which performs this on a per-lchan basis,
and hence CPU load is distributed over all active timeslots.

Change-Id: I6308cefe4a51e55719ea4ed4d613d3782b805c08
2017-06-24 12:55:11 +02:00
Neels Hofmeyr 61f9158eaf Revert "RSL: receive and send multiple SI2q messages"
This reverts commit 340cff51f4.

osmo-gsm-tester detected a regression due to this commit, when running
osmo-bts-trx. The modems timed out when waiting for them to register with the
osmo-bts-trx network. osmo-bts-sysmo is apparently not affected. No further
details on the failure cause are known yet. The failure is shown for example by
http://jenkins.osmocom.org/jenkins/view/osmo-gsm-tester/job/osmo-gsm-tester_run/868/

Change-Id: I15bca30ddc09a7a3044096626016f6130d07636c
2017-06-24 00:49:26 +02:00
Neels Hofmeyr 1ba0cfe9c0 Revert "RSL: check for abnormal SI2q values"
This reverts commit 186c6bac07.

osmo-gsm-tester detected a regression due to commit
340cff51f4, which above commit apparently depends
on. Revert this along to avoid conflicts.

Change-Id: I456e9add788393ca781213cef31b5bc3d48fd531
2017-06-24 00:48:23 +02:00
Max 9d294c9cb1 lc15: fix jenkins build
* use proper fw headers include path
* do not quote $PARALLEL_MAKE variable

Change-Id: Ib67305ae858ce322f7ea4ac6c6ce5007ce8e7ab9
Related: SYS#3682
2017-06-22 19:51:02 +02:00
Max 5466ff9c1b lc15: make jenkins helper executable
Change-Id: Icf06040d77180fb9d877ca52e00171b21b634ef8
Related: SYS#3682
2017-06-22 13:22:43 +02:00
Max 94bdcfd803 OML: move BTS number check into separate function
* move code which checks for BTS number (obtained via OML) validity into
  separate function
* adjust log messages to match the check
* add spec reference and comments

Change-Id: Id5714fbed910696d30e18d1f20f4c9fced4b9230
Related: OS#2317
2017-06-22 10:51:12 +00:00
Max 114293a414 Copy sysmobts.service to osmo-bts-sysmo
This way the name of systemd service file will match the name of the
binary similar to lc15. Add aliases so the user can use both old and new
names regardless of which file is installed. Once the corresponding
changes to OE recipes are applied old file can be removed.

Based on work by Pau Espin Pedrol <pespin@sysmocom.de>

Change-Id: I08615eb625d488603aeb5962ad9f30869c0e77c5
2017-06-22 10:50:00 +00:00
Max d4806db1e5 Use generic L1 headers helper
Change-Id: I2253df3509595d7393ec6631ef846dbebae73ca4
2017-06-21 20:25:28 +00:00
Max 71ad40c647 lc15: add jenkins helper
Add jenkins build helper for lc15 and separate header with BTS-agnostic
functions.

Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132
Related: SYS#3682
2017-06-21 20:25:28 +00:00
Max 5b87144f91 Move common steps into common jenkins helper
Move value_string termination check and OpenBSC headers checkout into
shared jenkins helper from BTS' model-specific helpers to get rid of
copy-pasted code. While at it - also remove unnecessary bash
dependency.

Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408
2017-06-21 20:25:27 +00:00
Max d5971d0681 Move parameter file opening into separate function
* use talloc for file path allocation
* print detailed error on failures

This simplifies troubleshooting of lc15bts-mgr failures.

Change-Id: I86c93a2a4f080e8ac1517be93f58f6ffd00d248c
Related: SYS#3686
2017-06-19 08:34:41 +00:00
Max aa5edff477 lc15bts-mgr: use extended config file example
Change-Id: I0ef9d00a031b7d7e59150a28a6972c620ff19e92
Related: SYS#3686
2017-06-19 08:34:23 +00:00
Harald Welte f4544573f8 OML Add osmocom-specific way to deactivate radio link timeout
In some situations (e.g. when trying to do measurements/testing on the
BTS receiver / uplink) it is useful to have a way to disable the radio
link timeout and keep any channel open until deactivated, irrespective
of whether (valid) data is received or not.

This adds a related feature that can be activated by using an
osmocom-specific value of 0xff for the TS 12.21 Connection Failure
Criterion (9.4.14).

Change-Id: I736f21f6528db5c16fa80cdb905af20673797be5
2017-06-18 10:00:43 +00:00
Max 186c6bac07 RSL: check for abnormal SI2q values
Check for impossible index and count values of SI2q messages. The limit
is defined in 3GPP TS 44.018 Table 10.5.2.33b.1

Change-Id: I351f8e8641a1cb9548154803da70bfde46ee180d
Fixes: CID 170749
2017-06-16 20:17:37 +02:00
Max 340cff51f4 RSL: receive and send multiple SI2q messages
* change BCCH Info handler to explicitly support multiple SI2quater
  messages sent from BSC
* change SI scheduler to send SI2q in round-robin way

Change-Id: I3aeb90804edab1b0325c3eb7347526ae995dbf51
Related: OS#1660
2017-06-15 19:18:47 +00:00
Vadim Yanitskiy 0b7a3e9f62 scheduler_trx.c: strip unused variable
Change-Id: I870dad2a00f68cca1c31a719221fc30a07b30c20
2017-06-15 14:40:21 +00:00
Vadim Yanitskiy 0227e4d04c cosmetic: fix some typos
Change-Id: Ib9172735bc7a05d9d7425a0e66dd90ff2569ee05
2017-06-15 14:40:21 +00:00
Max 61d36212b1 Cleanup SI scheduling
* use GSM_BTS_HAS_SI() from OpenBSC instead of local copy
* arrange GSM_BTS_HAS_SI() checks to improve readability
* constify SI scheduler parameters

Change-Id: If74bc536fe7d2bfbc976c07d882151873ecda4f2
Related: OS#1660
2017-06-15 13:22:12 +00:00
Max de9357251c Set and report BTS features
Set (possibly incomplete) list of BTS model-specific features and report
them in response to attribute request via OML.

Change-Id: I5f8a6681c3562ec261441e84dde6e085b516d92f
Related: OS#1614
2017-06-15 12:55:16 +00:00
Max b7793ed8fd Extend Get Attribute responder
* detect if attributes are requested for BTS or TRX and act accordingly
* report TRX phy version

Change-Id: I9f72305bbf1ab74745bffac1bee9f539f5a6de32
Related: OS#1614
2017-06-15 12:55:16 +00:00
Max 1dcbee3420 lc15: add example systemd service file
Change-Id: I923b4220f98bb7bd9ec78a6804bdfa9ad988f473
Related: SYS#3686
2017-06-14 13:15:45 +00:00
Max 78a5073dfb Place *-mgr config examples according to BTS model
* copy sysmobts-mgr.cfg to sysmo/ directory
* add lc15bts-mgr.cfg

The configuration is BTS-specific so it should be located inside
appropriate subdirs.

Note: the old copy of sysmobts-mgr.cfg can be removed once the image
build recipes are adjusted.

Change-Id: Ic81197464809ba508b2572e86dd978a994f4b116
Related: SYS#3686
2017-06-14 13:15:42 +00:00
Max 16b8f51839 Use systemd template specifiers
Use systemd template specifier for config name instead of hardcoding
it. This will allow to specify different config file name depending on
the name of the service file.

By default sysmobts-mgr.cfg will be used preserving compatibilty with
existing installations but if the unit is named lc15bts-mgr.service than
lc15bts-mgr.cfg will be used. This gives us necessary flexibility to use
BTS-specific configuration.

Change-Id: I475df6a06691390120eea0bd8a61fa469df2bd2d
Related: SYS#3686
2017-06-14 13:32:11 +02:00
Philipp Maier 0e7886d379 measurement: Improve log output
The debug log does not print much information about the measured
rxlev and rxqual values. This commit adds debug output to make
measurement debugging simpler

Change-Id: Ic871eed6dcbc7d10aca6cd11dbc803b3e6da449f
2017-06-13 10:06:24 +00:00
Philipp Maier 3e2de526b0 cosmetic: remove unused variable
Tha variable ms_timing_offset in lchan_meas_check_compute is not
used anymore.

Change-Id: I40c393f6864fe72b88a70da265b7775da8fb469c
2017-06-09 16:09:21 +02:00