Commit Graph

364 Commits

Author SHA1 Message Date
Vadim Yanitskiy 40b0a9094e mobile: init TCH state earlier (on receipt of CC ALERTING)
During a Mobile Originating voice call, we would normally start
receiving traffic indications with ringback tone (or even some
melody) before the call gets CONNECTed.  So in order for the user
to be able to hear that, we need to init the voice call handler
earlier (on receipt of CC ALERTING message).

We should not be transmitting voice/data frames before the call
gets CONNECTed, so add 'rx_only' flag to the TCH state.  In
tch_send_msg() drop msgb if this flag is set.

Rx only mode makes no sense for data calls, so in tch_recv_cb() we
discard received DL frames and thus do not trigger sending UL frames.

Change-Id: Idd32c823639cc1f9999d77fcefe7e260e31a85ec
Related: OS#4396
2024-02-06 01:05:48 +07:00
Vadim Yanitskiy aab5d12bdd layer23/modem: handle and forward L1CTL UL BLOCK.cnf
Change-Id: I9255ac17529b5ac260f9a0f141f3af6b3b72a802
Depends: libosmo-gprs.git I145b9586f83ae0235b4648916bd44996e8dc57f0
2024-02-05 15:34:28 +00:00
Vadim Yanitskiy 2cb3b7adbb mobile: VTY: rework data type/rate configuration commands
Change-Id: I7393fce82613a57275033f5c47e16bbf708a3bfb
Related: OS#4396
2024-01-24 23:41:56 +07:00
Vadim Yanitskiy aae93c2163 mobile: VTY: make soft-UART parameters configurable
Change-Id: I48bb58aaf1101fbc0e58db3fb1100927e506ede2
Related: OS#4396
2024-01-24 23:41:56 +07:00
Vadim Yanitskiy 3c54d77b12 mobile: VTY: use 'enum gsm48_bcap_transp' from libosmogsm
Change-Id: Iebc0692f17a5a5d04e57d74a720db52775937bdd
Related: OS#4396
2024-01-24 23:41:56 +07:00
Vadim Yanitskiy f35414b75e mobile: add a separate logging category for CSD
Change-Id: If9db0759aeb4324ace9ae258c852787f37897d83
Related: OS#4396
2024-01-24 07:04:57 +07:00
Vadim Yanitskiy 4371181456 mobile: implement sending CSD data over UNIX socket
Change-Id: Id054af7b3d9d0a41715f7981deb420f6e09bf30c
Related: OS#4396
2024-01-20 07:36:15 +07:00
Vadim Yanitskiy caa0065824 mobile: integrate V.110 TA & soft-UART from libosmocore
Change-Id: I7ac9c0e5010730fa4d8bc7a7a3c7ff85e11731c0
Depends: libosmocore.git I6d2f8e250df31c233a2741163113dc07515409ae
Depends: libosmocore.git I5716bd6fd0201ee7a7a29e72f775972cd374082f
Depends: libosmocore.git I2ca95963fd5852ddb89bdd35b86b31489127fe84
Related: OS#4396
2024-01-20 06:08:06 +07:00
Vadim Yanitskiy 0829246a22 mobile: rename tch_send_voice_{msg,frame}() functions
These functions can also be used for sending data frames (CSD).

Change-Id: Ib55b4405847f2efb583f3a379ff4b6929d6d6c5b
Related: OS#4396
2024-01-18 03:54:15 +07:00
Vadim Yanitskiy 129d0ea802 mobile: init/deinit GAPK I/O based on CC transaction events
Change-Id: I28f87f6a6de673611aa02a24e8985aee23d4498b
Related: OS#4396
2024-01-18 03:51:35 +07:00
Vadim Yanitskiy a8c3e6eb0e mobile: store MNCC Bearer Capability in CC transaction
We will need to know the current Bearer Capability of a CC
transaction in the upcoming patches adding CSD support.

