Commit Graph

3052 Commits

Author SHA1 Message Date
Vadim Yanitskiy 569ea1e9d2 firmware/apps/layer1: remove unused 'atrLength' in main()
Change-Id: I4bb1dae28c07218e8b801bc162b82d03fd083bad
2022-04-25 16:17:28 +03:00
Vadim Yanitskiy 17d6073e72 firmware/apps/rssi: remove redundant block in handle_pm()
Below in the common path for both true and false branches we do
have a conditional block setting ARFCN_UPLINK if uplink is true.

Change-Id: If3adc5d1f11d3f43cb4c17bdb355b160ab61dc56
2022-04-25 16:17:28 +03:00
Vadim Yanitskiy 8ecc266d8d firmware/apps/rssi: fix -Wmaybe-uninitialized in handle_pm()
In this function we have the following condition:

  if (pm_mode == PM_IDLE && (mode == MODE_MAIN || mode == MODE_SPECTRUM))

so the 'mode' can be either MODE_MAIN or MODE_SPECTRUM.  Still,
GCC throws false-positive warnings that 'a' and 'e' may be used
uninitialized in handle_pm().

Let's eliminate these warnings by using 'if-else' statement.

Change-Id: I86d241c41d4de135f4cd79f56f7fdd18696b7890
2022-04-25 16:14:35 +03:00
Vadim Yanitskiy 3f49d7a0fa firmware/layer1: fix unused variable 'l1h' [-Wunused-variable]
Change-Id: If8c3da3908c1dab7a93e69daee13426f9bdbccad
2022-04-25 16:14:21 +03:00
Vadim Yanitskiy 80ef655d00 firmware/layer1: fix 'MFNONE' not handled in switch [-Wswitch]
Change-Id: I4c38599b29de73e26e9b603564f63b88e65e16b9
2022-04-21 15:03:11 +03:00
Vadim Yanitskiy a6fad425db firmware/layer1: fix -Wtype-limits in chan_nr2mf_task_mask()
arm-none-eabi-gcc versions 11.2.0 shows the following warning:

  layer1/l23_api.c: In function 'chan_nr2mf_task_mask':
  layer1/l23_api.c:123:25: warning: comparison is always true due to
                                    limited range of data type [-Wtype-limits]
    123 |         if (second_task >= 0) /* optional */

Let's get rid of {master,second}_task by using a macro.

Change-Id: I00bd3e11a14f10b78fd91f0e6915ca4fc0817d6a
2022-04-21 15:03:11 +03:00
Vadim Yanitskiy 859485c681 firmware/abb: fix missing 'break' in twl3025_unit_enable()
Change-Id: I8224f8c2dba6891ef3fffcb6eed6572d35132d2e
2022-04-21 15:03:11 +03:00
Oliver Smith e634dec487 mobile/subscriber.c: fix auth resp with test sim
Do not send a dummy authentication response with the test sim.

Fixes: 39dc9c46 ("mobile/subscriber.c: consider GSM_SIM_TYPE_SAP too")
Change-Id: I0ee910c171d383fb2cdcaf5eb54eafe18da3430b
2022-02-23 17:59:32 +01:00
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
Harald Welte da2793a216 gprsdecode: Don't leak memory in gsmtap_sendmsg()
Change-Id: Ib9e439ad6f24c573abb6da1523713a669898d23f
Depends: libosmocore I106b09f2a49bf24ce0e8d11fd4d4ee93e9cafdf5
Related: OS#5329
2021-11-25 15:40:02 +01:00
Philipp Maier 0af84f408d logging: use meaningful default loglevels
Some logging categories use LOGL_INFO or even LOGL_DEBUG. Lets set those
to LOGL_NOTICE to have a less crowded default log output.

Change-Id: I3faefccae2218b17bd942bc2afac7d8e515897b7
Related: OS#2577
2021-11-15 17:12:22 +00:00
Harald Welte 3e8518a44b layer23/osmocon: require libosmocore >= 1.5.0 in configure.ac
This should give a meaningful error message if people use too old
libosmocore.

Change-Id: I7d9950b5eaa836ed1ac86045bd5364fed221e369
2021-10-16 10:55:33 +02:00
Harald Welte 98219554b6 262-10 is "DB Netz AG" and not "DB Systel"
Change-Id: Idbce4bade4305fabbedcf15c5bd9253fbb371744
2021-10-08 05:46:57 +00:00
Vadim Yanitskiy 00b70983a5 trx_toolkit: support setting artificial delay for TRXC
Change-Id: Idb1ef445bc14a6312f08a83ecacc3a938b0e1d70
Related: OS#5245
2021-10-03 14:13:51 +06:00
Vadim Yanitskiy 2308b58250 trxcon/scheduler: unify and enrich decoding error messages
Regarding the removal of burst_mask2str() from the TCH/H handler,
it does not make sense to print it because the mask is already
shifted and an earlier logging should already contain this info.

Change-Id: I42d20e2da73c21ca366dd246244cd716c8ccb459
Related: OS#4823
2021-07-04 20:02:53 +02:00
Vadim Yanitskiy f8bc28505f trxcon/trx_if: send NOPE indications if there is no burst
In a typical setup operating on the real radio interface, it's
the duty of the transceiver (e.g. osmo-trx) to send NOPE.ind to
the L1 implementation (e.g. osmo-bts-trx).  However, in a
virtual environment for ttcn3-bts-test we use a fake transceiver,
which due to its simplicity cannot send NOPE indications itself.

The lack of queues and buffering does not allow us to implement
NOPE indications in fake_trx.py, so the easiest approach is to
generate them from trxcon.  Send TRXD PDUs without the burst bits,
and fake_trx.py will tranform them info NOPE.ind for us.

Change-Id: I1c7f1315b8ef44f651efd6a22fb5b854f65c0946
Related: SYS#5313, OS#1569
2021-06-16 15:55:38 +02:00
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
Oliver Smith 4642ab6827 contrib/jenkins: don't build osmo-gsm-manuals
Related: OS#4912
Change-Id: If8f88bde0614547bb5c4f4f6e97fc20fcecd8a2c
# ---
2021-01-13 13:10:55 +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