Commit Graph

26 Commits

Author SHA1 Message Date
Oliver Smith 1741372556 treewide: remove FSF address
Remove the paragraph about writing to the Free Software Foundation's
mailing address. The FSF has changed addresses in the past, and may do
so again. In 2021 this is not useful, let's rather have a bit less
boilerplate at the start of source files.

Change-Id: I73be012c01c0108fb6951dbff91d50eb19b40c51
2021-12-14 12:52:04 +00:00
Vadim Yanitskiy 8c760f8f05 trxcon/scheduler: refactor TDMA frame number calculation
Using TDMA frame number of a burst with bid=0 is fine for xCCH,
but not for TCH and FACCH, because they use the block-diagonel
interleaving. A single block on TCH may be interleaved over
8, 4 or even 6 consecutive bursts depending on its type.

Since we now have the measurement history, we can attach TDMA
frame number to each measurement set, and then look up N-th
one when averaging the measurements in sched_trx_meas_avg().

Change-Id: I9221957297a6154edc1767a0e3753f5ee383173f
2020-03-16 10:32:42 +00:00
Vadim Yanitskiy 2060b5b7cc trxcon/scheduler: refactor Downlink measurement processing
So far we used to store the sums of ToA and RSSI measurements in the
logical channel state, and after decoding of a block, we did calculate
the average. This approach works fine for xCCH and PDTCH, but when it
comes to block-diagonal interleaving (which is used on TCH/F and TCH/H
channels), the results are incorrect. The problem is that a burst on
TCH may carry 57 bits of one encoded frame and 57 bits of another.

Instead of calculating the sum of measurements on the fly, let's push
them into a circular buffer (the measurement history), and keep them
there even after decoding of a block. This would allow us to calculate
the average of N last measurements depending on the interleaving type.

A single circular buffer can hold up to 8 unique measurements, so the
recent measurements would basically override the oldest ones.

Change-Id: I211ee3314f0a284112a4deddc0e93028f4a27cef
2020-03-08 22:50:54 +00:00
Vadim Yanitskiy 3f25909e10 trxcon/scheduler: print completeness of the Rx burst buffers
Change-Id: Ife9f5eabc23aa2eea08b190361e10a98e890d608
Related: OS#3554
2020-03-01 01:46:51 +07:00
Vadim Yanitskiy 9731f0d322 host/trxcon: add optional GSMTAP frame logging support
This feature may be useful for our TTCN-3 testing infrastructure.
By default it's disabled, and can be enabled using command line
arguments of the main binary:

  ./trxcon -g 127.0.0.1 ...

Change-Id: Iab4128fee5f18d816830fdca6c5ebebaf7451902
2019-10-05 17:50:20 +07:00
Vadim Yanitskiy 4bc4655bd6 trxcon/scheduler: count number of measurements
Instead of counting both RSSI and ToA measurements separately,
let's have a single counter in trx_lchan_state.meas struct.

Change-Id: I45454a3ac92b8cc85dd74092e4ab6eb350f20c9a
2019-02-21 17:20:36 +07:00
Vadim Yanitskiy 1b6be6fc24 trxcon: do not include trxcon.h everywhere
Change-Id: Ia78bd6dac7ab12970838e0b1a2929a106b898d9d
2019-01-17 10:55:41 +07:00
Vadim Yanitskiy 5caa4ac966 trxcon/scheduler: fix RSSI -> RX level conversion
Due to a mistake, average RSSI value of received bursts was not
converted to GSM RX level (range 0..63), so trxcon has been
sending incorrect values to the higher layers.

Let's fix this, and also prevent possible division by zero.

Change-Id: Id4659de899411ec1ba1718fdcb40aec562dbfd65
2019-01-02 12:23:07 +01:00
Vadim Yanitskiy 60da22a67b trxcon/scheduler: fix: don't send BFI in GSM48_CMODE_SIGN mode
GSM48_CMODE_SIGN means 'signaling only', so we shall not send
bad frame indications in this state. Instead, it makes sense
to send dummy L2 frames like we do for xCCH channels.

Change-Id: Ie39d53522cafab265099076b3194fa96aff217ba
2018-09-15 07:51:52 +00:00
Vadim Yanitskiy 347406cee7 trxcon/scheduler: get rid of useless lchan->rsl_mode
This field of the logical channel state structure was not used at
all as there is nothing related to A-bis / RSL in trxcon itself.

Change-Id: Iec1abf777a74cf57deadafa95e2337cba5d02842
2018-08-15 09:32:08 +07:00
Vadim Yanitskiy 7c4151ae52 trxcon/scheduler: fix: properly generate BFI for TCH/H
When relying on GSM 04.08 channel mode (GSM48_CMODE_*), one should
distinguish between Bm (full rate) and Lm (half rate) channels.

This change prevents the scheduler from generating TCH/F BFI
instead of TCH/H BFI on the corresponding channels.

Change-Id: I4547aa7f6d38637692fef8a0122e85fb52039a46
2018-08-15 08:22:14 +07:00
Vadim Yanitskiy 3cbbe81b63 trxcon/scheduler: pass lchan to sched_bad_frame_ind()
Instead of passing the information about a logical channel, it
makes sense to pass the pointer to its state where everything
is stored. This approach would allow to avoid adding more
arguments every time, e.g. in case of AMR.

Change-Id: I91fe86fef43aac68776a58c9acc37ef2a9ee8042
2018-08-15 08:20:41 +07:00
Vadim Yanitskiy 47aaf962fb trxcon/scheduler: enforce lchan handlers to set message type
Since this change, each lchan handler shall manually indicate
a type of both message indications and confirmations.

