Commit Graph

9 Commits

Author SHA1 Message Date
Vadim Yanitskiy 1b6be6fc24 trxcon: do not include trxcon.h everywhere
Change-Id: Ia78bd6dac7ab12970838e0b1a2929a106b898d9d
2019-01-17 10:55:41 +07:00
Vadim Yanitskiy 96419494d3 trxcon/scheduler: introduce TDMA frame math helpers
The 'normal' math operations, such as addition and substraction,
are not applicable for TDMA frame numbers because they may result
in out-of-range values.

Having TDMA frame math helpers in a single place would allow
one to avoid possible out-of-range result mistakes.

Change-Id: Ibb66ba846cc3d6c2eaa88414569e5f3751128047
2018-09-16 01:51:15 +07:00
Vadim Yanitskiy 909c86df29 trxcon/scheduler.h: share FRAME_DURATION_uS definition
Change-Id: I88be6088141af6bac8d34844b71193bfef51ad31
2018-09-14 18:12:20 +07:00
Stefan Sperling 316f22f057 trxcon/sched_clck.c: fix time delta calculations
Use osmo_clock_gettime() to read the monotonic clock instead
of gettimeofday() which could drift backwards.
This requires switching the scheduler clock from struct timeval
to struct timespec. Expand some variables to 64 bits in order
to keep types used in calculations compatible.

The previous implementation unconditionally subtracted microsecond
values from different time measurements, causing overflow if the
current measurement was taken in less of a fraction of a second
than the past measurement. Use timespecsub() for the subtraction
instead which accounts for fractions of a second correctly.

Change-Id: Ic93f90685c6d6dc28dfc4ad48c998e0eac113cf8
Related: OS#3467
2018-08-17 17:22:59 +00:00
Vadim Yanitskiy 026ed14c4b host/trxcon: adjust default verbosity level
Change-Id: I91258091b59e5cdd30b767364fb48c3d67980eb7
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy 00bb1d5a79 host/trxcon/scheduler: implement sched_clck_reset()
It's better to have the clock management API inside a single file.

Change-Id: I92772f3db404e70fdffd530779613196afec61c9
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy b30031356c host/trxcon: get rid of useless trxcon fsm events
Both SCH_EVENT_CLCK_IND and SCH_EVENT_CLCK_LOSS were not handled,
moreover there is no purpose to keep them.

Change-Id: I8efac459a40f4287e3325890809991d5ef46e9b1
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy f604869944 host/trxcon: share trxcon fsm and talloc ctx via trxcon.h
Change-Id: I9ef558f84a6dc1c9b8fc394c48e108676fa169f8
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy 9b1d398685 host/trxcon/scheduler: add basic clock counter
The core of scheduler is a simple clock counter, which relays
on system time for now. One was a bit simplified and migrated
from OsmoBTS.

Due to system time is not an ideal clock source, the counter
should be periodically corrected by clock indications from BTS.

Change-Id: I27d85bd3e2c8bca3f876f73517027b9fe43c9825
2017-11-19 17:35:07 +07:00