Change-Id: Ifc3ecf832a552c65444f49711ac836b6cd984715
Related: OS#4396
2024-01-17 22:52:41 +07:00
Vadim Yanitskiy c3a1f4a39b mobile: add generic signals for CC/SS/SM transactions
This allows driving logic in other modules based on transaction
related events, such as allocation, deallocation, or a state change.
These new signals will be used in the upcoming CSD implementation.

Change-Id: Idae5da24cb517878a26cc14b2ba6976e60f0b31b
Related: OS#4396
2024-01-17 22:52:41 +07:00
Vadim Yanitskiy 83e36c0caf layer23: drop unneeded forward declaration
Change-Id: I75bd08c1a88ad75d93a519422dfb7922c37a27a3
2024-01-16 01:37:02 +07:00
Andreas Eversberg 046ee64e3d mobile: Fix PCS ARFCN handling: PCS can only be ARFCN 512..810
While it is correct to use the band indicator from SI1 rest octets,
it may only be applied for ARFCN values in the range 512..810.

The function gsm_refer_pcs() is used to determine, if the cell (which
'talks' about ARFCNs) refers to them PCS or DCS channels. It returns
true, if it refers to PCS, but this only means that ARFCNs in the range
512..810 are PCS channels, not all ARFCNs.

The new function gsm_arfcn_refer_pcs() is used to add the PCS flag to an
ARFCN, if the given cell refers to PCS and the given ARFCN is in the PCS
range 512..810.

Change-Id: Id99c8534bf853f4f24f99364790c1ac1df6cc007
Related: OS#6078
2023-11-27 10:49:26 +01:00
Vadim Yanitskiy efe2c7b7bd mobile: rename voice.[ch] to tch.[ch]
Also take a chance to change the 'tch_' prefix for all functions.

Change-Id: I05e1ae777add73672db61565c77c68d8ab2b08f0
Related: OS#4396
2023-11-03 13:34:02 +07:00
Vadim Yanitskiy b6083dcd13 mobile: cosmetic: rename gsm48_rr_tx_{voice->traffic}()
Not only this function can be used to transmit a voice frame,
but also a data frame during a CSD call.

Change-Id: I920300ae477e3c3d7c413cd1a35f2bc385266960
Related: OS#4396
2023-11-03 13:34:02 +07:00
Vadim Yanitskiy 2170887399 mobile: add params and VTY commands for data calls
Change-Id: If52fa70cb202f0736a17fe8eb63d226186637f62
Related: OS#4396
2023-11-03 13:32:58 +07:00
Vadim Yanitskiy e80d302255 mobile: clarify TCH I/O {handler,format} naming
Before we add handling of TCH I/O for data calls, let's rename the
existing voice related symbols and struct fields to have 'voice'
in their names.

Change-Id: If6c799d11e225ad00ca5da5ae63dca20568a0ce0
Related: OS#4396
2023-11-03 13:23:06 +07:00
Vadim Yanitskiy 5bdebfaae3 mobile: rename 'audio' node to 'tch-voice' node
Change-Id: I2cab597c5de92ecb343cad7aaaa48035ca5f8365
Related: OS#4396
2023-11-02 15:15:45 +07:00
Vadim Yanitskiy e73a604de0 mobile: add support for Circuit Switched Data calls
This patch implements the signalling part for mobile originating
and mobile terminating CSD calls.  The user plane interface is
to be implemented in follow-up patches.

Change-Id: I1995fa0a7a68d9b980852b664d472d4633777ac6
Related: OS#4396
2023-11-02 14:41:23 +07:00
Vadim Yanitskiy 011308cbcc mobile: move 'struct gsm_call' from <mncc.h> to <mncc_ms.h>
The only file using this structure is mnccms.c.

