Commit Graph

1018 Commits

Author SHA1 Message Date
Max c3fb0dcc8c DTX: add support for AMR/HR
Change-Id: Id744b67904011eb328b24c46a645b3eb53525c04
Fixes: OS#1562
2016-06-18 11:34:51 +00:00
Neels Hofmeyr 274d29bedd debug log: log TS pchan type on connect
A whitespace error is fixed along the way.

Change-Id: Iff373ba934937435a175ed3a5d9cfb6f2514735d
2016-06-17 15:50:48 +00:00
Neels Hofmeyr 7efc2f3c5b debug log: log lchan state transitions
Change-Id: Id20f61ef535f4ea049da6579e41eb98f31238d23
2016-06-17 15:50:48 +00:00
Neels Hofmeyr b231e0f6cd error log: two minor clarifications
Change-Id: I95e4331f51f650d5077eb3a8f897f754d5d2b779
2016-06-17 15:50:48 +00:00
Neels Hofmeyr 63b296bdd9 dyn PDCH: complete for sysmo-bts: implement bts_model_ts_*()
Implement bts_model_ts_disconnect() by sending an MphDisconnect message to L1.
Pass a disconnect callback to invoke dyn_pdch_ts_disconnected() in
common/rsl.c.

Implement bts_model_ts_connect() by calling ts_connect_as(). Pass a connect cb
to invoke dyn_pdch_connected() in common/rsl.c.

Change-Id: I61709fdf6b093689a6d3a046f67db6d02f1296ae
2016-06-17 15:50:48 +00:00
Neels Hofmeyr 57fc1124e1 dyn PDCH: sysmo: handle TCH/F_PDCH init like TCH/F
Change-Id: Ic62921e17c55aeb26235b70a8325d6fea1716cef
2016-06-17 15:50:48 +00:00
Neels Hofmeyr 294fbe104b dyn PDCH: sysmo-bts/oml.c: add ts_connect_as(), absorbing ts_connect() guts
For upcoming dyn PDCH switching, I want to be able to set the pchan dynamically
upon ts_connect() and not continue with OPSTART ACK, but with the dyn PDCH.

Thus recoin ts_connect(ts) to ts_connect_as(ts, pchan, cb) and leave
ts_connect() as a thin wrapper to leave init code unchanged.

Change-Id: I09cc794cb424e17411e608c65f2b68e2f2544e07
2016-06-17 15:50:48 +00:00
Neels Hofmeyr 24a31cfe43 dyn PDCH: implement main dyn PDCH logic in common/
React on IPAC PDCH ACT and DEACT messages and invoke the PCU and bts_model_ts_*
APIs to effect switchover. The dyn PDCH interaction is described in the comment
to rsl_rx_dyn_pdch(), the main entry point for PDCH switchover.

In case the bts_model_ts_* are not implemented (or return other errors),
reply with an IPAC PDCH ACT/DEACT NACK.

Add callbacks that mark steps in the PDCH switchover process,
dyn_pdch_ts_disconnected(), dyn_pdch_ts_connected() and dyn_pdch_complete().

Add hooks in l1sap.c on channel activation and release confirmation, to call
dyn PDCH callbacks.

BTS dyn PDCH implementations should invoke dyn_pdch_ts_disconnected() and
dyn_pdch_ts_connected() when bts_model_ts_disconnect() or
bts_model_ts_connect() are called, respectively. (upcoming for sysmoBTS)

Change-Id: Id2f5f77121a65d6c14eac127b3d4fb50e97a77ab
2016-06-17 15:50:48 +00:00
Neels Hofmeyr 0d10f0e482 dyn PDCH: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flags
According to the PDCH Active flag, handle a TS as TCH/F or PDCH.

Change-Id: I06ca26a99f052c6a2ae953fe355fd1196f66e501
2016-06-17 15:50:47 +00:00
Neels Hofmeyr f8bf95fa6b dyn PDCH: pcu_tx_info_ind(): handle TCH/F_PDCH in PDCH mode
Introduce a static function to encapsulate the decision whether a TS is
used for PDCH. Depending on the ts->flags, handle a TCH/F_PDCH TS exactly like
a standard PDCH TS.

Change-Id: Ic72fd06ecc99609823efa3edcf773007cc514b5b
2016-06-17 15:50:47 +00:00
Neels Hofmeyr e6cc04827a dyn PDCH: conf_lchans_for_pchan(): handle TCH/F_PDCH
Depending on the PDCH active flag, handle a TCH/F_PDCH like TCH/F or PDCH.

Change-Id: Ifc5561f8e2db172bb692ba26bdeae2fd675d6ec5
2016-06-17 15:50:47 +00:00
Neels Hofmeyr 9375aa9a68 dyn PDCH: add bts_model_ts_connect() and _disconnect() stubs
Enhance bts_model_ API in preparation of dyn PDCH switching. These will be used
to re-connect a TCH/F_PDCH TS in a different mode: either as TCH/F or as PDCH.

All implementations so far return -ENOTSUP, and thus will cause a IPAC PDCH ACT
or DEACT *NACK* to be sent to the BSC as soon as these messages are handled.

Also add stubs in tests.

Change-Id: I21e60c028a1333431c3ed000f788b654d1170b0d
2016-06-17 15:50:47 +00:00
Neels Hofmeyr 6b60611a4d fix compiler warning: add missing case (PHY_LINK_CONNECTING)
Change-Id: I7979e10551023c1f52f04b4e93ea1706cf0bef39
2016-06-17 15:34:48 +00:00
Neels Hofmeyr bc9c42663d fix compiler warning: printf format for sizeof()
Change-Id: Id600c5a34ab261736f7595ab2e36e3a30d434175
2016-06-17 15:34:42 +00:00
Neels Hofmeyr 3686005180 add missing DSUM entry to bts_log_info_cat
This allows setting the 'sum' log level to debug in osmo-bts.cfg.

Change-Id: I1fe1a483f07f0384815f01877f86ffc192052f72
2016-06-17 15:32:03 +00:00
Neels Hofmeyr a8168271eb dyn PDCH: cosmetic: lchan_to_GsmL1_SubCh_t(): add case for TCH_F_PDCH
It is cosmetic since the 'default:' case already caught TCH_F_PDCH, but it's
good to mention all expected pchans explicitly.

Change-Id: I5aef84209e46c9288f6adf0730178fe08f26764f
2016-06-17 04:26:20 +02:00
Neels Hofmeyr e951042475 dyn PDCH: rsl rx dchan: also log ip.access message names
Before, only standard ABIS RSL message names were logged, add ip.access
specific ones.

The IPAC_PDCH_ACT and _DEACT msgs are received with an ABIS_RSL_MDISC_DED_CHAN
discriminator, and not with _MDISC_IPACCESS like the others. Thus rsl_rx_dchan()
should be able to log ip.access message types properly.

Change-Id: I9db6826b515bf565fc7ae24fc0760b60928cc89f
2016-06-17 04:24:57 +02:00
Neels Hofmeyr 65efa691f8 oml, Set Chan Attr: treat unknown PCHAN types as error
Change-Id: Id79585993df15362ba0e1271d03302597182ceff
2016-06-17 01:31:03 +00:00
Neels Hofmeyr 6ab1ed580d fix typo in error message ('at lEast')
Change-Id: I6ac3606157dc6c81ed17cd6d26227da8ae26c49f
2016-06-17 01:30:08 +00:00
Neels Hofmeyr 703c2d6eb8 pcu_sock: add pcu_connected() to query PCU availability
Will be used in upcoming dyn PDCH switching.