Change-Id: I02e0b87d61c127d2f6f5b9532909af78332bf707
2018-03-11 17:38:29 +07:00
Vadim Yanitskiy caebbebd16 trxcon/sched_lchan_common.c: use static memory allocation
There is no need to allocate the DL header for each new message.

Change-Id: Id7ad815c6b403f5c3d15fc02022397188f1d87fd
2018-03-11 17:38:29 +07:00
Vadim Yanitskiy 633c806a2b trxcon: clean up DATA / TRAFFIC indication API
- change 'l1ctl_tx_data_ind' symbol to 'l1ctl_tx_dt_ind' in
    order to indicate that it's used for both DATA and TRAFFIC;

  - introduce a 'traffic' flag, which is used to define either
    TRAFFIC or DATA indication type;

  - pass L2 payload and its length separately from the
    Downlink info header.

Change-Id: I9fe65ee9b2d772576b86b7bc85d53518530d1579
2018-03-11 17:38:29 +07:00
Vadim Yanitskiy ddddf9e0c4 trxcon: clean up DATA / TRAFFIC confirmation API
- change 'l1ctl_tx_data_conf' symbol to 'l1ctl_tx_dt_conf' in
    order to indicate that it's used for both DATA and TRAFFIC;

  - introduce a 'traffic' flag, which is used to define either
    TRAFFIC or DATA confirmation type;

Change-Id: Iedd569086a264dc7d8740abea5c6e5ca21e299f6
2018-03-11 17:38:29 +07:00
Vadim Yanitskiy 0192c028e4 trxcon/scheduler: use TCH frame length defs from libosmocodec
Change-Id: I6439d3cadd2dc1fa8fe401eb61c977a12ec844f2
2018-01-05 15:06:48 +07:00
Vadim Yanitskiy 15d512d301 trxcon/scheduler: separate primitive management code
It's good to write, keep and make the source code as much modular
as possible. So, Tte primitive management code was separated to
the 'sched_prim.c' and going to be extended in the near future.

Change-Id: Ifec8c9e4f2c95c72b00772688bcb5dc9c11d6de7
2017-12-18 05:20:25 +07:00
Vadim Yanitskiy e17bb11c3b trxcon/scheduler: BUGFIX: distinguish between SACCH and FACCH
Both SACCH and FACCH messages have the same 23-byte length, both
are being queued together within a single transimt queue. So,
previously a SACCH frame could be picked by TCH burst handler,
and then sent as a FACCH frame. Let's fix this.

A FACCH primitive may have one of the TRXC_TCH* logical channel
types, while SACCH primitives have one of the TRXC_SACCH*.

Change-Id: Ia7090384f3ff74c9d94997265135acbceffa0ffe
2017-12-18 05:18:07 +07:00
Vadim Yanitskiy a9c2ef2638 host/trxcon/scheduler: inform L2&3 about decoding errors
Previously, we used to drop a frame if decoding wasn't successful.
This way, the higher layers didn't even know about that, so the
local counters and Measurement Reports were incomplete.

This change makes scheduler to forward L2 frames in any case,
setting the num_biterr for each of them. In case of decoding
error, a dummy (payload filled by 0x00) L2 frame will be sent.

Change-Id: I31011d8f3ca8b9a12474cd0bc653faed18391033
2017-12-16 16:21:05 +07:00
Vadim Yanitskiy 9b511668a4 host/trxcon/scheduler: add initial TCH/F channel support
This change implements basic TCH/F lchan handlers for both data
reception and transmission. Only FACCH (signaling), FR and EFR
payloads are supported at the moment.

Change-Id: If6b0eaede2b484484d2a824e7219ff04483266a1
2017-12-16 15:45:38 +07:00
Vadim Yanitskiy d2c13e3d20 host/trxcon/scheduler: use GSM_MACBLOCK_LEN definition
Change-Id: Ie3b27ecb62d6f0e84f2e3ec0c1558e32bb213d33
2017-12-16 15:45:12 +07:00
Vadim Yanitskiy 2937cb4c16 host/trxcon/scheduler: clean up the trx_lchan_state
There were some BTS specific variables, which are meaningless.
This change cleans them up, and also groups some measurement,
encryption, and AMR specific variables into sub-structures.

Change-Id: Ie753a7e3e7fa2b433d8319b3a05b85b8583d7be2
2017-12-16 15:24:54 +07:00
Vadim Yanitskiy 863ccb7bd2 host/trxcon/scheduler: share common declarations of lchan handlers
The training sequences, data / traffic indication and confirmation
helpers are used by several lchan handlers, like xCCC and TCH. It
would be better to have them all declared within a shared header.

Change-Id: I71980f09a0c0e023370e1a651afc24fff2491552
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy 28088c8910 host/trxcon/l1ctl.c: include DL frame info in L1CTL_DATA_CONF
The l1ctl_info_dl header is expected to be a part of a
L1CTL_DATA_CONF message, but was missing previously.

Change-Id: Ia8dfaed924fd84395ba9ae539164eaa94f52d30b
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy 0dc5b233e6 host/trxcon/scheduler: share common code for lchan handlers
The training sequences array is currently used by xCCH handlers,
but will be also used for handling both TCH/F and TCH/H bursts.
Moreover the code that forwards decoded L2 payloads to L1CTL
protocol handlers was separated into a new shared function.

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