Change-Id: Iaa43609849ac3c755d47258d3aca4bfe7a6b3a49
Related: OS#4396
2023-10-30 15:05:58 +07:00
Vadim Yanitskiy e1bcc5af88 mobile: cosmetic: use '#pragma once' in mncc.h
Change-Id: I2f350c5b67e57097b71b12ba42c90ce0941b8fea
2023-10-30 15:05:58 +07:00
Andreas Eversberg d7e611472a ASCI: Add option to join voice group/broadcast calls without valid SIM
This option must be enabled in the VTY and is disabled by default.

Calls can be joined when service is limited or normal. With that option
enabled, calls can be joined even with invalid SIM.

Talking is allowed when service is normal. With that option enabled,
talking is always allowed. It depends on the network, if it accepts the
talker.

Change-Id: I6ea851a8cb015ff685b985335968c6184beca816
Related: OS#5364
2023-10-27 09:12:26 +02:00
Vadim Yanitskiy b525577a5e mobile: mncc_call(): make *number argument const
Change-Id: I4558ce1313b8e9aadd73474a6514c136aa512de3
2023-10-16 14:14:28 +07:00
Andreas Eversberg 203014d744 Fix indices of ARFCNs for measurement report
The order of ARFCNs are described in TS 44.018 §10.5.2.20.

The function arfcn_from_freq_index() is re-used to get the ARFCNs in
correct order for the report.

Change-Id: I0674467eb5a38a341cf65f95a25aa5f7232df069
2023-10-05 16:25:00 +02:00
Andreas Eversberg c8fed7fba7 ASCI: Add VTY command to display group call neighbor cells
Related: OS#5782
Change-Id: Ie84221507bdf247c1563b829d6cf0adb53ce161f
2023-10-04 12:55:29 +02:00
Andreas Eversberg 61ea0ac0ab ASCI: Add decoding of SYSTEM INFORMATION TYPE 10 $(ASCI)$
Related: OS#5782
Change-Id: I81c7929f6d951d8eef7d08624f0b72830370c448
2023-10-04 12:55:26 +02:00
Andreas Eversberg 17f494189f ASCI: Add VTY commands to control voice group/broadcast calls
Related: OS#5364
Change-Id: Id32253b4e10b8df48e819d8a92bbcda332dd11e6
2023-10-02 19:37:18 +02:00
Andreas Eversberg 666ec1d761 ASCI: Add GCC/BCC layer to support voice group/broadcast calls
Related: OS#5364
Change-Id: I22eacd018f18c18ba83dbd3dd874cf029344674d
2023-10-02 19:37:13 +02:00
Andreas Eversberg 32399095be ASCI: Add protocol type to trans_find_by_callref() function
This is required, because different protocols may share the same
callref, but use different protocols. E.g. a voice group call can share
the same callref with a voice broadcast call, but these calls are
different transactions.

Related: OS#5364
Change-Id: Ifea3a81aae3b4ae897851f867b13fa987c8cbe11
2023-10-02 19:37:09 +02:00
Andreas Eversberg 1678f53f99 ASCI: Add group receive and transmit mode support to MM layer
Related: OS#5364
Change-Id: I05957182a57423ad947ab200b52f65fde859e110
2023-10-02 19:37:05 +02:00
Andreas Eversberg 17115c70b1 ASCI: Add group transmit mode support to RR layer
This allows the upper layer to estabish and release connection on the
uplink of a voice group call.

Related: OS#5364
Change-Id: I9b62eef5d877e5d9dcf349717efd2cce28862c58
2023-10-02 19:37:01 +02:00
Andreas Eversberg 253e5cd1eb ASCI: Add group receive mode support to RR layer
This allows reception of VGCS and VBS calls. A special sub-state is used
to differentiate between IDLE mode and group receive mode. Later it can
be used to differentiate between dedicated and group transmit mode.

Related: OS#5364
Change-Id: Ia7d806b354fb3be5729bff8ac9aa1c7ad7a8b539
2023-09-28 13:53:57 +02:00
Andreas Eversberg 91d862c251 ASCI: Add ASCI notification support to RR layer
The notifications are received on NCH, as well as on FACCH.