Change-Id: I8031089ad5e9cb9690ca7e22facc53438f28e12a
2016-06-17 01:24:25 +00:00
Max ecd5bc2aef TRX: Add vty command to power on/off transceiver
Add vty command (under "phy X instance Y" hierarchy) to manually send
POWERON or POWEROFF command. It's useful for debugging issues related to
BTS/TRX initialization.

Change-Id: I6dfebaf118cdf5ad144516b2b839b17350a73ce4
Related: OS#1648
2016-06-16 13:39:42 +00:00
Max 7cc3c3156e Fix OML activation
Previously software activation could have been reported multiple times
which broke proper BTS init. Introduce guard variable to ensure
reporting happens only once.

Note: this is just minimal workaround - ideally proper OML state machine
should be implemented.

Change-Id: Ifffbdb756bc5d2864f985c01a3299b839c4de7af
Related: OS#1648
2016-06-16 12:43:44 +02:00
Minh-Quang Nguyen 58e4e18206 LC15: TRX nominal TX power can be used from EEPROM or from BTS configuration
Change-Id: I173f4126cea41959d48def07bff25fcd29894b7e
2016-06-15 09:45:02 +00:00
Minh-Quang Nguyen cbbce0be09 LC15: Hardware changes:
- Change system devices path
- Remove obsoleted sensors and add new sensors
- Change TRX and sensors numbering to 0,1 instead of 1,2 (JFD)

Change-Id: I5172daf68d3145a6398e37df87df21b0e5affe42
2016-06-15 09:44:58 +00:00
Minh-Quang Nguyen d0d2c9217a LC15: Bring back DSP trace argument
Change-Id: I822651d9ba4959ce5885a2c0362f1ea583b724da
2016-06-15 09:44:51 +00:00
Neels Hofmeyr 7158c2ed08 sysmo: add L3 handle to l1prim messages
Place a layer 3 handle into GSM L1 messages to better match up confirmations to
respective requests. This handle is a uint32_t transparently returned in the
confirmation messages, so a match-up is easy to add.

So far, a GSM L1 confirmation message received for a preceding L1 Request was
matched only by the prim_id. That meant that only one instance of the same
primitive could be waiting for a confirmation at any given time, or the
responses would get mixed up: the struct wait_l1_conf instances entered into
the fl1h->wlc_list queue would be returned to a possibly mismatching
confirmation handler. (Seen during testing of dyn pdch switching.)

Send the hLayer3 handle out via prim_init(), using new static functions to
produce handles on different scopes:

* l1p_handle_for_trx()
* l1p_handle_for_ts()
* l1p_handle_for_lchan()

(These could possibly move to a more general .h/.c file later.)

Remember the hLayer3 handle in

* struct wait_l1_conf.

Match the incoming confirmations' and stored hLayer3 handles up in, and remove
a now obsolete comment from:

* is_prim_compat()

Since the hLayer3 members are at different byte offsets in
GsmL1_Prim_t.u.*, use large switch statements to set/get the value:

* In prim_init(), extend existing switch statement to set in GsmL1_Prim_t.
* Add l1p_get_hLayer3() to retrieve from GsmL1_Prim_t (could possibly move to a
  more general .h/.c file later).

