Commit Graph

1100 Commits

Author SHA1 Message Date
Harald Welte ae5405e2a4 vty: Ensure to not use negative (error) sapi value
Change-Id: I282311de8514c1cc0a1b716e97e90ddf48863bb4
Fixes: Coverity CID 57617
Fixes: Coverity CID 57618
2016-11-25 23:50:46 +01:00
Neels Hofmeyr be671bc61f cosmetic: tweak README
I noticed that the README is prominently shown on github, so it makes sense
to get rid of the worst typos and misinformation there.

Change-Id: I60defef6224a78bb84d7d0b57bc8da17ad7877bb
2016-11-23 00:05:13 +01:00
Alexander Chemeris f7b559f960 vty: Add commands to manually activate/deactivate a channel.
This is the easiest way I found to make BTS level loopback to work.
Another way to implement this is to have BSC/NITB to send the OML command, but
it's a longer path with no clear benefits.

Note, that the current code hardcodes the channel to be TCH/F with v1 speech,
which is what we need for the basic BER testing. We may want to extend this
later to support more channel types.

Change-Id: Ia2734afeff023e5b3d6b934c7e8b1ed95a071b72
2016-11-16 16:38:51 +00:00
Alexander Chemeris b2fbdd023b l1sap: Fix use-after-free in loopback mode.
By default l1sap_tch_ind() returns 0 which signals to its caller that message
has been processed and can be freed. In case of loopback we're forwarding
the message to dl_tch_queue who will free it later.  Returning 1 from
l1sap_tch_ind() prevents caller from freeing message.

Change-Id: I1e065075baa51c88fa717f132e1f0a83df68be02
2016-11-14 17:40:34 -08:00
Max 66325aee71 Replace link_id constant with define
Instead of using constant for link_id directly, use shared define value.

Change-Id: Ibf3d439d8893bd994ba089796175b6c635db2cf8
2016-11-11 15:52:49 +01:00
Max bdf10eb705 Remove duplicated code
Having duplicated code to fill in fn & tn values makes it harder to read
and modify static gsmtap_p* functions. Fix this by removing the
duplication and moving the common code one level up.

Change-Id: I0e67bf7423424cc11435bc0a5a1110297eeee383
2016-11-11 12:22:11 +01:00
Neels Hofmeyr c43352dbc4 fix 'osmo-bts-* --version' segfault
Call vty_init() before handle_options() to make sure the host.app_info is
populated before --version potentially tries to print it.

Change-Id: Ic87b5498b57b2f0f876171a15e769b74c28348c1
2016-11-09 15:44:30 +01:00
Max c757272443 dtx_check.gawk: add check for repetitive SID FIRST
Change-Id: Id7acdfae7880fb488b65435ab8d33f2874499967
2016-11-08 16:27:47 +01:00
Max 388a91cbd1 Add libosmocodec for octphy build
Similar to 4582222757 fix build by linking
with libosmocodec explicitly.

Change-Id: Ib52135936ae02d804b60f61088b4bdd227a71aa0
2016-11-08 15:27:29 +01:00
Max 5ee3dba39f DTX: wrap FSM signal dispatching
Make wrapper function which checks that DTX is enabled for lchan before
dispatching any events.

Change-Id: Id8b519c4af6d505ec9a4b9aadd5107bf7af53d66
2016-11-08 12:28:52 +01:00
Max 9f936344ea DTX DL: tighten check for enabled operation
Introduce dtx_dl_amr_enabled() function which checks that DTX is enabled
and FSM is allocated and use it for all corresponding checks.

Change-Id: Ifa68b641265ed14f242765c85e40da2d1021a541
2016-11-08 12:22:40 +01:00
Max 57b5fb8819 Fix tests linking with libosmocodec
Change-Id: I051302f867d70dfbc39bd52d75101eb262f87459
2016-11-08 10:26:40 +00:00
Max 203ea2c209 dtx_check.gawk: Fix false-positives in DTX check
Previously, if ONSET happened exactly at the place where next SID FIRST
or UPDATE should be it was incorrectly detected as error. Similarly,
continuos FACCH was misinterpreted as error.

Change-Id: I43fdbceea0dbdb0833c3b1cf0fc3b825803ed30e
2016-11-08 06:54:36 +00:00
bhargava 38843fbf48 Initialize parameters in osmo-trx for 11bit RACH
The parameters related to support 11bit RACH are initialized in
osmo-trx. These parameter determaine the type of the RACH received
in osmo-pcu.

Change-Id: I164d449303373d0757719d5204f4716975fb517a
2016-11-08 11:56:08 +05:30
Max acfccb3f02 DTX fix ONSET handling
* re-introduce ST_ONSET_F to guard from repetitive ONSET messages in case
  multiple FACCH occur duriing DTX silence period.
