Commit Graph

3221 Commits

Author SHA1 Message Date
Vadim Yanitskiy 5d634b6118 gsmmap: move this utility to 'layer23/src/misc/'
What I find weird is that the gsmmap is using files from layer23,
and vice-versa cell_log from layer23 is using files from this
utility.  And somehow they are separate sub-projects.

I see no reason why gsmmap must be in its own sub-project.

Change-Id: I2bc9c8897f3c7ccf207be0146f7b55fc733a6abb
2023-01-03 02:43:57 +07:00
Vadim Yanitskiy 48c3243dd7 gsmmap: fix -Werror=old-style-definition
Change-Id: I44ad2f34b317152616c77f6c1fdb4f06a7b511c5
2023-01-03 02:34:13 +07:00
Vadim Yanitskiy 621214c802 layer23: make all apps depend on libosmo-gprs-rlcmac
This will be needed for the modem application, and is also used
in a follow-up commit adding support for parsing SI13 Rest Octets.

Change-Id: I8e0f826c9b2a886f94624176e34e7d197e93d25f
Related: OS#5500
2023-01-03 00:18:34 +07:00
Vadim Yanitskiy 9fdf8c9f9e contrib/jenkins.sh: build some sub-projects with --enable-werror
Change-Id: I8976ba3c52a3b4a47c98b9e6e85c7b9dcef4575a
2023-01-03 00:18:07 +07:00
Vadim Yanitskiy 36c38ce481 contrib/jenkins.sh: make use of $PARALLEL_MAKE
Change-Id: I371a8dca6d992622d005d8c9d84eaaad6f3c7372
2023-01-03 00:18:07 +07:00
Vadim Yanitskiy 34cc5e01f4 contrib/jenkins.sh: also run distcheck for trxcon and virt_phy
Change-Id: I5664806df4051694a5ce705420cd574f7a7da531
2023-01-03 00:18:07 +07:00
Vadim Yanitskiy a445c6db81 virt_phy: fix make distcheck: access l1ctl_proto.h via symlink
Accessing a header file from outside of the sub-project requires
using the relative path ("-I$(top_srcdir)/../layer23/include"),
which does not resolve properly during make distcheck.

The '../layer23/include/l1ctl_proto.h' is actually a symlink too.

Change-Id: Id64ab161a17d53f5e93cdd100e81d4fb8acfb97a
2023-01-03 00:17:03 +07:00
Vadim Yanitskiy cad5af50cc mobile: gapk_io_init_ms(): fix 'phy_fmt' may be used uninitialized
Change-Id: I193de6e0e831aa4201f5edec80e40abc43f4a861
2023-01-02 20:41:41 +07:00
Vadim Yanitskiy 3432c6cfe0 layer23/sysinfo: update coding style, make pointers const
Change-Id: Ia518251eae1b45ad573d076d97cba83ed25ea9ea
Depends: libosmocore.git Ide9110b984d3302aec6b439c563eb10e2dcdec9e
2023-01-02 20:24:50 +07:00
Vadim Yanitskiy e25fb14f6d layer23/sysinfo: use OSMO_MIN from libosmocore
Change-Id: Ic01cadda13a7d7a3d34ddb94bd3964044f38959c
2022-12-31 02:36:03 +07:00
Vadim Yanitskiy ed29bd3e41 modem: Makefile.am: remove unneeded CFLAGS and LIBS
Change-Id: I2bb04f526c4e3019c548786f2cdfb96b018826ec
2022-12-30 20:27:43 +07:00
Vadim Yanitskiy 9b1df1231f layer23: configure pretty logging for misc apps
Change-Id: I827055bcf04f8003fcb90e6c8c90813ecda2efed
2022-12-30 20:27:43 +07:00
Vadim Yanitskiy 00a67a0e9d layer23: use osmo_stderr_target in misc apps
Change-Id: I56770f04fa3c440e6ccabe6f6fccfe171d41d751
2022-12-30 20:27:43 +07:00
Vadim Yanitskiy 13fe9ccf55 trxcon: TRXCON_EV_DCH_REL_REQ does not switch to TRXCON_ST_RESET
It's not really clear to me how the L1 is supposed to handle the
L1CTL_DM_REL_REQ message, which maps to the TRXCON_EV_DCH_REL_REQ
in our case.  Lookig at the layer23 code I see that it's sent along
with the L1CTL_RESET_REQ (maps to the TRXCON_EV_RESET_SCHED_REQ).
The layer1 firmware does reset some parameters on receipt of the
L1CTL_DM_REL_REQ and some more parameters on the L1CTL_RESET_REQ.