Related: OS#5364
Change-Id: I49df02cb4d99d9aab1ea3ca13beb2ea00ae4c9f4
2023-09-28 13:53:54 +02:00
Andreas Eversberg 2d9c447c3f ASCI: Add interface for group receive/transmit mode support to RR layer
This patch includes new messages and description. The are used to bring
RR layer into group receive mode and from there in group transmit mode
and back.

Related: OS#5364
Change-Id: I1abd56c63d15af1cff8bde7589a571cb5bb5506f
2023-09-28 10:42:58 +02:00
Andreas Eversberg 1dc887a78d ASCI: Add uplink free/busy event to MM events
Related: OS#5364
Change-Id: I3f8d97a0359ea9560d6d6bfd8238ddc6492c56e8
2023-09-28 10:42:56 +02:00
Andreas Eversberg c3467236a3 ASCI: Add channel notification event to MM events
This is required to notify MM layer about new and ceased group and
broadcast calls.

Related: OS#5364
Change-Id: Ifee286ba4628356cc19b5dc75f1843287c5d2342
2023-09-28 10:42:53 +02:00
Andreas Eversberg bb32882adc ASCI: Increase channel request history to 5 entries
3 entries are enough for random access on CCCH. 5 are required for
uplink request on VGCS channel.

The history is used to remember when the random access bursts were send.
The RR layer can check if the IMMEDIATE ASSIGNMENT or VGCS UPLINK GRANT
message has matching frame number and random value of up to 5 random
access bursts previously sent.

Related: OS#5364
Change-Id: I62f18685bf05663f3ee6e94f6884ffb9a6b07ea4
2023-09-28 10:42:47 +02:00
Andreas Eversberg dd60a527be Refactoring encoding of mobile identity at mobile application
Deprecated functions gsm48_generate_mid_from_*() are replaced by
osmo_mobile_identity_encode_msgb(). Clean up code.

Change-Id: I9ff429bd50d718530fdad64a276053a35c8928f2
2023-09-28 10:42:43 +02:00
Andreas Eversberg 32423ccf5d ASCI: Add support flags to mobile (and VTY) for VGCS/VBS
These support flags can be enabled or disabled and are sent in the
class mark IE. Also they allow or disallow making VGCS/VBS calls.

Related: OS#5364
Change-Id: Ia23eb190e533660cce4ba4c856a83b5f3d534202
2023-09-28 10:42:42 +02:00
Andreas Eversberg 23d46f003f ASCI: Add UIC support to random access burst
A different identity code can be used on uplink access bursts on voice
group channel. This is optional for the network, but mandatory for the
MS side. If the network does not define a UIC, the BSIC is used instead.
BSIC is used for RACH channel and handover.

Related: OS#5364
Change-Id: I4039734676949aefa5be4b5298764b8ba7e1b8ed
2023-09-28 10:42:38 +02:00
Andreas Eversberg e513911668 ASCI: Add two logging categories for group and broadcast call control
Related: OS#5364
Change-Id: I77f634c7098137a5412ea56ddc0e794e629d1982
2023-09-27 14:02:41 +00:00
Andreas Eversberg 28d9a4880c ASCI: Add a flag to turn transmitter off or on
This flag can be used to turn transmitter off for "group receive mode"
or for handover procedure. The flag is stored in the channel description
of the mobile application. It is sent to layer 1 when switching to
dedicated channel or when changing TCH mode.

At the layer 1 the transmitter is turned off while the receiver is still
active. This is done by:

 * scheduling a TX dummy task for TCH bursts
 * scheduling no TX task for SACCH bursts
 * not enabling the transmit window

Related: OS#5364
Change-Id: I20133523adc3b204cd2181bfe664fe66020a10e3
2023-09-27 14:02:41 +00:00
Andreas Eversberg b7663882c0 ASCI: MM connections are defined by 'ref' and 'protocol' tuple
VGCS and VBS calls may share the same (call) ref or share with other
protocols. Therefore the MM connection is defined by the reference and
the prococol discriminator.

