Revert "host/trxcon/trx_ic.c: use osmo_ubit2sbit() from libosmocore"

This reverts commit c5d9507b5d.

Using osmo_ubit2sbit() was a bad idea because this function treats
the input buffer as ubits (while we deal with usbits) and produces
absolute sbit values: either 127 or -127.  This is wrong, because
all intermediate usbit values are getting converted to -127.

This bug remained unnoticed so far because trxcon is mostly used in
combination with fake_trx.py, a virtual Um interface which simulates
ideal RF conditions by default and feeds trxcon with 'perfect' bits.

Change-Id: I3a32da19c9f419d51d55b301461ce28ce11b2249
This commit is contained in:
Vadim Yanitskiy 2022-10-24 03:53:11 +07:00
parent a7a6b1f344
commit a20b9e20ed
1 changed files with 6 additions and 1 deletions

View File

@ -621,7 +621,12 @@ static int trx_data_rx_cb(struct osmo_fd *ofd, unsigned int what)
toa256 = ((int16_t) (buf[6] << 8) | buf[7]);
/* Copy and convert bits {254..0} to sbits {-127..127} */
osmo_ubit2sbit(bits, buf + 8, 148);
for (unsigned int i = 0; i < 148; i++) {
if (buf[8 + i] == 255)
bits[i] = -127;
else
bits[i] = 127 - buf[8 + i];
}
if (tn >= 8) {
LOGPFSMSL(trx->fi, DTRXD, LOGL_ERROR, "Illegal TS %d\n", tn);