It's clear though that we should not switch to the TRXCON_ST_RESET
on receipt of the L1CTL_DM_REL_REQ.  The layer23 application
(e.g. mobile) may send L1CTL_DM_EST_REQ right after that, and we
won't be able to transition from the TRXCON_ST_RESET directly to
the TRXCON_ST_DEDICATED.  Such transition is neither implemented
nor permitted by 3GPP TS 44.004, Figure 5.1.

Ideally, according to 3GPP TS 44.004, Figure 5.1, we should have
an additional transient state 'TUNING DCH' in the trxcon_fsm and
switch there on reciept of the L1CTL_DM_REL_REQ.  But currently
it's not implemented and adding it would require some effort.

As a temporary solution, let's do not change the current state and
stay in the TRXCON_ST_DEDICATED.  This workaround is needed to make
mobile terminated calls work in the mobile app.

Change-Id: I5bbe6ca4cc6299f9faf343822c992a6872a45081
Related: OS#5599
2022-12-21 15:08:40 +00:00
Vadim Yanitskiy 6391546181 mobile: rework writing BA to file, move to a function
Sometimes I am seeing error messages like this:

  DCS ERROR Failed to write BA list

The problem is that there can be several BA entries which need to
be written, and for each of them we're calling fwrite() twice.
This function returns number of items written, so the final sum
of returned values would be: len(BA list) * 2.  Thus expecting
it to be 2 regardless of len(BA list) is wrong.

Fix this by checking the sum in each iteration, not at the end.
Take a chance to refactor the code and move to a function.

Change-Id: Id8bc216c146127d9c9995379c9e56450d328f46d
2022-12-21 15:07:21 +00:00
Vadim Yanitskiy 7c2a471103 layer23: fix rx_l1_sim_conf(): msg->l2h is NULL, use msg->l1h
The mobile app crashes when using a Calypso phone and specifically
when using its built-in SIM reader.  The problem is that msg->l2h
is NULL in rx_l1_sim_conf(), so msg->l1h must be used instead.

  Assert failed msgb->l2h /usr/local/include/osmocom/core/msgb.h:162

Change-Id: I7c68a3ad393be5fd0413e00e119a06db59672357
2022-12-21 15:07:21 +00:00
Vadim Yanitskiy 040bf41028 trxcon: allow extending FBSB timeout (quirks for slow PHYs)
This is needed for SDR based PHYs, because for them it takes longer
to tune, flush the buffers and so on.  Add a field to the trxcon_inst
structure and a command line option (-F) for the trxcon app.

Change-Id: Ia68954c5bdacda45fc871ffea0ccdf2460936408
Related: OS#5599
2022-12-20 23:28:56 +07:00
Vadim Yanitskiy 2c347f9979 trxcon: use strtoul() instead of atoi(), detect errors
Change-Id: I18ec88f1ee30c58d088fe65650d0257b262c1fee
2022-12-20 23:28:56 +07:00
Vadim Yanitskiy f7d5d8d4ff trxcon: move FBSB timeout calculation to the trxcon_fsm
In the upcoming patches I am adding a possibility to enlarge the FBSB
timeout by providing API for that.  This is needed for SDR based PHYs,
because for them it takes longer to tune and so on.  The L1CTL codec
is not the right place for applying PHY specific quirks, so let's
move the TDMA FNs -> ms conversion to the FSM logic.