Related: OS#5364
Change-Id: Ic280cd8c666660077bb2c2ef641f4cddd3b36eee
2023-09-27 14:02:41 +00:00
Andreas Eversberg 975351e250 ASCI: Add GCC/BCC (call control) to mobility management
GCC is the call control for voice group calls, BCC is the call control
for voice broadcast calls.

This patch includes the new message primitives between MM layer and the
GCC/BCC layers.

Related: OS#5364
Change-Id: If6f3cea4b2ca839559596a6ee5a3d169c6d85dbe
2023-09-27 14:02:41 +00:00
Vadim Yanitskiy 9978b00ea0 modem: grr: implement RACH.req retransmission
Sometimes sending one Access Burst is not enough, so we need to repeat
sending it a few more more times changing the 3 LSBs randomly.  This
is what we already do in the mobile app, but not in the modem app.

* Rename GRR_EV_RACH_{REQ,CNF} to GRR_EV_CHAN_ACCESS_{REQ,CNF}.
* Rename VTY command 'grr tx-chan-req' to 'grr start-chan-access'.
* Add an intermediate state GRR_ST_PACKET_ACCESS.
** The GRR_EV_CHAN_ACCESS_REQ transitions to this state.
** One RACH.req gets transmitted when entering this state.
** The GRR_EV_CHAN_ACCESS_CNF confirms transmission of a RACH.req.
** Upon the timeout (300 ms) expiry, a loop state transition happens.
** After 3 loop-transitions, transition to GRR_ST_PACKET_NOT_READY.

Change-Id: Iab6d9147f6e0aeb99239affacf318a3897fd6ffe
Related: libosmo-gprs.git If0de3ed86b1e2897d70183f3b0f4fbfd7d2bda80
Related: OS#5500, OS#6131
2023-09-23 03:22:12 +07:00
Pau Espin fa833e4095 l1gprs/l1ctl: Decouple RTS.ind from DL_BLOCK.ind
Before this patch, the RTS:ind was crafted up in the stack when
receiving the DL_BLOCK.ind. This created some problems since the
internal low level state has to be updated in between signalling
DL_BLOCK.ind and RTS.ind, as there's a fn-advnace of one block between
those 2 signals (hence the timeslot allocation has to be applied at the
time when the fn-advance is applied).
This is actually not fixing the whole issue, since there's several
timeslots and hence the following events will have the internal timeslot updated
during the event in the middle, hence potentially causing problems in the
remaining TS:
DL_BLOCK.ind(FN=N, TS=1),  RTS.ind(FN=N+4, TS=1), DL_BLOCK.ind(FN=N, TS=2)

In any case, this decoupling already improves the situation and is step
needed anyway towards fully fixing the problem (by, for instance,
maintaining a timeslot state duplicated both for DL and Ul directions,
since they drive based on differnet FN time (1 PDCH block).

Change-Id: I1494e0aac7555f6e01b4b435b77140afc42c098e
2023-09-04 22:34:08 +00:00
Vadim Yanitskiy 8b4640ec19 l1ctl_proto: add 'start_fn' field to UL/DL TBF CFG.req messages
Change-Id: Ibb6a05165fe1c81268fb0e3674adae4065e78171
Related: OS#5500
2023-08-10 15:16:49 +02:00
Pau Espin 33dd069aa8 layer23: modem: Validate IP version of UL data packets from tun match PDP context setup
Change-Id: I3fe56fcbdbb6be3366829a14a433b735f7f9d43c
2023-07-27 21:25:32 +00:00
Pau Espin 345d03a6f6 layer23: modem: Delay using cell until fully synced to it
Change-Id: If306d82879281bb540c5cdee2eaf354858c8d24b
2023-07-24 14:00:47 +02:00