Change-Id: Ie4533c6cbc160318917e7a672ab6f9a848f01d1b
2016-06-15 09:30:24 +00:00
Holger Hans Peter Freyther a55b166c6c sysmobts: Add the barebox boot state reservation
We are using up to 48 (actually only 8) bytes to manage the boot
state of the device. Add it to the eeprom reservation. It turns out
the current padding was too large (37 + 84 don't end at 120).

Change-Id: I4c1de5925577f1d0b7b5cc08529642ffa333d7de
2016-06-15 09:33:23 +02:00
Minh-Quang Nguyen 3f3f34ba52 common/abis.c: fix 100% CPU usage after disconnecting OML/RSL link (Bug #1703)
Change-Id: I24605b8a6d4e778a3280ffba8bc1fc7a284ce12d
2016-06-14 21:57:57 +00:00
Max a10ac248c6 DTXu: mark beginning of speech burst in RTP
Set Marker bit in RTP header to mark the beginning of talkspurt.

Change-Id: I3dd70ad8ff94356e3c3cc5458255f6c23534783e
Related: OS#1562
2016-06-14 10:19:13 +00:00
Max 60970056c8 DTXd: store/repeat last SID
Store last SID received over RTP and repeat is if necessary (no new SID
or SPEECH frames) according to codec-specific scheduling rules.

Related: OS#1563
Copy-paster from I4d23846a27d3dbd2a6e75e481c1efcdb2a85f305 for LC15.

Change-Id: I29acea6e8bbf426330ce52554a48afb5d2ef1679
2016-06-14 10:18:59 +00:00
Max 8ecadc66ce DTXd: store/repeat last SID
Store last SID received over RTP and repeat is if necessary (no new SID
or SPEECH frames) according to codec-specific scheduling rules.

Change-Id: I4d23846a27d3dbd2a6e75e481c1efcdb2a85f305
Related: OS#1563
2016-06-14 10:18:59 +00:00
Max 9302abe054 Fix debug output
Previously frame number was not saved in case of PRIM_TCH rendering many
debug statements with g_time useless.

Copy-paste from ef30f50d5d.

Change-Id: I952b39458d921622d5964cbdcc2f4e45ff9ea951
2016-06-14 10:18:59 +00:00
Jason DSouza 45e97ac59a Close TRX session before opening new one
This fixes the unstable behavior (BTS loosing subscribers after some
time) in case previous run of osmo-bts was interrupted (with ctrl+c for
example).

Change-Id: Ie2119b0b566d01f0e70b38c8a149fecb47def38d
2016-06-14 10:18:43 +00:00
Max 3a1f1b8e91 octphy: Use the app. info. defaults as base
Similar to 91565b2d51 use default
initializers.

Change-Id: Ib813249f4295b034eb65658e3f43b4fe86862cf0
Fixes: Os#1642
2016-06-13 14:56:44 +02:00
Max 4582222757 Use libosmocodec for AMR RTP
Use libosmocodec function to parse RTP with AMR payload in sysmoBTS and
LC15. This replaces "manual" parsing of AMR frame with function covered
by test suite and makes adding DTXd support easier.

Related: OS#1563
Change-Id: I1464f9a12e3f92926d03d5dd5d18e8f0f7206dd9
Reviewed-on: https://gerrit.osmocom.org/204
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-06-12 15:43:19 +00:00
Max c1586388dc Add DTXd support for sysmoBTS and LC15
* set/clear DTXd activity indicator for measurement reporting
* set DTXd status based on information from RSL

Related: OS#1563
Change-Id: I148a75725c4e5089b6f2da6e9adcbe94170d3257
Depends-On: I4a033b03fcd0deb4db7a38273b5407511dbf1d6c
Reviewed-on: https://gerrit.osmocom.org/220
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-06-12 15:42:34 +00:00
Max 51bfebec39 Fix RTP timestamps in case of DTX
Compute RTP user_ts adjustment based on the difference between current
and previous FN instead of hard-coded value.

Change-Id: If1677ddcf754b29990ff7cd846e11c32e3d30b33
Related: OS#1562
Reviewed-on: https://gerrit.osmocom.org/196
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-06-07 15:32:39 +00:00
Max ef30f50d5d Fix debug output
Previously frame number was not saved in case of PRIM_TCH rendering many
debug statements with g_time useless.

Change-Id: Ib8d8c919862d0de8e2ebf7753c2592e0d91b09c5
Reviewed-on: https://gerrit.osmocom.org/195
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-06-05 09:35:23 +00:00
Max 201b424b73 Use libosmocore function for uplink measurements
Related: OS#1563
Change-Id: Ide47e8e69e0d2d5859c5249b22f4bad22c18aa57
Reviewed-on: https://gerrit.osmocom.org/108
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-05-31 11:58:08 +00:00
Daniel Laszlo Sitzer 0778cd488a octphy: Update outdated config param name in error message.
Change-Id: I45b8bc09c9aabacc5b908450fe574b5802b88be8
Reviewed-on: https://gerrit.osmocom.org/129
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-31 09:30:55 +00:00
Max 21fc6e45fb LC15: properly initialize unmapped phy instances
Fixes: OS#1665
2016-03-22 19:38:39 +01:00
Max 925fcf48ed LC15: add stubs for phy link/instance defaults 2016-03-22 19:37:03 +01:00
Max 06968beab9 octphy: fix for multiple trx with more than 1 dsp
Explicitly store and use "center" arfcn used by each dsp (1 dsp
corresponds to 1 phy link).
2016-03-21 17:20:11 +01:00
Max c4fc00d851 octphy: add support for multiple trx ids 2016-03-18 15:30:30 +01:00
Max 3044a26d71 octphy: use octasic's routines for debug output 2016-03-18 15:29:54 +01:00
Max b857f27704 Fix typo in error message 2016-03-17 18:23:55 +01:00
Max 9591b6c253 octphy: add missing include to fix the build 2016-03-17 16:23:07 +01:00
Max b2b1112a6e Add explicit check for SI2quater index and count
Right now we do not support multiple SI2quater messages, so return error
if either index or count is non-zero.
2016-03-17 13:50:31 +01:00
Max f3ee66207d Fix SI2ter scheduling
According to 3GPP TS 05.02 § 6.3.1.3 SI2ter messages should be scheduled
in FN with TC=4 only if SI2bis messages are also available.
2016-03-17 13:48:16 +01:00
Holger Hans Peter Freyther 0be80aa2d1 octphy: Enable TCH/H mode and begin testing
Upcoming releases will support TCH/H and we should start to test
the DSP->RTP code.
2016-03-16 09:17:04 +01:00
Max d5c658b22e Fix copy-paste issue
This issue prevented scheduling of SI 2quater messages.
2016-03-11 22:10:21 +07:00
Holger Hans Peter Freyther 91565b2d51 octphy: Use the event defaults as base
Bad parameters are passed to the event structure and the default
initialization should happen.
2016-03-10 16:15:51 +01:00
Max cb20c83323 Fix ocmo-bts-octphy interaction with OsmoPCU
Previously osmo-bts-octphy have not provided in-band presence
information which cause off-by-one errors and misinterpretation of
ph_data_ind by PCU. This fixed now by adding support for explicitly
passing PH-DATA presence info. Corresponding check and in-band passing
of presence information are removed.

Note: this requires libosmocore version with osmo_ph_pres_info_type
support integrated.

[hfreyther/max: Remove + 1 from the decoded length]
2016-02-22 13:57:54 +01:00
Harald Welte 94bb3769f3 scheduler: Fix ARRAY_SIZE() in trx_sched_init()
We want the size of the array, not of the pointer to the array.

Found by coverity (CID 1351422).
2016-02-15 20:16:07 +01:00
Harald Welte e81cc6a158 use unsigned int to compare wih ARRAY_SIZE
This is not really an issue, but makes coverity happy (CID 1351422).
2016-02-15 20:13:04 +01:00
Harald Welte 69b959e557 sysmobts_vty: Fix null-check for pinst
There was a copy+paste error, checking for plink but we should check for
pinst.

This was found by coverity (CID 1351424).
2016-02-15 20:11:43 +01:00
Harald Welte 81cc8cdba5 LC15: remove bogus check_for_ciph_cmd() copy 2016-02-15 14:28:19 +01:00
Harald Welte e634fd256b LC15: set nominal transmit power of 37dBm for all TRX 2016-02-15 14:28:05 +01:00
Harald Welte 433863e4c9 LC15: Fix 'make dist' (missing include files) 2016-02-15 14:28:00 +01:00
Harald Welte 634c3e4648 Use consistent naming of binaries accross BTS models
Let's use one systematic naming schemes for all BTS models.

osmobts-trx -> osmo-bts-trx
sysmobts -> osmo-bts-sysmo
lc15bts -> osmo-bts-lc15
2016-02-15 14:27:57 +01:00
Harald Welte a9a7120c82 make PCU socket and telnet port configurable
In some cases we'd like to run multiple instances of osmo-bts on a
single machine.  This is the case where we a multi-TRX PHY is to be used
for several BTSs, or in case osmo-bts-trx has multple SDRs attached.

This wa currently prevented by having a hard-coded PCU socket path
and telnet port, which are now configurable via VTY / config file
itself.
2016-02-15 14:27:52 +01:00
Harald Welte 5dfb115eaf declare pcu_direct in pcu_if.h 2016-02-15 14:27:47 +01:00
Harald Welte c6723c8206 move auto-band configuration commands to common/vty.c
It remains up to the individual BTS hardware models to decide
whether or not to register those commands (depending on whether they
support the feature) via cfg_bts_auto_band_cmd / cfg_bts_no_auto_band_cmd
2016-02-15 14:27:43 +01:00
Harald Welte 3b4d9e7c07 LC15: Call l1if_reset() after l1if_open()
We want to start talking to the L1 from the point the PHY link has
been opened, and not only once an OML connection has been established.
2016-02-15 14:27:36 +01:00
Harald Welte 53e0291df6 LC15: Remove clk_cal (another unused struct member) 2016-02-15 14:27:32 +01:00
Harald Welte e9a17292e8 LC15/sysmobts: Don't try to refer to fl1h from PHY config
At the time the phy link / phy instance level VTY configuration
commands are parsed, we did not yet call l1if_open() and thus
pinst->u.{lc15,sysmobts}.hdl == NULL.

PHY or PHY instance specific configuration must thus be stored inside
the phy_link or phy_instance itself, and not inside the (not yet
existing) handle.

We solve this by moving around some parameters:
* clk_use_eeprom/clk_cal/clk_src/calib_path get replicated in
  phy_instance
* min_qual_{rach,norm} are moved into the generic part (which means
  that osmo-bts-octphy and osmo-bts-trx should also implement them)
2016-02-15 14:27:29 +01:00
Harald Welte 9b5cff87ec LC15: Remove unused clk_use_eeprom and clk_src fields
this is part of the copy+paste legacy from sysmobts and can be removed
as it is not used.
2016-02-15 14:27:25 +01:00
Harald Welte 9684099ae9 sysmobts/LC15: Fix startup-time DSP trace flage configuration
Due to the changes introduced by the phy_link API, it's not easy to set
the default DSP trace flags via a command line argument anymore.  We now
rather introduce a persitent VTY configuration command, by which the
default DSP tracing configuration can be set (for each PHY).

The persistent trace flags are stored in the phy_instance, while the
current operational run-time flags are in fl1h->phy_instance.
2016-02-15 14:27:20 +01:00
Harald Welte 38933afdd9 introduce + use new generic vty_get_phy_instance()
this function is intended to be used by VTY commands that need to
resolve a given PHY interface.
2016-02-15 14:27:16 +01:00
Harald Welte 6a0f0f9e21 LC15: fix compiler warning against more recent libosmovty 2016-02-15 14:27:12 +01:00
Harald Welte 4dd8bd84a4 LC15: Fix printed msgq file names in error messages 2016-02-15 14:27:08 +01:00
Harald Welte 8f0266b885 LC15: cosmetic whitespace fixes 2016-02-15 14:27:04 +01:00
Harald Welte 1dcb97eaa3 LC15: port litecell 1.5 support to recent osmo-bts master
This includes changes required for
* shared main() function accross all BTS models
* use of the new phy_link / phy_instance infrastructure as the basis
  for true multi-TRX operation
2016-02-15 14:26:55 +01:00
Harald Welte 29a0197ead LC15: configure.ac: Allow specifying an alternate include-dir
The user can now use ./configure --with-litecell15=/my/local/path
2016-02-15 14:26:51 +01:00
Yves Godin b936bd7162 LC15: use talloc pool for msgb and ortp library
by using a talloc pool, we avoid having to go back to the libc
malloc pool all the time.  The msgb allocations and libortp allocations
happen quite frequently during processing and show up as one of the
high priority items in osmo-bts profiles on sysmoBTS with 14 concurrent
TCH/H calls (highest load scenario).

talloc still consumes significant CPU, this is mostly due to the
zero-initialization of all the associated buffers.  Strictly speaking
we shouldn't need this, but any change there would require lots of
testing, as there might be hidden assumptions in the code?

In some percentage of cases, talloc still seems to fall back on malloc
for msgb allocations, which is currently a bit of a mystery.  The pools
certainly are large enough, talloc_reprt() rarely reports more than a
few tens of kilobytes used by the msgb pool.

From 2ecbf87130
2016-02-15 14:26:44 +01:00
Yves Godin 6e1aed4b23 LC15: Disable DSP trace flags by default 2016-02-15 14:26:38 +01:00
Yves Godin 2a711887b7 LC15: Add initial support for the NuRAN Wireless Litecell 1.5
This commit adds basic support for the Litecell 1.5. Multi-TRX is not
supported yet. Instead, multiple instances of the BTS can be launched
using command line parameter -n <HW_TRX_NR> to specify if TRX 1 or
2 must be used by the bts. Note that only TRX 1 opens a connection to
the PCU. Full support for GPRS on both TRX will come at the same time
than the multi-TRX support.

The BTS manager has been adapted to match the new hardware but otherwise
it has not been improved or changed compared to the one used on the
SuperFemto/Litecell (sysmobts).
2016-02-15 14:26:33 +01:00
Harald Welte 5a945dad0c sysmobts: make clock calibration eeprom default (again?) 2016-02-15 14:23:57 +01:00
Harald Welte b1d2dd316f abis.c: Fix segfault on OML link loss
When the OML signalling link is lost, first set bts->oml_link = NULL,
then iterate over the RSL links and close them.  Closing the RSL link
will cause a OML state change message to be sent, which in turn tries
to use the no-longer-existing OML link.

The code should be cleaned up further to distinguish which signalling
link was lost, and actually communicate a RSL(only) loss to OML.

But for now, it's best to simply close down all links and terminate
osmo-bts to ensure all state is properly reset and recovered.
2016-02-15 14:23:18 +01:00
Harald Welte a02bf125ac port sysmobts to phy_link/phy_instance abstraction 2016-02-15 14:18:59 +01:00
Harald Welte fcef6b2b52 don't touch OML MO when PHY link is established
It seems the right thing to do: Once we know a PHY link is established,
the associated OML managed objects should change their state
accordingly.  However, given all the hackery we do with MO states, this
actually breaks things, rather than helping.  So I'm disabling that part
for now, but this needs to be re-visited at some point.
2016-02-15 14:18:59 +01:00
Harald Welte d784e50747 Introduce new phy_link and phy_instance abstraction
This way we can model a flexible mapping between any number of PHYs,
each having multiple instances, and then map BTSs with TRXx on top of
those PHYs.
2016-02-15 14:18:59 +01:00
Harald Welte 1a5b00ebe2 TRX: Move scheduler to src/common
This is the final step to make the L1 scheduler generally available
to other BTS models than OsmoTRX.
2016-02-15 14:17:55 +01:00
Harald Welte 48726242ad TRX: scheduler: Remove dependency to trx_if.[ch] 2016-02-15 14:17:55 +01:00
Harald Welte 67311cc1f2 TRX: scheduler: Move trx_sched_clock() to scheduler_trx.c
This funciton (and associated static functions) are TRX specific,
and scheduler.c should only contain generic code.
2016-02-15 14:17:55 +01:00
Harald Welte b6b42d150d TRX: scheduler: don't access l1h->config from scheduler 2016-02-15 14:17:55 +01:00
Harald Welte 11db925f15 TRX: call trx_loop_sacch_clock from TRX scheduler backend
this removes the dependency of scheduler.c on loops.h
2016-02-15 14:17:55 +01:00
Harald Welte 2b0e209029 TRX: split scheduler in generic part and backend part
the backend is performing the actual encoding and decoding functions,
while the generic part constsits of the TDMA structures and generating
the RTS.ind
2016-02-15 14:17:55 +01:00
Harald Welte 5538f5cff8 TRX: factor out the scheduler from remaining code
The L1 scheduler is a generally useful component that is unfortunately
tied quite a bit into the OsmoTRX support.  Let's try to separate it out
by having separate per-trx/per-ts/per-chan data structures pre-fixed
with l1sched_

Using this patch it should be one step easier to use the scheduler for
other BTS models, such as the intended upcoming virtual BTS.
2016-02-15 14:17:55 +01:00
Harald Welte 5f17720fcd fix migration of check_for_ciph_cmd() from sysmobts to l1sap
During the L1SAP related changes, somehow an old version of
check_for_ciph_cmd() was re-introduced, which didn't store the N(s) as
part of the lchan.  To make things worse, the old code was still present
in the sysmobts specific part, but never executed.
2016-02-09 13:59:55 +01:00
Harald Welte 5d212055b7 L1SAP: Ensure we don't process MPH-TIME.indication on TRX != C0 2016-02-03 18:45:39 +01:00
Harald Welte 6f9beedc48 fix compile warnings 2016-02-03 18:45:39 +01:00
Harald Welte 131ab36e3a abis: Add a queue of OML messages
When the oml_link is down or not yet established, we currently lost
any OML messages that were scheduled for transmission to the BSC.  Let's
prevent that by keeping a queue of OML messages, which is drained at the
time the OML link comes up again.
2016-02-03 18:45:39 +01:00
Harald Welte 2ed116efec Revert "oml: temporary debug hack"
This reverts commit c623c4e589.

That's a commit from 2012, and it was never needed ever since.
2016-02-03 18:45:39 +01:00
Holger Hans Peter Freyther 5f8c85bf9c octphy: Look-up the right timeslot and then the logical chan
Use the right identifier for the timeslot and not the trx number
which would always use ts==0 on the first trx. This should fix
ciphering issues for TS>0 (e.g. SDCCH8 on TS==1)
2016-02-03 18:29:00 +01:00
Harald Welte 3ca59512d2 OML: Ignore T200 settings by BSC for now
It seems that once we start to respect the T200 values as specified by
the BSC, we run into all kinds of issues with LAPDm re-transmissions,
REJ frames, unexpected supervisory frames and the like.

The libosmogsm LAPDm T200 defaults of 1s/2s are proven to "work" (i.e.
not expose the above behavior), so let's revert to them until the root
cause of this problem is determined.
2016-01-25 20:46:56 +01:00
Harald Welte 111a02f214 lapdm: Add DEBUGP statement about T200 values being set for lchan 2016-01-25 20:46:53 +01:00
Harald Welte 0d19e48487 Fix T200 default values
The T200 default values should be in milli-seconds (as the variable name
indicates).  They are not expected to be divided by the TS 12.21 OML
dividers for T200.

This change doesn't really make a difference with OpenBSC, as the BSC
always sets its own T200 values via OML, overwriting the defaults here.
2016-01-25 20:46:51 +01:00
Holger Hans Peter Freyther 728448a7f1 main: Return something from the method
Fixes: CID#59923
2016-01-23 10:25:24 +01:00
Harald Welte 0db18d030d OCTPHY: fix 'make dist' (missing header files) 2016-01-22 09:44:17 +01:00
Harald Welte 0048a788dd Merge branch 'laforge/common-main' 2016-01-22 09:33:54 +01:00
Harald Welte 611ef23700 merge bts-specific main function into common/main.c:bts_main()
This removes a lot of copy+paste duplication between different BTS
models.
2016-01-22 09:09:09 +01:00
Harald Welte a0192b859b Add new bts_model_ctrl_cmds_install()
This is one step in making the main() functions of different
BTS models more similar, so we can share one code rather than multiple
copies of it.
2016-01-22 09:09:09 +01:00
Harald Welte ec3be11ec6 common/support.c: Remove unused file 2016-01-22 09:09:08 +01:00
Andreas Eversberg 69fc57b028 ABIS: Support for multiple RSL connections 2016-01-22 09:09:02 +01:00
Harald Welte 32d681ab98 OCTPHY: Don't have files in EXTRA_DIST that don't exist (anymore)
This fixes a 'make dist' issue.
2016-01-21 16:32:14 +01:00
Harald Welte e60b9d1de6 Make T200 default initialization even more robust
There's no need to use memcpy(), which adds the risk that the types of
source and destination are not the same (see previous commit). Iterating
over the array and assigning each element is more robust.
2016-01-17 21:10:13 +01:00
Harald Welte 3d431bb4eb Fix T200 default values
t200_ms is an unsigned int [7] array, while the oml_default_t200_ms was
an uint8_t[7] array, which we memcpy() to the former as default
initializer.  Fix this by turning oml_default_t200_ms into unsigned int,
too.
2016-01-17 21:10:09 +01:00
Harald Welte f9de18ea15 TRX: the L1SAP queue contains mac blocks, not bursts (cosmetic) 2016-01-16 17:49:13 +01:00
Harald Welte 97cb71971a TRX: Don't hard-code 23 bytes, use GSM_MACBLOCK_LEN 2016-01-16 17:49:08 +01:00
Harald Welte dd562d84ba TRX: Don't use magic numbers when we have #defines 2016-01-16 17:49:04 +01:00
Harald Welte 773ab8b2c5 TRX: replace some more 2715648 magic numbers with GSM_HYPERFRAME 2016-01-16 17:48:57 +01:00
Harald Welte 69ace680dd TRX: scheduler: whitespace cleanup 2016-01-16 17:48:53 +01:00
Harald Welte 1bdd08d07d TRX: schedule: remove dead code
the check whether or not to send a dummy burst is done already in
trx_sched_dl_burst(), so no need to have commented-out code doing that
again.
2016-01-16 17:48:45 +01:00
Harald Welte 519a639cf3 TRX: make trx_chan_desc static, it is not used externally 2016-01-16 17:48:40 +01:00
Harald Welte 6323d2e617 use existing #define for FR/EFR frame length (33/31) 2016-01-16 17:48:26 +01:00
Harald Welte 601781f463 move 'GSM_FR_BYTES' and related definitiions to common part 2016-01-16 17:48:20 +01:00
Harald Welte 695d8eb277 TRX: Reduce magic numbers, introduce GSM_HYPERFRAME for 2715648 2016-01-16 17:48:15 +01:00
Harald Welte 5b500f5d8f TRX: use const for dummy and fcch burst definitions 2016-01-16 17:48:04 +01:00
Harald Welte 2bf00d7729 TRX: mark scheduler data structures as 'const'
Those are read-only tables which should end up in the text segment
and not in writable data.
2016-01-16 17:47:59 +01:00
Harald Welte 12992d86dc TRX: some comments dscribing the scheduler.[ch] API 2016-01-16 17:47:54 +01:00
Harald Welte d93bd21185 sysmoBTS: port 'press Ctrl+C twice for immediate exit' from osmo-bts-trx 2016-01-16 17:47:40 +01:00
Harald Welte 8250800d3b TRX: Add stub bts_model_change_power() function
This just fixes linking. It still needs to be properly implemented
2016-01-16 17:47:34 +01:00
Harald Welte 6d101a79a8 TRX: remove obsolete get_mac() function 2016-01-16 17:47:13 +01:00
Harald Welte 866f9b979d OCTPHY: Obtain information from PHY and expose it in VTY
This adds 'show trx 0 system-information' command to the VTY indicating
various version information obtained from the DSP/PHY.
2016-01-16 17:26:26 +01:00
Harald Welte 3e98f942e5 OCTPHY: Implement command re-transmission after message loss
We re-use the 'wait_l1_conf' structure for implementing the
unacknowledge command window towards the PHY.  This means that thre will
unconditionally be a 'wait_l1_conf' now, even for requests where the
caller didn't provide a call-back.
2016-01-16 17:26:25 +01:00
Harald Welte 7bd2251dcb OCTPHY: Print NOTICE message if we receive supervisory frame 2016-01-16 17:26:24 +01:00
Harald Welte 0c017618cd OCTPHY: Block PHY indications until it is confirmed open
When re-starting OsmoBTS after unclean shutdown, the PHY is already
sending notifications (PH-DATA.ind, PH-TIME.ind, etc.) for the previous
physical channel / timeslot configuration.  At the point those messages
are received, OsmoBTS might not even have A-bis OML up yet, and thus has
no clue how to process such messages (and subsequently likely crashes).

Let's block such primitives from passing further up the code until we
have received the TRX-OPEN response.
2016-01-16 17:26:22 +01:00
Harald Welte 8d198f3598 OCTPHY: Fix various memory leaks and add comments on msgb ownership 2016-01-16 17:26:21 +01:00
Harald Welte bca8d3b8f8 OCTPHY: Exit gracefully if config file specifies no phy-netdev 2016-01-16 17:26:20 +01:00
Harald Welte a9003acb1c OCTPHY: Ensure we write the phy-netdev parameter
When writing the config file from the command line, we must not forget
to write the phy-netdev parameter, otherwise the program will fail to
re-start later :/
2016-01-16 17:26:19 +01:00
Harald Welte dad89e50a2 OCTPHY: Replace '-lortp' with the proper pkg-config/autofoo version 2016-01-16 17:26:06 +01:00
Harald Welte b92100ad36 Add support for Octasic OCTSDR-2G GSM PHY
This adds support for a new PHY to OsmoBTS, the Octasic OCTSDR-2G
PHY. This is a proprietary GSM PHY running on a familty of Octasic DSPs.
2016-01-16 17:23:10 +01:00
Harald Welte e9f12acbeb LAPDm: Use T200 settings from OML rather than libosmocore defaults 2016-01-16 16:25:52 +01:00
Harald Welte 7d6860b114 print a NOTICE message if lchan not activ in get_active_lchan_by_chan_nr() 2016-01-16 16:25:52 +01:00
Alexander Huemer 056c267b89 fix some format specifiers 2016-01-15 15:33:46 +01:00
Harald Welte 74269054a6 sysmobts: add missing break statement in l1if_handle_ind()
this was introduced in 21b020b336 and
luckily spotted by coverity (CID 1347446)
2016-01-08 14:19:23 +01:00
Alexander Chemeris a62e3221b6 l1sap: Whitespace fixes. 2016-01-08 13:07:14 +01:00
Harald Welte 085569df55 fix large amount of compiler warnings in common and sysmobts code 2016-01-04 20:29:24 +01:00
Harald Welte 21b020b336 sysmobts: Clarify msgb ownership / fix memory leaks 2016-01-04 20:17:32 +01:00
Holger Hans Peter Freyther e28a20a2d9 sysmobts: Catch up with the API changes and specify the version
API revision 5.1 allows us to pass a version number for the rx/tx
calibration and the DSP/FPGA will inform us about clock errors.
2015-12-07 11:23:36 +01:00
Minh-Quang Nguyen 2da932c7a0 sysmobts: support eeprom map version 2
[hfreyther: Accept the mixing of whitespace to ease future
merges]
2015-12-07 11:10:57 +01:00
Harald Welte 2ecbf87130 use talloc pool for msgb and ortp library
by using a talloc pool, we avoid having to go back to the libc
malloc pool all the time.  The msgb allocations and libortp allocations
happen quite frequently during processing and show up as one of the
high priority items in osmo-bts profiles on sysmoBTS with 14 concurrent
TCH/H calls (highest load scenario).

talloc still consumes significant CPU, this is mostly due to the
zero-initialization of all the associated buffers.  Strictly speaking
we shouldn't need this, but any change there would require lots of
testing, as there might be hidden assumptions in the code?

In some percentage of cases, talloc still seems to fall back on malloc
for msgb allocations, which is currently a bit of a mystery.  The pools
certainly are large enough, talloc_reprt() rarely reports more than a
few tens of kilobytes used by the msgb pool.
2015-12-06 21:31:39 +01:00
Harald Welte 62d7502b82 osmo-bts-sysmo: Disable DSP trace flags by default 2015-12-05 15:57:09 +01:00
Harald Welte 2d5481da27 l1sap: Ensure we only pass PHY primitives of active lchans
In some situations, a PHY might send us a primitive for a logical
channel that is not (or no longer) active.  Passing such primitives
higher up the stack is asking for trouble.  Specifically, LAPDm
instances cannot accept messages once their instance has been released.

We introduce two new helper functions: get_lchan_by_chan_nr() as well as
get_active_lchan_by_chan_nr().  The former just centralizes the look-up
of the lchan by timeslot number and sub-slot number.  The latter also
checks to ensure the lchan is active, which is used for PH-DATA / PH-RTS
primitives.  To the contrary, MPH primitives generally don't require the
cahnnel to be active for processing.
2015-12-05 11:54:08 +01:00
Harald Welte 44bc9408b1 common/rsl.c: The presence of a valied measurement result is DEBUG
we shouldn't consider the presence of a valid measurement result
as something NOTICEable
2015-12-03 19:54:38 +01:00
Harald Welte 02337e1d1d sysmobts: Dont recycle PHY primitive for L1SAP in PH-DATA.ind 2015-11-20 21:35:07 +01:00
Harald Welte 437deb5f3a sysmobts: fix ph_data_req() msgb handling + alignment
The way we recycle the msgb with a l1sap header when transforming a
PH-DATA.req L1SAP primitive into a PHY/L1 primitive was flawed in
several ways:

1) the way the L1SAP header was stored in the buffer didn't provide
   sufficient tailroom for the L1 primitive
2) the alignment of the data in L1SAP is at a 32bit bounadry, but not
   in the L1 primitive, causing unaligned accesses.
