Commit Graph

12 Commits

Author SHA1 Message Date
Vadim Yanitskiy 529d54b13a trxcon/scheduler: introduce and use struct sched_burst_req
Similar to what we do in osmo-bts-trx, group everything related to
an Uplink burst into a structure.  Pass a pointer to this structure
to the logical channel handlers.  This makes the code easier to read,
and facilitates sending NOPE indications to the transceiver
(will be introduced in the upcoming patch).

Get rid of sched_trx_handle_tx_burst(), and instead just call
sched_trx_a5_burst_enc() directly from sched_frame_clck_cb().

Change-Id: Id45b27180c233fdc42ae1ef0b195554dd299a056
Related: SYS#5313, OS#1569
2021-06-16 15:55:32 +02:00
Vadim Yanitskiy 9d3c2d047b trxcon/scheduler: do not abort on incomplete set of bursts
Change-Id: Iea2d1b75b50c2889d4766687ef4fe6ae4ea39a50
2020-03-16 10:32:42 +00:00
Vadim Yanitskiy d81231672f trxcon/scheduler: align Downlink reception to the first burst
It may happen that the burst reception would start from bid != 0:

  <0005> sched_trx.c:263 (Re)configure TDMA timeslot #2 as TCH/H+SACCH
  <0005> sched_trx.c:420 Activating lchan=TCH/H(0) on ts=2
  <0005> sched_trx.c:420 Activating lchan=SACCH/TH(0) on ts=2
  <0006> sched_lchan_xcch.c:96 Received incomplete data frame at fn=0 (0/104) for SACCH/TH(0)
  <0006> sched_lchan_xcch.c:106 Received bad data frame at fn=0 (0/104) for SACCH/TH(0)

so in that case, both measurement processing and the frame number
calculation would yield incorrect and/or incomplete results. The
Rx burst mask can be used to eliminate this problem.

In particular, if we shift it left instead of cleaning, it would
never be equal 0x00 after at least one burst is received. This
would allow us to skip decoding of an incomplete frame at the
beginning when the logical channel was just activated.

Note that TCH/H handler is not affected because it already uses
the strategy described above, so we keep it unchanged.

Change-Id: Ib8ddf2edd5ef84f2ab12155f7a8874c9fc56d436
Related: OS#3554
2020-03-16 10:32:42 +00:00
Vadim Yanitskiy f5fa7dbd19 trxcon/scheduler: constify Downlink burst bits where possible
Change-Id: Ib3e3a0a5b4551126b1a9439000d4438c58a6a90a
2020-03-16 10:32:42 +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 0ded4757be trxcon/scheduer: fix: properly check rc of gsm0503_pdtch_encode()
The gsm0503_pdtch_encode() returns negative number on error,
and the amount of encoded bits in case of success.

Change-Id: I7d75141142922909330c5e86be8734bb06cd57a4
2019-06-30 17:30:11 +07:00
Vadim Yanitskiy c89047d8bc trxcon/scheduler: enrich GSM 05.03 encoding error messages
Change-Id: I35a7c5df4fc0ed2195ba721f92812874011459d9
2019-06-30 17:28:06 +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 0a1da46869 trxcon/scheduler: add PDTCH channel support
Change-Id: I1176576f54c1d68e79cc6ac37d61a9033f7018dd
2018-10-20 22:42:59 +02:00