Commit Graph

3280 Commits

Author SHA1 Message Date
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
Vadim Yanitskiy 16ad87bf52 mobile: make LUA support configurable via --with-lua53
Change-Id: If440cee52410421034823a3749709e28c4136b95
2022-11-29 06:05:55 +07:00
Vadim Yanitskiy 993d2ab501 mobile: split gsm_send_voice() -> gsm_send_voice_{msg,frame}()
This is needed to avoid sending voice frames to the L1PHY without
having to use MNCC specific struct gsm_data_frame.

Change-Id: I37241555cd648a8e2b57fa072c708f93cd1ba5a9
Related: OS#5599
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy a3b86ad4dd mobile: voice.h: add missing forward declarations
Change-Id: I854abdcde5bc324f6d0cf309792b36fc64601070
Related: OS#5599
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy 7900ba1a13 mobile: voice.h: use '#pragma once' include guard
Change-Id: I024e13c0f66ae1e42b0c8e2ff77874fcb883e85a
Related: OS#5599
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy 7fed41388c mobile: gsm48_rr_tx_voice(): also permit TCH/H frames
The idea behind checking the ch_type in gsm48_rr_tx_voice() was likely
to prevent sending of the (LCR originated) Uplink TCH frames before
the actual traffic channel is established/modified.

The problem is that this check allows TCH/F frames, but not TCH/H.
Most likely, TCH/H was forgotten or never tested.  Fix this.

Change-Id: I06e84ad47bafd4676af0e136b825e77471587b23
Related: OS#5599
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy fd0baabed3 mobile: properly handle RR CHANNEL MODE MODIFY message
According to 3GPP TS 04.08, section 3.4.6.1.3 "Abnormal cases"
of "channel mode modify procedure", if the MS doesn't support
the indicated channel mode, it shall retain the old mode and
return the associated channel mode information in the
ACKNOWLEDGE message.

Previously, if an indicated mode is not supported, we used to
indicate the 'CHAN_MODE_UNACCT' RR case without sending the
ACKNOWLEDGE message. Also, the result of gsm48_rr_set_mode()
was ignored. Let's fix this!

Change-Id: I952436ec796273e56341f9d3492b4a3b3a5dc410
Related: OS#5599
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy d2d5fabee5 mobile: gsm48_rr_set_mode(): fix copy-paste in comment
Change-Id: I45212cd02ac50d0d363918709720e997500e45a9
Related: OS#5599
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy 73da4bac97 mobile: gsm48_rr_set_mode(): print name of channel mode
Change-Id: I615e89bdd7e1cc01b3258fefa26f7ab5705ae8cc
Related: OS#5599
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy c1d3c01768 mobile: allow enabling/disabling handling of voice in the L1PHY
Some L1PHY targets (e.g. Calypso based Mot C1xx phones) have built in
microphone and speaker.  Some targets do not have them.  Currently we
unconditionally instruct the L1PHY to handle TCH frames internally.
Make this behavior configurable via the VTY interface.

Change-Id: I131f213ef7c2736f7310f0183b83f3bc3064cd98
Related: OS#5599
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy 8d875f3c3d mobile: add MNCC handler selection to settings
Since the mobile application is potentially able to maintain
multiple MS instances, it's better to have a possibility to
choose an MNCC (Call Control) handler per each MS separately.

This change removes the command-line option '-m', which was used
for enabling the external MNCC.  Now it's possible configure the
MNCC handler for each MS via the VTY interface and settings.

The following MNCC-handlers are available:

  - internal - built-in MNCC-handler (default);
  - external - external MNCC-handler via UNIX-socket (e.g. LCR);
  - dummy - dummy handler without CC support.

Change-Id: I2df91c7a79ba5c39bc6ceae900ef649129dd0346
Related: OS#3400
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy c46d0699cd mobile: timeout_rr_meas(): also print sub-slot for TCH/H
Change-Id: I208c159ba610450e1850e601daa2712eef8c23e1
Related: OS#5599
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy fe6345e1c4 layer23: always check return value of rsl_tlv_parse()
Similar to rsl_dec_chan_nr(), this function may also fail, leaving
the given struct tlv_parsed uninitialized.

Change-Id: I13f2a97eeff78ca8ed7d0a2844e4fca430ec7768
Related: OS#5599
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy c9e579cea1 layer23: always check return value of rsl_dec_chan_nr()
The rsl_dec_chan_nr() may fail to decode RSL channel number, so
variables ch_type/chan_ss/chan_ts would remain uninitialized.

Change-Id: I9ab18bdaf41a29fcd32a7060668ef9db07b8cf7e
Related: OS#5599
2022-11-29 02:15:39 +07:00
Vadim Yanitskiy b76743df71 mobile: add MNCC socket path to settings
Previously the MNCC socket path was generated automatically,
using concatenation of the '/tmp/ms_mncc_' prefix and MS name.
Let's allow the user to specify this manually, keeping the same
naming generation method for default value.