2015-11-20 18:05:51 +01:00
Harald Welte 48e99fd05a cope with 'struct gsm_bts' without a tsc member
This was introduced in openbsc.git a2bbc5ec0e6481bb5b65da7bdbde03a424437af4
2015-11-20 10:54:09 +01:00
Harald Welte bbcf703be8 TRX: catch up with trhe amr_mode naming changes
OpenBSC introduced a naming change in
615ed46a6ab25f71a7ab0d8201d33b4dbf8fc5b0 but osmo-bts fixes were only
about osmo-bts-sysmo, not osmo-bts-trx.  This updates osmo-bts-trx
accordingly.
2015-11-05 23:02:55 +01:00
Harald Welte 94da045be5 Don't blindly link against '-lortp' but use pkg-config for that
This also ensures that a missing ortp library dependency is discovered
at configure time already
2015-11-05 22:52:50 +01:00
Holger Hans Peter Freyther 13947b3408 amr: Catch-up for the non-RTP mode after amr rename 2015-10-03 22:45:52 +02:00
Holger Hans Peter Freyther 1009a87f3c amr: Catch up with the amr_mode changes
Use the bts_modes for all the types. As there are two instances
know. One for the ms and one for the bts.

Manual compile fix and not tested on HW
2015-10-03 22:34:37 +02:00
Harald Welte caa648d92e TRX: Add missing call to abis_init()
This somehow got lost during the latest rebase.
2015-09-22 16:41:32 +02:00
Harald Welte 88a31e2a99 make osmo-bts-trx provide bts_model_adjst_ms_pwr() 2015-09-22 16:41:32 +02:00
Alexander Chemeris b812839dfa trx: fix potential use of uninitialized toa variable.
Not really a bug, as we're smart about it down the stream, but it's better to
be strict here as well.
2015-09-22 16:41:31 +02:00
Alexander Chemeris ae525a8761 trx: Send POWERON/OFF commands to osmo-bts only for the first channel.
osmo-trx never supported separate power control for trx's, but now it started
to be more strict about it.
2015-09-22 16:41:31 +02:00
Alexander Chemeris 29ea40f538 trx: Assume 100% BER if total decoded bits is 0 in l1if_process_meas_res() 2015-09-22 16:41:31 +02:00
Alexander Chemeris e9abc5a4f3 trx: Cleanup unused parts of loops.c 2015-09-22 16:41:31 +02:00
Alexander Chemeris 17be7fa73b trx: Remove unused variables. 2015-09-22 16:41:31 +02:00
Alexander Chemeris 68e8b2b1d5 trx: Fix typo in a log message. 2015-09-22 16:41:31 +02:00
Alexander Chemeris 391ff14977 trx: More logging for voice frame decoding functions. 2015-09-22 16:41:31 +02:00
Alexander Chemeris 6fceaca584 trx: Implement BER calculations.
A known issue with this code is that BER is not updated for lost TCH frames,
because osmo-trx doesn't send any indication for them and we don't have
a callback to handle this.

