Commit Graph

2433 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 c652349b4a trxcon/scheduler: cosmetic: move TDMA frame number calculation
Change-Id: I79efdfa543d37889dc6749eb25aab4e1639749c6
2021-06-16 15:05:51 +02:00
Vadim Yanitskiy e4d5bbccf9 trx_toolkit/transceiver.py: allow NOPE.ind on inactive timeslots
Change-Id: I27a3c8897cb82f6c264d34702c4ec64561bb9809
Related: SYS#5313, OS#1569
2021-06-16 15:05:40 +02:00
Vadim Yanitskiy 825716851e host/layer23/ccch_scan: skip CCCH frames with wrong length
It's not clear why do we get frames with unexpected length, but
we definitely should not crash.  Just log and ignore them.

Change-Id: I85392becbffdb3ba7365decfd8f3769abe3c02c7
Related: OS#5171
2021-06-09 22:51:07 +02:00
Vadim Yanitskiy c3c57d888e trx_toolkit: add primary/shadow indicator for TRXDv2 PDUs
Change-Id: I0a3ad4f0bda56b93e0ab8bf82b6b3758831edf60
Related: SYS#4895, OS#4941, OS#4006
2021-06-02 04:48:50 +02:00
Vadim Yanitskiy 1b7b4ec7a4 trx_toolkit: use RxMsg/TxMsg instead of TRX2L1/L12TRX
I intentionally do not use 'Downlink' and 'Uplink' terms in this project
because both MS and BTS transmit and receive on the opposite directions.
A burst coming from demodulator may be a Downlink or an Uplink burst
depending on the context, so we definitely need more precise terms.

Back then when I started to work on TRX toolkit, I decided to use the
'TRX2L1' and 'L12TRX' for receive and transmit directions respectively.
Now I find them hard to read, so let's replace them with 'Rx' and 'Tx'.

Change-Id: I688f24a3c09dd7e1cc00b5530ec26c8e8cfd8f7c
Related: OS#4006, SYS#4895
2021-05-03 20:39:10 +02:00
Vadim Yanitskiy b2349bc359 trx_toolkit/data_msg.py: remove obsolete documentation
We do have TRXC/TRXD documentation in osmo-gsm-manuals repository.
These big comments are out of sync with what we have in the manuals,
so let's better remove them to avoid maintaining docs in several places.

Change-Id: I47786cf3039f712efadc85bc4e1c3ae89e79ff25
Related: OS#4006, SYS#4895
2021-05-03 20:39:10 +02:00
Vadim Yanitskiy 87c5f2c92d trx_toolkit/data_msg.py: update entries in enum Modulation
Change-Id: Ia96b263bbb162b6c40f2cf81616118cc297299a5
Related: OS#4006, SYS#4895
2021-05-03 20:39:05 +02:00
Vadim Yanitskiy a4127f272a trx_toolkit/test_codec.py: add missing sub-test with key=0x88
Change-Id: If8e2ebedc48fecc4c54c71e40cadb0f3273602c5
2021-05-03 20:35:46 +02:00
Vadim Yanitskiy eac05ae644 trx_toolkit/ctrl_if_trx.py: fix undefined variable 'trx'
Change-Id: I5c06fa5183b4d04cbc0c68327a062b320477344c
2021-05-03 20:35:46 +02:00
Vadim Yanitskiy b988408166 trx_toolkit/fake_trx.py: use raw string notation for regex
This way there is no need to escape backslashes in regex.

Change-Id: I1b2b6675851275bd5285ffc287410535b22055ae
2021-05-03 20:35:46 +02:00
Vadim Yanitskiy bd73f0920d trx_toolkit/gsm_shared.py: s/GSM_BURST_LEN/GMSK_BURST_LEN/g
Change-Id: I7268196eb9fd822f0e7b65899e4c83c48a20ba5b
2021-04-30 22:31:40 +02:00
Vadim Yanitskiy a2618b789a trx_toolkit/trxd_proto.py: fix missing field name for codec.Spare
Change-Id: I110dbcebf86cf978f2de7275a91c48b999fade32
Fixes: I482f72fd9305c51f43a0339d03904fb693d90ac9
Related: OS#4006, SYS#4895
2021-04-30 22:31:40 +02:00
Vadim Yanitskiy 8fc13352aa trx_toolkit/trxd_proto.py: fix encoding of TRXDv0 Tx PDUs
Change-Id: I9da59f7e7c47dd1cac833839165ba05de6b18144
Related: OS#4006, SYS#4895
2021-04-30 22:31:40 +02:00
Vadim Yanitskiy e9b0d7488f trxcon: fix legacy length expectations for TRXDv0 Rx PDUs
158 is basically: 8 + 148 + 2, where the last two are padding bytes
sent by legacy TRXDv0 transceivers.  We don't need them, so do not
drop PDUs without these leggacy padding bytes.