Change-Id: I685f48cfed000997b0d7c16073c6387bc05d2bbe
Related: OS#5599
2022-12-20 14:38:26 +00:00
Vadim Yanitskiy 0883c25ac5 trxcon: reset the L1 params on TRXCON_EV_RESET_FULL_REQ
Change-Id: Ie94b7977fec857aa5f13f53162816d5fd9f5594c
Related: OS#5599
2022-12-15 04:31:06 +07:00
Vadim Yanitskiy a6d2e1a12b trxcon: fix distcheck: add missing trxcon_fsm.h to noinst_HEADERS
Change-Id: Ib64b15c8ad700a7df71513469df454c74322b998
Fixes: 6fc090593d
2022-12-13 03:18:52 +07:00
Vadim Yanitskiy edfcc28fda trxcon: fix l1ctl_tx_dt_conf(): accept const *cnf
The *cnf param of l1ctl_tx_dt_conf() was already declared as const
in the header file, however it was not in the actual function
definition.  Take a chance to fix formatting in the header.

Change-Id: I842ac717a6959830c536cbf91efdbb6a4ee931ce
2022-12-11 23:13:45 +07:00
Vadim Yanitskiy 5e331c196a mobile: gsm48_rr_rx_acch(): clarify logging messages
Change-Id: Ibc2d54c2879fa28225d46222239829f699277f6c
2022-12-10 19:11:20 +07:00
Steve Markgraf aeb19ea3ef fw: Add display driver for K200i/K220i
Change-Id: I90fbe583983de34f39ec402d5a35712dfe57222b
2022-12-09 20:25:01 +07:00
Steve Markgraf c7b7b20ac6 fw: fix TIFFS geometry for Sony Ericsson K220i phones
Change-Id: Ic426c9bc01733ff923f33cafe8012f9068b709ef
2022-12-09 20:24:31 +07:00
Steve Markgraf d78f88c25a fw: Add initial support for Sony Ericsson K200i/K220i phones
Includes RF frontend configuration, TIFFS config, keymap.

Currently still using the rf_tables and afcparams from gta0x.
No display driver yet.

Make sure to run osmocon with -m romload -i 10

Change-Id: I711702862b1cec5a8089dac071f8a171ca026003
2022-12-09 12:30:55 +00:00
Vadim Yanitskiy 10eeb3cac9 firmware: remove TCH/F specific bit re-ordering
This is a partial revert of d49a748cbb.

The GAPK based audio I/O implementation of the mobile app is now capable
of handling TI's specific TCH frame format, which can be configured via
the VTY interface ('io-tch-format ti').  Thus there is no need to have
the conversion logic in the firmware anymore.

This patch also fixes the layer1 firmware, so it does not hang on
receipt of Uplink TCH frames anymore when compiled with recent
arm-none-eabi toolchain (v12.2.0 on my machine).

Change-Id: I5afd4e4ddd9c06d32768d01bc1e3e18d476706fb
Related: OS#3400
2022-12-06 06:28:56 +07:00
Vadim Yanitskiy 67d45c054a mobile: do not enforce RTP format for Uplink TCH frames
This is a partial revert of 8f04fa9758.

The GAPK based audio I/O implementation of the mobile app is now capable
of handling TI's specific TCH frame format, which can be configured via
the VTY interface ('io-tch-format ti').  TCH frames in this format are
different from the ones in RTP format and may have different length and
different bit ordering.  Remove voice_frame_verify().

Change-Id: I6113ba443e65ddaae091b643af54c873b7da4de8
Related: OS#3400
2022-12-06 06:28:56 +07:00
Vadim Yanitskiy 12dd3af2a0 mobile: support RTP and TI specific TCH frame I/O formats
Change-Id: Ib41f8c39c82c243b62a76433f59a2b98e175f894
Related: OS#3400
2022-12-06 06:28:56 +07:00
Vadim Yanitskiy 97deddcd45 mobile: clean up GAPK I/O state on channel release
Do not assert() in gsm_recv_voice(), because channel release does
not happen immediately and the PHY may be still sending TCH frames.