* produce ONSET event after both SID FIRST and UPDATE in case of AMR FR.
* always dispatch E_SID_F (SID FIRST) signal if in talkspurt.
* allow E_SID_* right after ONSET (zero-length talkspurt).
* add missing E_ONSET signal description.
* fix FSM transitions for AMR HR *Inhibited and First P*.
* fix incorrect return from l1if_tch_encode() in ONSET FACCH with
  incoming SID UPDATE

Change-Id: I0e9033c5f169da46aed9a0d1295faff489778dcf
Related: OS#1801
2016-11-03 12:31:37 +00:00
Max 4008ebb925 DTX DL: add AMR HR support to scheduling check
superfemto.sh: Expand log converter to use case-insensitive matching to
accommodate for spelling differences in DSP logs. Add strings/events
specific to AMR HR.

dtx_check.gawk: Remove redundand variables from output. Add checks
specific to AMR HR.

Change-Id: Icce3178605f46bbf3cad15d4eaff18a4d164ad1a
2016-11-03 12:31:37 +00:00
Max 9d102508a8 Remove obsolete define
It was moved to OpenBSC in 582e4f627674f46310a90d9061e82fb342051b42 as
it's used by both projects.

Change-Id: I8aba987e3cdaa840cf3e14913a8455b0ba759889
2016-11-02 09:29:39 +00:00
Max bce25a60f4 DTX DL: split ONSET state handling
Handle ONSET cause by Voice and FACCH separately. In case of Voice we
have RTP payload which we have to cache and send later on in next
response to L1 RTS. FACCH have higher priority so it preempts both voice
and silence alike - hence we can send ONSET immediately but still have
to track previous state in order to get back to it gracefully.

This affects lc15 and sysmo hw as there's no FSM-based DTX
implementation for other models yet.

Note: this requires patch for OpenBSC which adds FACCH buffer to tch.dtx
struct.

Change-Id: Idba14dcd0cb12cd7aee86391fcc152c49fcd7052
Related: OS#1802
2016-10-28 13:42:29 +00:00
bhargava efb4a4baeb 11bit RACH support for osmo-bts-litecell15
Based on the indication from L1, number of bits in RACH and burst
type is determined. Appropriate parameters are filled in
osmo-bts-litecell15. These parameters are sent to osmo-pcu for
processing of the RACH.

Change-Id: Ie5207a15424fb287febf74e830297531232accde
2016-10-27 19:54:53 +05:30
Max 64a2bd72f5 Add tools to check DTX operation
* superfemto.sh can parse superfemto-compatible DSP log output to
  properly sort records into MT/MO and DL/UL parts
* dtx_check.gawk can process output of superfemto.sh and check for
  common scheduling errors

This allows to check lc15 and sysmo for errors in DTX DL scheduling. As
dtx_check.gawk is generic it can be used with any other BTS hw (or
virtual BTS) as long as raw logs from this hw can be converted to simple
input format 'FN EVENT' per-line.

Change-Id: Ib1c70c4543b24c2a05a7df8eec5ce3f4eda2c02e
Related: OS#1801
2016-10-26 17:33:55 +02:00
Max ced9a5d0e2 Fix DTX DL AMR SIDscheduling logic
Previously SID UPDATE was sometimes scheduled incorrectly. Fix this by:
* avoid rounding error when computing scheduling time difference from FN
* properly saving and updating cached SID type and FN

Change-Id: I7acffae4792e7bddc2ae19a2f04ee921dc194c36
Related: OS#1801
2016-10-24 08:55:19 +00:00
Max 5a4f4d12e1 DTX HR - fix array size calculation
Use ARRAY_SIZE macro for each pointer separately.
Fix suggested by Neels Hofmeyr <nhofmeyr@sysmocom.de>.

Change-Id: I68ec1be33fb743977121d654187d85d6b8451e2b
Fixes: Coverity CID 150132
2016-10-24 08:43:30 +00:00
Max c22da59342 Extend RTP RX callback parameters
Adopt to change in libosmo-abis to accept additional parameters in RTP
RX callback function.

Change-Id: Icf41e568f041e87b38e6192af0be90c42362bfee
2016-10-21 19:53:34 +02:00
Neels Hofmeyr 068918f990 jenkins-oct.sh: fix build: typo in deps path
Change-Id: I05014e25ffc829fa2fc3973471baa28f7f5a62c9
2016-10-18 21:03:20 +02:00
Max c88a10cece Fix lc15 build
The error seems to be introduced in 21142f7898