Change-Id: I6c0734bc4669ccde2a93940c9cf50fdbbd67cb00
2021-04-29 14:33:25 +02:00
Vadim Yanitskiy 393158ac08 trx_toolkit: change coding of 'PWR' and 'SCPIR' fields
During an internal discussion, it was decided to keep field 'PWR'
as-is and move 'SCPIR' into a separate octet.  This is easier to
parse, less confusing, and would save us some CPU cycles.

Change-Id: I482f72fd9305c51f43a0339d03904fb693d90ac9
Related: OS#4006, SYS#4895
2021-04-15 21:51:11 +02:00
Vadim Yanitskiy d4900f93ee trx_toolkit: define TRXDv2 PDUs using declarative codec
Change-Id: If356d285006c0b9b57879d0499b8144eca820cab
Related: OS#4006, SYS#4895
2021-04-12 01:51:14 +02:00
Vadim Yanitskiy 7c3a566b52 trx_toolkit: define TRXDv0/v1 PDUs using declarative codec
Change-Id: I739ae5da22c603fb2cf1e84d3a79fb1a6e7343b6
Related: OS#4006, SYS#4895
2021-04-08 03:20:39 +02:00
Vadim Yanitskiy 33f456dda3 trx_toolkit: make codec.py work with EOL Python 3.5
Our build system is based on Debian 9 and EOL Python 3.5, so we have
to maintain backwards compatibility (sigh).  Some type hints moved
to comments, some had to be commented out completely.  Hopefully,
we can 'un-vandalize' the code by reverting this change once there
will be no requirement to support EOL stuff.

Change-Id: I7211cfbb7549b6e700aa3dd44464ff762fd51185
Related: OS#4006, SYS#4895
2021-04-08 03:20:39 +02:00
Vadim Yanitskiy a772337e27 trx_toolkit: check in simple declarative codec
Change-Id: I7ff46b278c59af3720ee7f3950ea5a8b2f1313e1
Related: OS#4006, SYS#4895
2021-04-08 03:20:39 +02:00
Vadim Yanitskiy b00601d7ee trx_toolkit/data_msg.py: add type hints to static methods
Change-Id: I06fd8bc7418700de40467fd63a08da2bc2abcea2
2021-04-08 03:20:39 +02:00
Vadim Yanitskiy 45cc12d665 trx_toolkit/udp_link.py: cosmetic: setblocking() takes bool
Change-Id: I9c4fa8cb7c237f3b9e34ba236b6507da5c668aee
2021-03-14 00:57:43 +01:00
Vadim Yanitskiy c8754d47db trx_toolkit/data_msg.py: use uppercase for KNOWN_VERSIONS
Change-Id: Ie4dcc8e91115c514ace243a95a9b44a17cd976b4
Related: OS#4006, SYS#4895
2021-03-01 15:02:35 +00:00
Vadim Yanitskiy ba3e1f7c2a trx_toolkit/data_msg.py: use tuple for DATAMSG.known_versions
Change-Id: I79de5fe478297e1850d9582426888411a0189d3f
Related: OS#4006, SYS#4895
2021-03-01 15:02:35 +00:00
Vadim Yanitskiy f9938b3a54 trx_toolkit/data_msg.py: decorate abstract methods as such
Change-Id: I27fdcfdabc2b5318ab3e958d2e5446e670fe9035
Related: OS#4006, SYS#4895
2021-03-01 15:02:35 +00:00
Vadim Yanitskiy 7a31e98936 trx_toolkit/data_msg.py: convert comments into docstrings
Change-Id: I856b54fd1baca4ae0edd2aa59be6a76372cef667
Related: OS#4006, SYS#4895
2021-03-01 15:02:35 +00:00
Vadim Yanitskiy 904d128c4d trx_toolkit/data_msg.py: do not instantiate abstract class DATAMSG
Change-Id: I811f67ae030ccd93e1c6a421097cec36ca01cbf9
Related: OS#4006, SYS#4895
2021-03-01 15:02:35 +00:00
Pau Espin 5c3c28cc1d tests: Replace deprecated API log_set_print_filename
Change-Id: I9d24365d2be528477f1c190c698a81bfc7f2d2df
2021-02-19 14:16:53 +01:00
Vadim Yanitskiy 02830f3bd2 trx_toolkit/clck_gen.py: fix: Thread.isAlive() was removed
As it turns out, in Python < 3.9 class Thread defines 'is_alive'
and 'isAlive = is_alive'.  In Python 3.9 the later has been
removed, so fake_trx.py crashes on receipt of 'POWEROFF':

  File "/home/wmn/wmn/osmocom/bb/src/target/trx_toolkit/clck_gen.py",
    line 63, in running
      return self._thread.isAlive()
  AttributeError: 'Thread' object has no attribute 'isAlive'

