Commit Graph

3013 Commits

Author SHA1 Message Date
Harald Welte 56e611e95e WIP: burst_process: Initial Fax (FA) frame support
Change-Id: Id4e198a79a56a7a100a84af9dc334b48242f6cfd
2023-03-19 14:38:59 +01:00
Harald Welte 079cbcc626 burst_process: Add GSMTAP output
Change-Id: I9feb08fc0bb01b2fcf9b373360e1fab7f5031308
2023-03-19 14:38:59 +01:00
Harald Welte 1fb121b87c HACK: add burst_ind file containing /usr/share/common-licenses in UL
starts with Apache license.

Change-Id: I85a9ab279ea8f4907586e408d4f5075e0088257f
2023-03-05 19:57:20 +01:00
Harald Welte 70271423f8 HACK: WIP to post-process burst_ind .dat files with 9.6 NT CSD
Change-Id: I907a4e7dae76c4aef532df44b246b3a4f66c3043
2023-03-01 10:23:17 +01:00
Steve Markgraf 967f71b7d1 fw: fix build with arm-none-eabi-gcc 11.2.0 2022-02-03 04:05:24 +06:00
Vadim Yanitskiy 3273003062 host/osmocon: fix setting custom baudrate for CP210x
Sniffing requires higher baudrates, so in serial_up_to_eleven() we
try first to set a non-standard baudrate=406250, which is known to
work well with USB-UART converters based on FTDI's FT232 chip.

Contrary to the FTDI's converters, CP210x based ones cannot be
configured to use a non-standard baudrate directly.  They require
special mappings to be present in the EEPROM, so then using a
setting baudrate=B460800 would actually make it use 406250.

Normally, setting baudrate=406250 should fail for CP210x, so we
fall-back to setting baudrate=B460800 if I_HAVE_A_CP210x is defined.
However, for some weird reason, osmo_serial_set_custom_baudrate()
*succeeds* setting non-standard baudrate=406250, what makes osmocon
unable to communicate with the firmware.

This looks like a regression in libosmocore, so let's try to work
it around by moving the baudrate=406250 setting into the else block.

Change-Id: I6c8a8227e5e5862a0f6b4121a6e67a9a2dda2a6d
2022-02-03 03:43:11 +06:00
Vadim Yanitskiy 3cc05e1480 layer23/ccch_scan: handle SI Type 1 in dump_bcch()
Change-Id: I7a27d96070872a1b89809aab1a0d75608ef18d74
2022-02-03 03:43:11 +06:00
Vadim Yanitskiy 18605ebcbd layer23/ccch_scan: fix unused variable in local_burst_decode()
Change-Id: I647c39a7d75c3b05bf36eb6d07f934228d00cebf
2022-02-03 03:43:11 +06:00
Sylvain Munaut 9f2613d7c1 fw: Disable backlight for the sniffing fw
No need to waste battery life

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2022-02-03 02:19:04 +06:00
Sylvain Munaut f6acb79362 [HACK] Disable neighbor measurement task
We really don't care about this and this seems to interfere with
sync for some reason ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2022-02-03 02:19:04 +06:00
Sylvain Munaut bfc3da4363 [HACK] Add burst deciphering support
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2022-02-03 02:19:04 +06:00
Sylvain Munaut ecdab25275 [HACK] host/layer23: Add local burst processing for cleartext bursts
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2022-02-03 02:19:04 +06:00
Sylvain Munaut 501840215f [HACK] host/layer23: Wire application logic for a simple demo sniff app
This listen for IMM.ASS and follows them

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2022-02-03 02:19:02 +06:00
Sylvain Munaut 9df9d2a7c0 [HACK] Disptach the received BURST_IND with a signal
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2022-02-03 02:17:26 +06:00
Vadim Yanitskiy 638fdc932f [HACK] Increase speed of l1ctl to 408250bps after boot
This is required to deal with the increased traffic of a passive listener

Note that it break the 'auto-restart' of osmocon when active because
the bootloader will send the prompt at 115200 baud and we won't see it ...

Change-Id: I59e1f88e057c5a4e3605c55fb14436645339447b
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2022-02-03 02:17:06 +06:00
Sylvain Munaut 547a399300 fw/layer1: Replace all dedicated multiframe task with sniff code
This way, a dedicated mode assign makes it dump all the data

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2022-02-03 02:15:22 +06:00
Sylvain Munaut 34c2212087 fw/l1: Add sniffing primitives
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2022-02-03 02:15:22 +06:00
Sylvain Munaut 1f64e5a694 target/fw/dsp: Add & load the dsp sniffer patch
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2022-02-03 02:15:22 +06:00
Sylvain Munaut 45fbe088b3 target_dsp/calypso: Add a custom DSP patch for burst sniffing
Load it, then set gprs_install_address to 0x015c and then task
23 will be a raw sniffer.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2022-02-03 02:15:22 +06: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