Change-Id: I8943ee9bd46afc96e6d7cfd52c95c34fd311ce11
Related: OS#3400
2022-12-06 06:28:56 +07:00
Vadim Yanitskiy ebd909b05a trxcon: print TCH mode using gsm48_chan_mode_name()
Change-Id: I6c54ad857b91ef1a32501912ba4c393e1c04eff0
2022-12-06 06:28:56 +07:00
Vadim Yanitskiy 9d9698064c trxcon: add value-string defs for L1CTL Reset / CCCH Mode
Change-Id: I045b2c771b24d301570c9556770e97afedc8274a
2022-12-05 08:13:15 +07:00
Vadim Yanitskiy 564b644a0b trxcon: constify pointers in L1CTL decoding functions
Change-Id: Ife66b3c14f0ee2f29bf934db1f58512d52669b38
2022-12-05 08:13:15 +07:00
Vadim Yanitskiy 974bd15d25 trxcon: trxcon_fsm: permit direct DCH/PDCH transitions
It may happen that the MS needs to go directly from a PDCH to a TCH
or SDCCH, e.g. in case of a Mobile Terminated call.  I don't know
if the opposite transition is needed on practice, but let's simply
allow direct transitions for both TRXCON_ST_{DEDICATED,PACKET_DATA}.

Change-Id: I1a854e4683f102c40f1c174a291b6dc638f49b5c
Related: OS#5599
2022-12-05 08:09:29 +07:00
Vadim Yanitskiy c6fe9c3fa1 trxcon: trxcon_fsm: permit loop [P]DCH transitions
According to 3GPP TS 44.004, Figure 5.1, it's absolutely legal to
perform loop transitions in state 'DCH' (i.e. from 'DCH' to 'DCH').

This kind of transition is needed in the following cases:

* on reciept of RR FREQUENCY REDEFINITION,
* on reciept of RR ASSIGNMENT REQUEST,
* on reciept of RR HANDOVER REQUEST,

when going back from state 'DCH' to state 'BCH' is not required nor
actually desired.  In context of the trxcon_fsm, this applies to
both TRXCON_ST_DEDICATED and TRXCON_ST_PACKET_DATA, as they both
represent what's defined as 'DCH' in the Figure 5.1.

Change-Id: I3b402ec84610a5df744d9b06e5f7dab7a9a3ddad
Related: OS#5599
2022-12-05 08:09:29 +07:00
Vadim Yanitskiy 5f4f632442 trxcon: trxcon_fsm: separate handling of TRXCON_EV_DCH_EST_REQ
This new function will be re-used in a follow up patch implementing
handling of TRXCON_EV_DCH_EST_REQ in TRXCON_ST_{DEDICATED,PACKET_DATA}.

Change-Id: I8db93fcdace7aaa8bc3876b14e441304349a36d5
Related: OS#5599
2022-12-03 15:14:47 +07:00
Vadim Yanitskiy 13cabcb281 trxcon: trxcon_fsm: shorten DCH related event names
Purely cosmetic change, making the lines using these events shorter.

Change-Id: Ie388e251677da63306e9e53d98cbcc7c34777980
Related: OS#5599
2022-12-03 08:11:34 +00:00
Vadim Yanitskiy 93b1884914 trxcon: trxcon_fsm: disallow invalid state transitions
According to 3GPP TS 44.004, Figure 5.1, transitioning from state
'DCH' directly to state 'BCH' is not permitted.  Speaking in terms
of the trxcon_fsm, the following state transitions are invalid:

* TRXCON_ST_DEDICATED -> TRXCON_ST_BCCH_CCCH,
* TRXCON_ST_PACKET_DATA -> TRXCON_ST_BCCH_CCCH.

We never do such transitions anyway, so we are good.

Change-Id: I14ebfc5c86d37765ad06fa91321a469dea46e50f
Related: OS#5599
2022-12-03 08:11:34 +00:00
Vadim Yanitskiy 5780e57dd4 trxcon: link trxcon against libl1sched.la directly
Change-Id: I8a1319077167f118d1909a8ab33d33a73f47541a
Related: OS#5599
2022-12-03 08:10:44 +00:00
Vadim Yanitskiy df7fa3e296 mobile: integrate GAPK based audio (voice) I/O support
This change introduces a new feature to the mobile application -
audio I/O support, which allows the user to speak right from the
host side running mobile through its ordinary mic and speakers.

The audio I/O is based on libosmogapk [1][2], which in its turn
uses the ALSA sound system for the playback and capture.  This
is a new optional dependency of mobile, which is automatically
picked up if available during the build configuration.  Whether
to depend on it or not can be controlled using '--with-gapk-io'.