See https://bugs.python.org/issue35283 for more details.

Change-Id: Id441d76dddb659958803d507e0fb028fb06422a7
2020-12-25 14:40:34 +01:00
Vadim Yanitskiy 5599258b67 firmware/layer1: invalidate hard-coded Measurement results
This is what the L1 sends to the network before the first SACCH
block is received from the higher layers.  The indicated values
are of course invalid because they're hard-coded.

According to 3GPP TS 44.018, table 10.5.2.20.1:

  0  The measurement results are valid
  1  The measurement results are not valid

Change-Id: I136307baef3fa2ddd1d5cec2a7f8c9e6d4602499
Related: I7da767e146aec7cef1de71e4d735d6a02b6c5642
Related: SYS#4918
2020-12-01 13:43:03 +01:00
Vadim Yanitskiy 4bbe47b02b firmware/layer1: clarify the content of Measurement results
Change-Id: I3203790c529f93d0084c82136645683a26faf986
Related: I26546dcbc853166e351d00260936b1b9d584ae03
2020-12-01 12:57:41 +01:00
Vadim Yanitskiy a7298e316f trxcon/scheduler: invalidate hard-coded Measurement results
This is what trxcon sends to the network before the first SACCH
block is received from the higher layers.  The indicated values
are of course invalid because they're hard-coded.

According to 3GPP TS 44.018, table 10.5.2.20.1:

  0  The measurement results are valid
  1  The measurement results are not valid

Change-Id: I7da767e146aec7cef1de71e4d735d6a02b6c5642
Related: SYS#4918
2020-11-30 16:06:48 +01:00
Vadim Yanitskiy 1ae959fe25 trxcon/scheduler: clarify the content of Measurement results
Change-Id: I26546dcbc853166e351d00260936b1b9d584ae03
2020-11-30 16:00:13 +01:00
Vadim Yanitskiy a7b6dea829 trxcon/scheduler: clarify Measurement results padding
Table 10.5.2.20.0 "Measurement Results Contents" in 3GPP TS 44.018
is clear on what should be used as padding - '0**', i.e. zeroes.

Change-Id: I4db6845c98aded10291134f416da98fd0f4f58e3
2020-11-30 14:33:07 +01:00
Pau Espin e5a9077dbd mobile: generate coredump and exit upon SIGABRT received
Previous code relied on abort() switching sigaction to SIG_FDL +
retriggering SIGABRT in case the signal handler returns, which would
then generate the coredump + terminate the process.
However, if a SIGABRT is received from somewhere else (kill -SIGABRT),
then the process would print the talloc report and continue running,
which is not desired.

Change-Id: Ied0f47378a5d348b857424adb5c874c1c093b485
Fixes: OS#4865
2020-11-25 18:45:26 +01:00
Pau Espin efb88bf5ff trxcon: generate coredump and exit upon SIGABRT received
Previous code relied on abort() switching sigaction to SIG_FDL +
retriggering SIGABRT in case the signal handler returns, which would
then generate the coredump + terminate the process.
However, if a SIGABRT is received from somewhere else (kill -SIGABRT),
then the process would print the talloc report and continue running,
which is not desired.

Change-Id: I6d80f3f2742d397e47f4f2970c951f2cf6d58172
Fixes: OS#4865
2020-11-25 18:44:46 +01:00
Pau Espin 581cfbeba9 trxcon: Handle signal SIGABRT
The signal handler was coded as if it was handling SIGABRT, but the
signal handler was not overwritten so it is actually used.