Otherwise the code seem to work fine.
2015-09-22 16:41:31 +02:00
Thomas Tsou ddc0bf14d5 TRX: Remove extra TCH/HS puncturing value
3GPP TS 05.03 "Channel coding" specifies the puncturing matrix (1,0,1)
for class 1 information bits and tail bits valued u(0) to u(103) for a
maximum puncturing index of 311. The puncturing index 313 exceeds the
maximum index and causes osmo_conv_get_output_length() to output the
improper length of 210 instead of 211.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2015-09-22 16:41:31 +02:00
Andreas Eversberg deb01a2652 TRX: Check if Transceiver indicates an out of range clock
If frame number is out of range (>= 2715648), the scheduler's process
would end up in an infinite loop. This is because the loop would schedule
bursts until the indicated frame number is reached, which would not be
possible.

The openbts, calypso-bts and osmo-trx might send out out of range clock
indications every 3.5 hour.
2015-09-22 16:41:30 +02:00
Andreas Eversberg 3cfc9d5fa3 TRX: Show which TRX does not respond or rejects a command 2015-09-22 16:41:30 +02:00
Andreas Eversberg a7d0c5ef5a trx: Set lchan inactive, only if the dedicated channel is deactivated 2015-09-22 16:41:30 +02:00
Andreas Eversberg f39c739bd6 TRX: Activate LCHAN of CCCH when CCCH is configured on time slot 2015-09-22 16:41:30 +02:00
Andreas Eversberg f66f5b3ddc TRX: Free bust buffer memory to when changing lchan type 2015-09-22 16:41:30 +02:00
Andreas Eversberg c241afa87c TRX: Add VTY option to allow setting RTS advance in frames
RTS (ready-to-send) must be issued in advance, so BTS core and especially
osmo-pcu can provide downlink data frames early enough. In some cases PCU
might provide frames too late, so they must be dropped. If PCU provides
frames too late, due to high system load, this "RTS advance" setting must
be increased.
2015-09-22 16:41:30 +02:00
Martin Hauke 178d618d5a TRX: fix some typos in comments 2015-09-22 16:41:30 +02:00
Martin Hauke c9ddb2ba22 build: Use AM_CPPFLAGS in Makefile.am
Since automake 1.13 INCLUDES is depricated and causes a warning
Inspired from similar patches by Alexander Huemer for other osmocom
projects.
2015-09-22 16:41:30 +02:00
Andreas Eversberg b2482a8574 Allow TRX 0..254 at VTY, even if less TRX are available
Instead of limiting the number of TRX at VTY to the actual number of
supported TRX, VTY allows to configure any possible number of TRX. If a
TRX is configured, which is not supported by BTS model, an error message is
returned, which states that the given TRX is not supported.
2015-09-22 16:41:30 +02:00
Andreas Eversberg 812fdd92c7 TRX: Changed logging of unserved primitives from LOGL_NOTICE to LOGL_INFO 2015-09-22 16:41:30 +02:00
Andreas Eversberg ec6225e3e0 TRX: Fixed chan_nr for SACCH/8(7) at scheduler 2015-09-22 16:41:29 +02:00
Andreas Eversberg ef6eb5442c trx: Add option to set transmit power reduction via OML (BSC) 2015-09-22 16:41:29 +02:00
Andreas Eversberg f0072a8de8 TRX: Do not send burst on IDLE channels at TRX != C0
This is required, so the transceiver transmits no power.
2015-09-22 16:41:29 +02:00
Andreas Eversberg 3cf28aa924 TRX: Close TRX (shutdown all active channels) on ABIS link failure 2015-09-22 16:41:29 +02:00
Andreas Eversberg 578340c7a7 TRX: Add bts_model_trx_close to TRX implementation 2015-09-22 16:41:29 +02:00
Andreas Eversberg 3caf3b7c45 TRX: Fixup ciphering state names after rebasing 2015-09-22 16:41:29 +02:00
Andreas Eversberg ee47913389 TRX: No need to set mode and cipher for PDCH 2015-09-22 16:41:29 +02:00
Andreas Eversberg f5aaf523c5 TRX: If no cipher algorithm is given, or if it is a5/0, reset cipher state 2015-09-22 16:41:29 +02:00
Andreas Eversberg 8c8998e551 TRX: Set ciphering to an initial state when activating channel
Handover and assignment may activate channels with ciphering already set,
so we need to tell scheduler to enable/disable ciphering and set the
correct cipher state.
2015-09-22 16:41:29 +02:00
Andreas Eversberg 798c1bba9d TRX: Process real time scheduling option is now similar to sysmobts 2015-09-22 16:41:29 +02:00
Andreas Eversberg db0b93ac39 TRX: Disable handover burst detection when closing channel during detection 2015-09-22 16:41:29 +02:00
Andreas Eversberg 86c936cbb1 TRX: Use correct slot type for GSM_PHCAN_BCCH 2015-09-22 16:41:28 +02:00
Andreas Eversberg b9a917a138 TRX: Handover access burst support 2015-09-22 16:41:28 +02:00
Andreas Eversberg 6527dffc94 TRX: Clear lchan state when resetting TRX 2015-09-22 16:41:28 +02:00
Andreas Eversberg fb04746bce TRX: Report measurements 2015-09-22 16:41:28 +02:00
Andreas Eversberg 05597a7ddb TRX: Fixed typos tranceiver -> transceiver 2015-09-22 16:41:28 +02:00
Andreas Eversberg 82676c13ee TRX: Fix: Cleanly free TRX instances during initialization in case of an error 2015-09-22 16:41:28 +02:00
Andreas Eversberg c2ee307fd4 Allow one or more TRX to configure via VTY 2015-09-22 16:41:28 +02:00
Andreas Eversberg 2e4a26a0e9 TRX: Add VTY options to enable and disable SETTSC and SETBSIC 2015-09-22 16:41:28 +02:00
Andreas Eversberg 6508f21130 TRX: Reset ciphering state when closing channel 2015-09-22 16:41:28 +02:00
Andreas Eversberg c5241c3aa4 TRX: Support for AMR half speech 2015-09-22 16:41:28 +02:00
Andreas Eversberg c910a332b2 TRX: Support for TCH/H and GSM half rate transcoding 2015-09-22 16:41:27 +02:00
Andreas Eversberg f62a64e440 TRX: Add AMR Payload handling 2015-09-22 16:41:27 +02:00
Andreas Eversberg a7f5e07712 TRX: Support for AMR full speech 2015-09-22 16:41:27 +02:00
Andreas Eversberg 5e2341411f Get RSSI from received uplink data and send to PCU 2015-09-22 16:41:27 +02:00
Andreas Eversberg 917cf7018b TRX: Add support for EFR transcoding 2015-09-22 16:41:27 +02:00
Andreas Eversberg 84b9a44535 TRX: Code cleanup, prepare for other codecs than GSM full rate 2015-09-22 16:41:27 +02:00
Andreas Eversberg 7ff22823ca TRX: Use link timeout value from BSC via OML attribute. 2015-09-22 16:41:27 +02:00
Andreas Eversberg 9855e8bd48 TRX: Out of range primitives found in downlink queue are not an error 2015-09-22 16:41:27 +02:00
Andreas Eversberg 219ece83a3 TRX: Implementation of MS power and timing advance loops 2015-09-22 16:41:27 +02:00
Andreas Eversberg 889890da43 TRX: Improved handling of clock indications.
If no clock is received, a POWEROFF is sent until clock is detected.
2015-09-22 16:41:27 +02:00
Andreas Eversberg 23a5183767 TRX: Fixes to TRX interface
Ignore false response to uncritical commands.
2015-09-22 16:41:27 +02:00
Andreas Eversberg ce0f20b597 TRX: Fix of SCH burst data 2015-09-22 16:41:26 +02:00
Andreas Eversberg 7bd6e8b89b TRX: Ciphering 2015-09-22 16:41:26 +02:00
Andreas Eversberg d692b6e054 TRX: Replaced GSM 06.10 ordering table by table in libosmocodec 2015-09-22 16:41:26 +02:00
Andreas Eversberg 89e36c0e64 TRX: Cleanup of channel transcoding 2015-09-22 16:41:26 +02:00
Andreas Eversberg 801c182c02 TRX: By default, send 20 frames in advance to tranceiver 2015-09-22 16:41:26 +02:00
Andreas Eversberg 7451ce29a7 TRX: Detect missing received bursts and fill them with zero-sbits 2015-09-22 16:41:26 +02:00
Andreas Eversberg 78b2080027 TRX: PDTCH (GPRS) works now
Detection and transcoding of all four coding schemes are supported.
2015-09-22 16:41:26 +02:00
Andreas Eversberg 9de67ca962 TRX: Lost TCH frame detection of omitted bursts from tranceiver 2015-09-22 16:41:26 +02:00
Andreas Eversberg b9880bc812 TRX: Allow transcoding of TCH FR with MSB first (RTP) or LSB first (E1) 2015-09-22 16:41:26 +02:00
Andreas Eversberg d10eaee4cc TRX: Completed TCH/F full rate support
Full rate is now tested and working.
2015-09-22 16:41:25 +02:00
Andreas Eversberg b104aed5ec TRX: Fixed swapped stealing bits
Thanx to Sylvain for pointing to this bug.
2015-09-22 16:41:25 +02:00
Andreas Eversberg cd463dd72a TRX: Minor fixes, especially handle TOA of RACH correctly 2015-09-22 16:41:25 +02:00
Andreas Eversberg 7d684d6866 TRX: Fix, never send confirm for DEACT SACCH request (TS 05.08 4.6)
Sending it would cause BSC to change to a state, where it does not release
rf channel.
2015-09-22 16:41:25 +02:00
Andreas Eversberg e0959e7929 TRX: Use received TRX clocks to determine availablility of tranceiver
Only if transceiver becomes available, control commands are sent. If
tranceiver is gone, reset scheduler.