Change-Id: I620ac6774fb47479d74bc4470ccc6edd379600ba
2016-10-18 16:40:45 +02:00
Max ebb483b69a Replace magic number with define
SDCCH occupy lchan 0..3 in combined configuration so for CCCH we've
always used lchan[4] - replace it with CCCH_LCHAN define and add
comment.

Change-Id: Ic5d742c292d638f119c6b4672120c1950adeb7f0
2016-10-18 08:08:25 +00:00
Max b0c1d21581 DTX AMR - fix buffer length check
Consider AMR-specific prefix in computing max length to avoid triggering
coverity check.

Change-Id: I2fbc468caedf08f26893457db7c7fbacef5b860c
Fixes: Coverity CID 150133
2016-10-17 08:11:01 +00:00
Neels Hofmeyr 21142f7898 msgb ctx: use new msgb_talloc_ctx_init() in various main()s
Change-Id: I31d62d5e1f0b272985fdef5013270d385c4b988a
2016-10-14 01:23:28 +02:00
Max b058778df1 DTX: fix array size calculation
Compute array size in-place and pass it to function.

Change-Id: I4cd480ceb20efc69df1b00e3c7359fcbd14c19cd
Fixes: coverity CID 1357844.
2016-10-13 11:02:59 +00:00
Max de9dbe7958 TRX: fix building with latest DTX changes
Bring up-to-speed with latest changes in OpenBSC.

Change-Id: I16b24b2cd09600e215de163e7b5baae329887c9e
2016-10-13 11:45:56 +02:00
Max babd05661d DTX DL: use FSM for AMR
Use dedicated FSM to handle all DTX DL related events:
- add explicit checks if DTX DL is enabled (fixes regression for non-DTX
setup introduced in 654175f33b)
- fix handling of AMR CMI for SPEECH frames
- add FSM for DTX DL
- sync with corresponding changes in OpenBSC's
- handle FACCH-related DTX ONSET events

This affects both lc15 and sysmobts and requires corresponding change in
OpenBSC (Change-Id: Idac8609faf9b5ced818fde899ccfc6ed0c42e8fd).

Change-Id: I74a0b42cb34d525b8a70d264135e82994ca70d31
2016-10-13 06:58:06 +00:00
Neels Hofmeyr c09e5a44c3 jenkins.sh: use osmo-build-dep.sh, log test failures
Like in libosmo-abis' and other jenkins.sh

Change-Id: I6ad88bce18677b148af63ae8f6e0ab7e3b38b5a2
2016-10-12 11:29:05 +00:00
Philipp Maier 93f3102da9 rsl: improving the log output
to show more details about the payload type and the connection

Change-Id: Ifaa253e5baed5ca364dfbc046a7cb559f106bfbd
2016-10-12 10:17:43 +00:00
Philipp Maier b8b939faa9 octphy: prevent mismatch between dsp-firmware and octphy headers
in its current statue l1_oml.c does not check if the version
number in the header files (octvc1_main_version.h) matches up
the version that is reported from the DSP during startip. This
patch ads a check to make sure that the currently loaded
firmware and the headers used during compile time match. If
a mismatch is detected, osmo-bts exits immediately.

Change-Id: Icba5756517d632d53b129c5ce1a1dab4936dab91
2016-10-12 09:57:18 +00:00
Max 4ca5be766c Move copy-pasted array into shared header
Change-Id: I377ece2845830e3defab2d515f44b629ce5aed8e
2016-10-12 09:30:06 +00:00
Max 9f9b96a67b DTX: fix conversion from fn to ms
Previously FN was converted to millisecondss incorrectly due to wrong
conversion between FN and a number of voice samples. The conversion
should be based on following:
* there are 12/13 useful frames for audio in TCH
* there is 1 RTP packet per 4 frame
* there are 160 samples per RTP packet

Fixes: OS#1801
Change-Id: I9cc70cacabde98621aa892cee74f4ac461645093
2016-10-11 18:20:15 +02:00
Yves Godin c1b86d80d1 DTX: fix 1st RTP packet drop
Use "impossible" dummy value to initialize last_fn to prevent dropping
of 1st RTP frame due to timestamp jump.

Fixes: OS#1803
Change-Id: I485af21f6761048d12dc7f5552fcdd46daf786ed
2016-10-11 15:50:29 +00:00
Philipp Maier 8b39ff8bcf octopy: fixing renamed constant
The constant cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_UNUSED in header
file octvc1/hw/octvc1_hw_api.h has been renamed to
cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_IDLE. This commit adds an ifdef
decision in to code to ensure that older header files will still work.

Change-Id: I4c0b976d29689ace06741c5943434fc33ee2df14
2016-10-06 10:12:04 +00:00
Philipp Maier f5494e84e8 octphy: reintroducing multi-trx support
The multi-trx had to be removed because of build conflicts
with octphy header that lack the struct members for needed
to support multi-trx.