Change-Id: I5c597f3410fc97be138db6f3976df59f393819b6
2020-11-25 18:42:09 +01:00
Harald Welte c6fb802252 Use osmo_fd_*_{disable,enable}
Change-Id: If4c7f946852d153bd472e5c704f8d517d26ca22e
Depends: libosmocore.git Idb89ba7bc7c129a6304a76900d17f47daf54d17d
2020-11-11 20:14:58 +00:00
Harald Welte 00d1223d05 Use osmo_fd_*_{disable,enable}
Change-Id: I65d37821873767e61a7eca029f9b30938a299683
Depends: libosmocore.git Idb89ba7bc7c129a6304a76900d17f47daf54d17d
2020-11-11 20:14:45 +00:00
Vadim Yanitskiy 082b618ea4 trxcon/l1ctl_link: use osmo_store16be() in l1ctl_link_send()
Change-Id: I96ca1c581d028a1f3c89c83a575fd8dbc9751962
2020-11-05 13:36:43 +07:00
Harald Welte 7c34854880 osmocon: More decoding of tpu_debug (on compal/rffe_dualband)
Let's give a more human-readable decode of the TPU instructions,
naming the TSPACT pin names as well as the device_id/strobe.

Change-Id: Iac1ac74ac3e41cff9d3d347a167b43af58cc6e59
2020-10-25 09:38:08 +01:00
Harald Welte 6883bd2f75 tpu: Fix TPU_DEBUG: keep local cache of instructions
TPU_DEBUG used to read from TPU RAM, which unfortunately seems rather
slow, so copying it over from there broke overall timing leading to
infamous "DSP Error 24" when TPU_DEBUG is enabled.

Change-Id: Idde061df8c129aa51b2e4540c8ef2e4116468c9c
2020-10-25 09:38:00 +01:00
Harald Welte 9785a92d66 tpu: Fix msgb-write-beyond-tailroom in TPU_DEBUG
We need to make sure to allocte sufficient space to include
the 32bit frame number at the start of the TPU_DEBUG msgb.

Change-Id: Ifb3ce6f91131fc361b20c3b3fe5ebc7079633ac3
2020-10-24 12:37:22 +02:00
Harald Welte 46cf9b1043 gsm48_rr: Don't swap ber with snr in "MON:" log line
I was quite confused why I constantly see a bit error rate reported
by gsm48_rr, while at the same time the actual L1CTL_DATA_IND did
all state num_biterr == 0.

So the log statement was broken ...

Change-Id: I09bb6c606a8437b213bb444949c78a7c8a10542c
2020-10-23 23:32:10 +02:00
Harald Welte d90ae30caa mobile: Use osmo_fd_setup() in script_lua.c
Change-Id: Ib6f97b9b8f3af63b81b92071b7fdb1fd55da89a5
2020-10-21 11:56:43 +00:00
Vadim Yanitskiy 2c0d9cdcc2 trxcon/l1ctl: fix: send confirmation for TCH mode request
Both REQ and CNF share the same message structure, so we can
cheat a bit by changing the message type and sending it back.

Change-Id: I6f403ed0506b4b1872361d9976d3186bfe514b52
Related: OS#4799
2020-10-19 21:07:26 +07:00
Harald Welte de31aa3af7 Use osmo_fd_setup() whenever applicable.
Change-Id: If9b636c295fc6b5349a54c70662f09efa616ee63
2020-10-18 23:34:46 +02:00
Harald Welte 508d8523c0 Use OSMO_FD_* instead of deprecated BSC_FD_*
Change-Id: Ibf64b18288b9109927035f650d6ef7ad9f15d688
2020-10-18 22:43:05 +02:00
Vadim Yanitskiy 39264cc3a8 fix trx_if_tx_burst(): do not drop Uplink bursts in TRX_STATE_RSP_WAIT
Some commands, such as SETTA or SETPOWER, are expected to be sent
when the transceiver is powered on.  We should not drop Uplink
bursts while waiting TRXC response.

For now it's easier to comment out the state check completely,
because the existing TRXC state machine is quite messy.

Change-Id: Iefe6030200b11b29a5790d1f4aa4070ed1d9a493
2020-10-16 23:08:38 +07:00
Vadim Yanitskiy e42e5a0789 layer23/cbch-sniff: fix: use Osmocom specific RSL channel number
This way the layer1 can activate proper CBCH task and send us
CBCH block with proper RSL channel number, so they do not end
up being routed to LAPDm and rejected there.

Change-Id: Ib1d5c99587202a9d94aeb7b63de7ae8c4fb15af0
2020-10-13 08:46:11 +00:00