The current availability state is sent to BSC via OML state change
commands.
2015-09-22 16:41:25 +02:00
Andreas Eversberg 2ea68e2b7b TRX: Fixes and improvements of scheduler 2015-09-22 16:41:25 +02:00
Andreas Eversberg d0603d96e9 TRX: Completed transcoding of TCH with reordering Table 2 of TS 05.03 2015-09-22 16:41:25 +02:00
Andreas Eversberg 414faaca19 TRX: Power down tranceiver and reset scheduler, if abis link is lost
If BTS is gone, TRX is powered down, due to loss of abis link. If link is
esablished again, tranceiver and scheduler are provisioned again by BTS.
2015-09-22 16:41:25 +02:00
Andreas Eversberg 7a0d11dd68 ABIS: Introduce bts_model_abis_close to indicate ABIS link failure.
sysmocom-bts model shuts down on link loss, but other models may not want
this, so shutdown is moved tor bts_model_abis_close of osmo-bts-sysmo.
2015-09-22 16:41:25 +02:00
Andreas Eversberg cd0581d815 TRX: On negative response of critical commands, shutdown BTS 2015-09-22 16:41:24 +02:00
Andreas Eversberg acc71ffb4b TRX: Introduce osmobts-trx, a layer 1 implementation for OpenBTS tranceivers
The code is quite complete, TCH and PDCH channels are not yet tested.
2015-09-22 16:41:24 +02:00
Andreas Eversberg c64fa4f888 Change to new structure of multirate at gsm_data_shared.h 2015-09-22 16:41:24 +02:00
Andreas Eversberg 79bc80102c Fix: Call e1inp_vty_init() before reading config file 2015-09-22 16:41:24 +02:00
Andreas Eversberg 5fa388c366 Fix: Process all TRX on GSM Time indication, not only C0 2015-09-22 16:41:24 +02:00
Andreas Eversberg 75f105bbb5 Fix: Retrieve ARFCN (from OML) for TRX other than C0 2015-09-22 16:41:24 +02:00
Harald Welte 819b50e1a7 move MS power control handling from sysmobts to common part
MS uplink power control is required in pretty much any BTS, and we
cannot assume that they PHY / L1 will always take care of it by
itself.   So the correspondign code is moved to common/power_control.c
and called from the generic part of L1SAP.