For details see the following revert-commits:
ed6b48e4a5
c9a1f284ac

This commit reintroduces multi trx support and ads an ifdef
decision to ensure that header files without multi-trx
support still work.

Change-Id: I7f9b2906cc149c817183745b4c96bcc7f9ebdad0
2016-10-06 09:48:02 +00:00
Neels Hofmeyr 3f192f2291 configure: check for pkg-config presence
Change-Id: Ifee0434dfa275f9faa517c740fd8577930f37188
2016-10-02 13:29:21 +00:00
Neels Hofmeyr fac02d3d75 build: be robust against install-sh files above the root dir
Explicitly set AC_CONFIG_AUX_DIR.

To reproduce the error avoided by this patch:

  rm install-sh        # in case it was already generated.
  touch ../install-sh  # yes, outside this source tree
  autoreconf -fi

This will produce an error like

  ...
  configure.ac:16: error: required file '../ltmain.sh' not found
  configure.ac:5: installing '../missing'
  src/Makefile.am: installing '../depcomp'
  autoreconf: automake failed with exit status: 1

See also automake (vim `which automake`) and look for 'sub locate_aux_dir'.

Change-Id: I02153ad52faf1465e9f7821378e04118f17352d2
2016-10-02 13:29:21 +00:00
Max 5f2e2de84f DTX: send AMR voice alongside with ONSET
When ONSET event happens (either via Marker bit or due to unmarked
talkspurt) we should first send Onset event to L1 and than send voice
data in response to the same PH-RTS.ind.

Change-Id: I2a7b89430ca49eee4a350c5f980bd6bcbc386347
2016-09-30 19:13:08 +02:00
Max 067ef3f1ce DTX: move ONSET detection into separate function
Move code from tch.c (lc15, sysmo) into generic function which:
- check if talkspurt is happening
- cache SID if necessary or invalidate cache
- fill in CMR & CMI prefix

This also fixes the problem when SID FIRST was cached without sending
just like SID UPDATE instead of being sent right away.

Change-Id: I6c7016a54749abadeef4fd4f5b6f750b256fb916
2016-09-30 19:09:04 +02:00
Max 9959f45d90 DTX: further AMR SID cache fixes (lc15, sysmo)
* consolidate AMR CMR and CMI handling in common/amr.c
* use it in save_last_sid()
* remove dead code
* properly compute RTP payload length for AMR
* use save_last_sid() for FR & HR as well
* invalidate cached SID if SPEECH frame is received

Fixes: OS #1800, #1801
Change-Id: I5a1c1ad0b0a295a50e67775a4db85f1d331755ed
2016-09-30 18:57:00 +02:00
Max 7dffd553df DTX: move scheduling check inside repeat_last_sid
Note: this also require changes to properly link against libosmocodec -
see 2bb65be159dfdabf664fec569b343320301701b0 in libosmocore.

Change-Id: I96594cf3aa1013d505bd20069d5bf261d9a2aefb
2016-09-30 16:50:47 +02:00
Max 94fa25295f LC15: Clarify msgb ownership / fix memory leaks
This is similar to 21b020b336 which
changes the way msgb is allocated/freed in sysmobts.

Change-Id: I393828a7b1fb5927453ee25f54d605a5d3ea7087
2016-09-30 11:36:29 +02:00
Max 1559678fa2 DTX: remove misleading comment
There's no SID stored in UL direction so there's nothing to remove.

Change-Id: I3f587a66406bc6a02b859e826f4903641fcc5a15
2016-09-26 16:31:25 +02:00
Max 654175f33b DTX: check Marker bit to send ONSET to L1
If Marker bit is set than it's a talkspurt which we have to explicitly
indicate to L1 by first sending ONSET message and than actual voice
data in a separate message.

This change affect sysmobts and LC15 hw.

Change-Id: I88c41568bcb0d82699f617adc4ad192603dd1bb6
Related: OS#1750
2016-09-24 15:09:31 +02:00
Neels Hofmeyr eb08a87be5 sysmobts_mgr, lc15bts_mgr: fix tall context for telnet vty
Instead of passing the msgb ctx to telnet_init(), pass the *mgr* ctx.

Change-Id: I213fe52648a1937d8f8c1730ce787e42f0add75f
2016-09-24 03:36:22 +00:00
Philipp Maier a570e05ec8 octphy: Fixing band selection for ARFCN 0
There is now an exception for ARFCN 0 in osmocom_to_octphy_band to
distingush ARFCN 0 (E-GSM) and 1-124 (P-GSM).

Change-Id: If012f31121e9d0d45b36459807c5f290aa17374f
2016-09-24 03:25:01 +00:00