Change-Id: I643356ac579bc5e765f668265ec803b22a73739c
Related: OS#3400
2022-11-27 06:12:38 +07:00
Vadim Yanitskiy bdc5acdb13 layer23: l1ctl_tx_traffic_req(): cosmetic: drop dead code
Change-Id: I941899ab27282a495f965ae9a0f41076dceef953
Related: OS#5599
2022-11-27 06:12:38 +07:00
Vadim Yanitskiy b2815c64a6 trxcon: add a spec. reference for the trxcon_fsm
Change-Id: I184abe10f874d97f047a3720c776fdef08d880e6
2022-11-25 22:32:14 +07:00
Vadim Yanitskiy 887b141699 layer23: add 'src/modem/modem' to .gitignore
Change-Id: I37e536493ddfd3bff1674d5bc85f40a0bbd0f317
2022-11-25 22:26:20 +07:00
Vadim Yanitskiy 04b14c49f0 trxcon: trx_data_rx_cb(): support parsing 8-PSK modulated bursts
Change-Id: I78b1a79c329299ab65eb339e9447a47382983cd9
2022-11-25 14:34:55 +00:00
Vadim Yanitskiy 384a8dd3fe trxcon: trx_data_rx_cb(): check TRXD PDU version
Change-Id: If5687d7d87619c0da02cc81ab26d63e61484bc06
2022-11-25 14:34:55 +00:00
Vadim Yanitskiy 6703d5289b trxcon: trx_data_rx_cb(): print strerror(errno) if read() fails
Change-Id: I78658a706e5bfda446e3929e33abcdee3f08845b
2022-11-25 14:34:55 +00:00
Vadim Yanitskiy 0f9d483984 trxcon: trx_data_rx_cb(): properly parse timeslot number
Remove the range check because it makes no sense anymore.

Change-Id: I1010cf39f61b8845acce632c19c74df892fc5acb
2022-11-25 14:34:55 +00:00
Vadim Yanitskiy edc12b2a5c fixup: firmware/layer1: introduce experimental PDCH support
This regression was introduced with the experimental PDCH support
back in 2020.  In particular, I made a mistake in the l1s_nb_resp()
resetting rxnb.dl->link_id to 0x00 if MF_F_PTCCH is not set, which
is of course not set for non-PDCH channels.

Change-Id: I8593f9b001e669e7cd10cc42c05221a6037e8ae1
Fixes: 67c49ba664
Fixes: OS#5791, OS#5133
2022-11-25 19:04:41 +07:00
Vadim Yanitskiy 7f1b99bc3b fixup: trxcon: make burst pointer in trxcon_phyif_burst_ind const
The for-loop was moved above the initialization of bi and kept using
bi.burst_len, which is indeed uninitialized.  Move it back.

Change-Id: I93a627233beef9157d47b35cafc42c53203619a7
Fixes: 178b92a108
Fixes: CID#300007
2022-11-24 10:57:18 +07:00
Vadim Yanitskiy 178b92a108 trxcon: make burst pointer in trxcon_phyif_burst_ind const
The trx_data_rx_cb() needs to be modified because it's accessing and
modifying the receive buffer via the bi.burst pointer, which
becomes const after this patch.

Change-Id: I68773d247725a6dc2cbbc58b63c0fd19ffdb1a16
Related: OS#5599
2022-11-23 06:26:51 +07:00
Vadim Yanitskiy c568b9cebe trxcon: group Rx burst params into struct l1sched_burst_ind
Change-Id: I3363c38a43d2f54f846527b70cedac8fa57bcb27
Related: OS#5599
2022-11-23 06:26:48 +07:00
Vadim Yanitskiy bd492d830d trxcon: adjust coding style in l1sched_pull_burst()
Change-Id: I96a40fdbea5085999b9aeb98b418ae27132f6fda
Related: OS#5599
2022-11-22 23:22:21 +00:00
Vadim Yanitskiy b387df26c4 trxcon: rework l1sched_trigger(), split l1sched_pull_burst()
The key idea is to allow triggering the scheduler only for a specific
timeslot of a frame, while keeping the API for triggering all together.

Split off the main part from l1sched_trigger() to l1sched_pull_burst().
While at it, rename l1sched_trigger() to l1sched_pull_send_frame().

Change-Id: Ibb7f9d7de26733f21b0753a2c655a250286bf1f0
Related: OS#5599
2022-11-22 23:22:21 +00:00
Vadim Yanitskiy bb2b1d7657 trxcon: rx_sch_fn(): do not use sched->fn_counter_proc
Use the given Fn instead, no need to go that deep for it.  The
sched->fn_counter_proc is an internal field of the scheduler,
which is not necessarily holding a valid value when pulling
Uplink bursts synchronously via the Ready-to-Send PHYIF API.