The corresponding VTY paramter has been moved from the sysmobts-specific
trx VTY node to the common BTS VTY node.
2015-09-22 16:39:05 +02:00
Andreas Eversberg f449842053 Move detection of handover frames from sysmo-bts code to common code 2015-09-22 16:39:05 +02:00
Andreas Eversberg 9cfbf27d4c Remove obsolete gsmtap handling from osmo-bts-sysmo part. 2015-09-22 16:39:05 +02:00
Andreas Eversberg a450ef73ed Add gsmtap option to command line to main.c of osmo-bts-sysmo 2015-09-22 16:39:04 +02:00
Andreas Eversberg 04b5d65575 Move gsmtap VTY commands from osmo-bts-sysmo to common part 2015-09-22 16:39:04 +02:00
Andreas Eversberg 90e543bd83 Send primitives at PH-/MPH-/TCH-SAP interface via GSMTAP 2015-09-22 16:39:04 +02:00
Andreas Eversberg 75caaf2949 sysmobts: Clean up transitions for lchan cipher state
There are three transitions:

1. LCHAN_CIPH_NONE -> LCHAN_CIPH_RX_REQ -> LCHAN_CIPH_RX_CONF

It is used to enable ciphering in RX (uplink) direction only.

2. LCHAN_CIPH_RX_CONF -> LCHAN_CIPH_RX_CONF_TX_REQ -> LCHAN_CIPH_RXTX_CONF

