Commit Graph

99 Commits

Author SHA1 Message Date
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 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 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 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 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 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
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