The API offered by libosmogapk implies to use the processing chains,
which generally consist of a source block, several processing blocks,
and a sink block.  The mobile app implements the following chains:

  - 'pq_audio_source' (voice capture -> frame encoding),
  - 'pq_audio_sink' (frame decoding -> voice playback).

both taking/storing TCH frames from/to the following two buffers:

  - 'tch_fb_ul' - a buffer for to be played DL TCH frames,
  - 'tch_fb_dl' - a buffer for encoded UL TCH frames.

The buffers are served by a new function gapk_io_dequeue().

[1] https://gitea.osmocom.org/osmocom/gapk/
[1] https://osmocom.org/projects/gapk

Change-Id: Ib86b0746606c191573cc773f01172afbb52f33a9
Related: OS#5599
2022-12-01 01:05:38 +07:00
Vadim Yanitskiy b1cfa18d77 mobile: gsm_forward_mncc(): properly mark TCH/H frames
Change-Id: Id3f459bc767ebf31469287fa672893239c5977d9
Related: OS#5599
2022-12-01 01:05:38 +07:00
Vadim Yanitskiy e69d3f4ba1 mobile: gsm_forward_mncc(): call mncc_sock_from_cc() directly
This way we can avoid allocating another msgb and enqueue the given
msgb directly to the write queue of the MNCC socket.

Change-Id: I29305866e61a0bc3bd082108af6a9ba8ff86bcf2
Related: OS#5599
2022-12-01 01:05:38 +07:00
Vadim Yanitskiy 100ec4ca6f mobile: rework gsm_recv_voice(), add AUDIO_IOH_MNCC_SOCK
Do not send voice frames to the external MNCC unconditionally.
Add a new I/O handler type for the external MNCC application.

Change-Id: I406b169963e6654110329d741728fa12c8c8eeec
Related: OS#5599
2022-12-01 01:05:38 +07:00
Vadim Yanitskiy 37a6a2c5c4 mobile: improve function comments in voice.c
Change-Id: I0285a07841bdc2568374f9e9cd0214eef1415186
Related: OS#5599
2022-12-01 01:05:38 +07:00
Vadim Yanitskiy 290ea6b7fa mobile: add missing TCH MNCC messages and handle them
Change-Id: I28a1ae1ed504748c33c64c86ca7d57a94c7c7c6d
Related: OS#5599
2022-12-01 01:05:38 +07:00
Vadim Yanitskiy 7304b1720d mobile: timeout_rr_meas(): use osmo_strbuf API
Change-Id: I0c505b753bcfb06d9f2f085d56d7d56fb1c44d50
2022-11-30 18:35:14 +07:00
Vadim Yanitskiy ff44b9c3ed mobile: timeout_rr_meas(): fix sprintf() formatting
Change-Id: Ia8a101005d027fb5d0ddc2566f92ab2060f21c36
2022-11-30 18:27:58 +07:00
Vadim Yanitskiy e4541c35db mobile: timeout_rr_meas(): fix uninitialized variable
Change-Id: I956a1cafe9fed1a881574f59d0532e5cf931a1f7
Fixes: c9e579cea137fd147173434b7fa128d37685011
Fixes: CID#300084
2022-11-30 17:22:48 +07:00
Vadim Yanitskiy a4aac5c355 trxcon: implement Ready-to-Receive PHYIF API
This API is going to be used by osmo-trx-ms for inquiring the l1sched
about an lchan state before attempting to demodulate a Downlink burst.

Change-Id: I9a71b8a59733f4dd908b760c5e23ea3d624afb1a
Related: OS#5599
2022-11-29 11:03:11 +00:00
Vadim Yanitskiy b76c330f6d trxcon: implement Ready-to-Send PHYIF API
This API is going to be used by osmo-trx-ms for pulling Uplink bursts
from the scheduler in a synchronous way, without relying on the
timer driven libtrxcon's internal scheduler.

Change-Id: Ic8f74413f5fad277340e007dd4296f890155a2c1
Related: OS#5599
2022-11-29 11:03:11 +00:00