It is used to additionally enable ciphering in TX (downlink) direction.

3. LCHAN_CIPH_NONE -> LCHAN_CIPH_RXTX_REQ -> LCHAN_CIPH_RX_CONF_TX_REQ
   -> LCHAN_CIPH_RXTX_CONF

It is used to enable ciphering in both TX and RX directions. This is used
when the channel is activated with encryption already enabled. (assignment
or handover)

In order to follow the order of these transitions, the RX direction must
always be set before the TX direction.

If no cipher key is set (A5/0), ciphering is set to ALG 0, but lchan cipher
state remains at LCHAN_CIPH_NONE.
2015-09-22 16:39:04 +02:00
Andreas Eversberg 5027e122a8 Add MEAS (MPH_INFO) IND message to PH-/MPH-/TCH-SAP interface
This part moves processing of measurement infos from osmo-bts-sysmo to
common part.
2015-09-22 16:39:04 +02:00
Harald Welte a313bb0a47 l1sap: Port code to new ciphering handling
... introduced in 2cc37035d7
2015-09-22 16:39:04 +02:00
Harald Welte 923e324abc sysmobts/l1_if: Sacch/Sdcc/Facch are handled in l1sap/core 2015-09-22 16:39:04 +02:00
Andreas Eversberg bac087c207 Add SDCCH/SACCH/FACCH messages to PH-/MPH-/TCH-SAP interface
This part moves control channel message primitives from osmo-bts-sysmo to
common part.

In order to control ciphering fo BTS model, CIPHER (MPH_INFO) messages are
used.
2015-09-22 16:39:04 +02:00
Harald Welte 80f039973e l1sap: Avoid compiler warnings regarding uninitialized nmsg 2015-09-22 16:39:04 +02:00
Harald Welte 3a381367a6 l1sap: Use {data,empty}_req_from_l1sap() and avoid code duplication 2015-09-22 16:39:04 +02:00
Andreas Eversberg 12472df8f0 Add TCH messages to PH-/MPH-/TCH-SAP interface
This part moves TCH handling from osmo-bts-sysmo to common part. The RTP
handling is done at the common part, so they can be used by other BTS
models.
2015-09-22 16:39:04 +02:00
Harald Welte 7cc199ea95 l1sap: re-introduce a comment that was lost during l1sap merge 2015-09-22 16:39:03 +02:00
Andreas Eversberg 793e713c4b Move chan act/rel/modify from bts_model to PH-/MPH-/TCH-SAP interface
This part replaces channel activation/deactivation/modification routines
by MPH_INFO messages.
2015-09-22 16:39:03 +02:00
Andreas Eversberg faba84b9b7 Relace bts_model_get_time() by get_time() at common part 2015-09-22 16:39:03 +02:00
Harald Welte 7cf313c75b l1sap: Re-introduce more correct RACH slot counting
The original code handled both the fact where a TIME indication would be
missed (and thus the frame number be higher than previous + 1), as well
as the two cases for combined / non-combined CCCH.

The L1SAP code removed some of those bits, which I'm re-introducing
here.
2015-09-22 16:39:03 +02:00
Andreas Eversberg 21b5e6318e Add TIME (MPH_INFO) IND messages to PH-/MPH-/TCH-SAP interface
This part moves GSM time handling from osmo-bts-sysmo part to common part.
2015-09-22 16:39:03 +02:00
Harald Welte 4fe00da9f8 l1sap: additional comments explaining l1sap changes in l1_if.c 2015-09-22 16:39:03 +02:00