Change-Id: I56027876b50e53b474c2f54ac216cd141142020e
Related: OS#5599
2022-11-22 23:22:21 +00:00
Pau Espin e9f24d734a host/layer23: Add modem app
This app will allow setting up a tun device to transmit/receive data
as a GPRS MS against a GSM network.

This is just the initial skeleton so that people can work on it further
in follow-up commits.

Related: OS#5503
Change-Id: I8a1121b3287da7d7330c30e3118affa8fd1da61b
2022-11-21 19:56:54 +01:00
Pau Espin dd03ea6a82 layer23/mobile: Add missing dependency cflags
The *_LIBS vars were already added, but the *_CFLAGS were missing.

Change-Id: If904589b33357395e10f078857979aaecf5dbf68
2022-11-21 18:16:09 +00:00
Vadim Yanitskiy 855d83fc2d trxcon: separate l1sched_clck_handle() from BURST.ind handling
Do not mix up Downlink burst handling with the clock delivery.  Add
a separate PHYIF API function and call it from the TRXC/TRXD PHYIF.

This way calling trxcon_phyif_handle_burst_ind() would not trigger
the internal timer-driven Uplink scheduler in libl1sched, letting
the underlaying PHYIF logic to pull Uplink bursts synchronously.

Change-Id: Ieeee25573d1142aec2fee28d884127f14573b681
Related: OS#5599
2022-11-20 07:24:25 +07:00
Vadim Yanitskiy 1a0ad45a5d trxcon: drop unneeded imports in trxcon_main.c
Change-Id: I2868f83f55a6cbf3efc59f35ab7666671d22cf93
2022-11-18 05:29:49 +07:00
Vadim Yanitskiy ff0b5ed75a trxcon: use 'trxcon_phyif_' prefix for the PHYIF API
Change-Id: Icd2fc41cb3f42a791bf619c5f7b8fa4154371ba4
Related: OS#5599
2022-11-18 05:23:36 +07:00
Vadim Yanitskiy 269fe14045 trxcon: move l1sched/phyif shim API to libtrxcon.la
Change-Id: I56701b471a6f1c30ffd107037c2b1aed65621b2c
Related: OS#5599
2022-11-18 05:16:34 +07:00
Vadim Yanitskiy 54a2ee5cef trxcon: reorganize the core logic into libtrxcon.la
This is needed for the integration with osmo-trx-ms.  It was decided
to run the scheduler within the transceiver process, so that we can
reduce scheduling latency.  The idea is to maintain trxcon as a sub-
module in osmo-trx.git and link osmo-trx-ms against the libtrxcon.

We cannot use hard-coded logging categoris in a library, so add new
API for setting them: trxcon_set_log_cfg().  Use DLGLOBAL by default.

Change-Id: Idf207947f620a7394e0a0e5bf2c37bcd8df64bbe
Related: OS#5599
2022-11-18 04:59:50 +07:00
Vadim Yanitskiy 394793b1c1 trxcon: abstract L1CTL codec from the l1ctl_server API
The L1CTL codec (implemented in l1ctl.c) is going to be part of the
upcoming libtrxcon, so let's uncouple it from the l1ctl_server API.

Change-Id: I8d80af240b0e57f76263907c552288d4184876c0
Related: OS#5599
2022-11-12 22:15:58 +07:00
Vadim Yanitskiy 724502d0f4 trxcon: use L1CTL_HEADROOM in l1ctl_alloc_msg()
The l1ctl_client_read_cb() is using L1CTL_HEADROOM, so let's avoid
inconsistency and use L1CTL_HEADROOM in the l1ctl_alloc_msg() too.

Change-Id: I248f8c662ae0836cba61fb708a5dc73c57131f4c
Related: OS#5599
2022-11-12 22:11:49 +07:00
Vadim Yanitskiy 7d1a2247fa trxcon: move trxcon_inst_{alloc,free}() to a separate file
Both functions are going to be part of the upcoming libtrxcon.

Change-Id: I98963a1da927581597f7a170239dfb8a87cba842
Related: OS#5599
2022-11-12 22:09:55 +07:00
Vadim Yanitskiy a7f399eb95 trxcon: move l1sched_logging_init() from l1sched.h to logging.h
Change-Id: I43e21ca8a14445548e1d359bb6f8a3e36cb65bfa
Related: OS#5599
2022-11-12 02:29:31 +07:00
Vadim Yanitskiy 13046f172d trxcon: cosmetic: s/trx_log_init()/trxcon_logging_init()/
Change-Id: I65ab1e6d3a3bea65aeb13ab286e33795ba57f1f3
Related: OS#5599
2022-11-11 18:26:32 +07:00
Vadim Yanitskiy c3916785d8 trxcon: cosmetic: rename trxcon.c to trxcon_main.c
Change-Id: Idc5f4217dd31b5bdcb364600f7b97d1f60e1ab6f
Related: OS#5599
2022-11-11 13:45:11 +07:00