Commit Graph

1032 Commits

Author SHA1 Message Date
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 1c4a77adbf mobile: gsm_settings_init(): set TCH frame format explicitly
Change-Id: I4660b07977b6701ad5dc4bf25f12cba374101f8b
Related: OS#4396
2023-11-03 13:25:55 +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
Vadim Yanitskiy df8801bed6 layer23: rework L1CTL TRAFFIC.{ind,req} related logging
Make these Rx/Tx messages more informative.

Change-Id: I9c73db3c3650547030b8c354016e65195daebb62
Related: OS#4396
2023-10-30 15:05:58 +07:00
Andreas Eversberg 9d765a66fc ASCI: Correctly set and store 'uplink-release-local' flag
Also this option is enabled by default and show in the VTY if it is
disabled.

Change-Id: I6af44f0dd7ff842de633587fb0dcbe78126d30e1
Related: OS#5364
2023-10-27 09:12:28 +02: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
Andreas Eversberg bfebc81384 ASCI: Use correct mobile identiy in TALKER INDICATION message
Use TMSI only if valid in the current location area. If the MS moves to
a different location area and joins a group call before location update,
TMSI is not valid. Then use IMSI instead. If no IMSI/TSMI is available,
send mobile identity without IMSI/TMSI.

Change-Id: I299604a0e12d91e9133b70757826ac9637da0e3e
Related: OS#5364
2023-10-27 09:12:22 +02:00
Andreas Eversberg 8c190e6f92 ASCI: Handle rejection of voice group/broadcast call correctly
If joining a call gets rejected, the call must not be released, instead
it must return to U3 state (incoming call), because the call still
exists in the cell and it might possible to join it later.

If a call notification is gone, a new event is used in the state machine
to release incoming call.

Change-Id: I605387c6be409ef0e67caf7b9e2a83e1032b45f1
Related: OS#5364
2023-10-27 09:12:16 +02:00
Vadim Yanitskiy 1c7c713760 mobile: vty: rework support enable/disable commands
Change-Id: Ibfef31f6dd7694dad535ad07fdf47bd32571b7b2
Related: OS#4396
2023-10-18 20:46:35 +07:00
Vadim Yanitskiy 40609ca94b mobile: improve handling of Bearer Capability IE for MT calls
This patch prepares for adding MT data call support:

* Move handling of the Bearer Capability IE into a function.
* Check transfer mode and coding standard in the received BCap.

Change-Id: I3a5cac8c35ba6b7bdc5fcb077690b32848747756
Related: OS#4396
2023-10-18 20:46:35 +07:00
Vadim Yanitskiy 292f39900c mobile: fix mncc_get_bearer(): return -1 straightaway
Even though the function works as expected and *can* return -1,
which is first casted to unsigned and then back to signed, let's
make the code less confusing by returning -1 straightaway.

Change-Id: I3206fcfa9ab4cac85a1f0f2a4de3250b25f9058f
Related: OS#4396
2023-10-18 20:46:35 +07:00
Vadim Yanitskiy 9130b2d8f5 mobile: cosmetic: improve mncc_{get,set}_bearer()
Change-Id: I5647bdf58cbf58065dbe8eebe16f330d98fd0d22
Related: OS#4396
2023-10-18 20:46:35 +07:00
Vadim Yanitskiy 7a413ffb26 mobile: mnccms: use constants from libosmogsm (gsm_04_08.h)
Change-Id: I5ce59db39ad865620aaed2d778bc3710cf37bc3b
Related: OS#4396
2023-10-18 20:46:35 +07:00
Andreas Eversberg 162398a0d9 ASCI: Register state machines only once, when the application starts
Related: OS#5364
Change-Id: I46d68e31e0bfd6a64c190e439f45b24502dd1f30
2023-10-18 08:08:25 +02:00
Andreas Eversberg 014646fc66 ASCI: Change state correctly when leaving group mode
Use new_mm_state() to leave group mode. This will trigger IMSI detach
when returning to IDLE mode, if it has been delayed.

Related: OS#5364
Change-Id: I3c83c9e0fe10b35d60d125df6929fcb5ddc35f1a
2023-10-18 08:08:24 +02:00
Andreas Eversberg 86fed8fc97 ASCI: Select correct state when returning to idle or group receive mode
This fixes I05957182a57423ad947ab200b52f65fde859e110.

Related: OS#5364 and OS#6214
Change-Id: I626195161b987f1ba0065134afcf3936c9c090eb
2023-10-18 08:08:18 +02:00
Andreas Eversberg e45abc96ec ASCI: Ignore cell selection event during group receive mode
Cell selection is not supported during group receive mode. If it
happens anyway, give an error message and select correct sub-state.

This fixes I05957182a57423ad947ab200b52f65fde859e110.

Related: OS#5364 and OS#6214
Change-Id: Iea6fe623956003130000c59ec0e1b24b3177052d
2023-10-18 08:08:14 +02:00
Andreas Eversberg 2c0f71ac43 ASCI: Join a group/bcast call in correct MM states only
These states are:
	GSM48_MM_SST_NORMAL_SERVICE
	GSM48_MM_SST_ATTEMPT_UPDATE
	GSM48_MM_SST_LIMITED_SERVICE
	GSM48_MM_SST_LOC_UPD_NEEDED
	GSM48_MM_SST_PLMN_SEARCH  (limited service)
	GSM48_MM_SST_PLMN_SEARCH_NORMAL

If the service is limited, group/bcast calls can be joined, but uplink
access is not allowed.

Related: OS#5364
Change-Id: I2f8ff65f6e101972f9b1760013983d00ae6e7760
2023-10-18 08:08:10 +02:00
Vadim Yanitskiy 026f113280 mobile: clean up call related VTY commands
Change-Id: I8bccdf776ad541932ad4a6d6a68426a6ab856e08
Related: OS#4396
2023-10-16 14:14:28 +07:00
Vadim Yanitskiy 8f1091ee4b mobile: separate 'call MS_NAME NUMBER' command
This will allow us adding an optional switch for data calls.

Change-Id: I5d2332df09a81cb0747ecd9d95351ab59f99358e
Related: OS#4396
2023-10-16 14:14:28 +07:00
Vadim Yanitskiy b525577a5e mobile: mncc_call(): make *number argument const
Change-Id: I4558ce1313b8e9aadd73474a6514c136aa512de3
2023-10-16 14:14:28 +07:00
Vadim Yanitskiy 8d18e106a9 mobile: mncc_recv_internal(): make struct gsm_mncc ptr const
Change-Id: I0a5522b7df112bfaefc684c872a618c1e9118e61
2023-10-16 14:14:25 +07:00
Vadim Yanitskiy ed9e949dd9 mobile: fix AUDIO_IOH_LOOPBACK mode: pull DL info header
The loopback mode is currently broken because the DL info header
remains present, thus becoming a bogus "part" of the speech frame.

Change-Id: I1af187b4bc5f5a99bc7f7634d90bf14ad3db0e49
Related: OS#4396
2023-10-16 14:10:21 +07:00
Vadim Yanitskiy de630abfc8 layer23: send UL/DL GPRS blocks over GSMTAP
Note that despite the VTY interface offers various channel type
filtering facilities, the actual filtering is not implemented.

This patch simply brings PS domain in consistency with CS domain:
the UL and DL GPRS blocks are now being sent over GSMTAP without
any filtering, just like GSM MAC blocks.

Change-Id: I338205bee44fe182233efc5619a3d528cd07d932
Related: OS#5500, OS#6209
2023-10-13 18:09:04 +07:00
Andreas Eversberg bcc047e5e1 Provide create_conn_and_push_mm_hdr() with correct SAPI
Change-Id: I454178f45aed49417f8cd7744155be66b9ac509f
Fixes: 00507bdc "Cleaning gsm48_mm_data_ind()"
Related: OS#6216
2023-10-10 19:31:26 +07:00
Andreas Eversberg 6708699b22 Correctly detect the follow-on proceed information element
Even if follow-on proceed is not supported, the warning message about
not beeing supported should only show when the follow-on proceed
information element is included in the location update accept messages.

Change-Id: I2b1aceb8b85bdd9faabe354501f9036f1fc6fe33
2023-10-09 23:39:01 +02: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 beed281a0a Fix selection of correct ARFCN at arfcn_from_freq_index()
The selection of ARFCN is described in TS 44.018 §10.5.2.20.

The frequencies found in SI5 and SI5bis are counted first, in the
following order: ARFCN 1..1023,0.

The frequencies found in SI5ter are counted afterwards, in the following
order: ARFCN 1..1023,0.

Related: OS#5782
Change-Id: I090d84a5550d89743e8f5a886f400df6483f50d7
2023-10-05 16:24:57 +02:00
Andreas Eversberg 22e79a87fa ASCI: Fix false return value checks, discovered by Coverity Scan
See: CID 32637 - 323644

Related: OS#5364
Change-Id: If72590bb94597e434386bbcd312919a71abf0aae
2023-10-05 13:41:42 +00:00
Vadim Yanitskiy a397330e10 modem: grr_fsm: permit loop transition for GRR_ST_PACKET_ACCESS
I forgot to permit the loop state transmission, so the modem app
gets stuck in GRR_ST_PACKET_ACCESS is no IMM ASS is received...

Change-Id: I059d2929f7f724cfe26935bf35c167e60157451f
Fixes: 9978b00e "modem: grr: implement RACH.req retransmission"
2023-10-05 20:16:32 +07:00
Andreas Eversberg 0cee735aca Fix settings for VGCS/VBS
The "support" flags must be copied to the settings, because they are
enabled by default and may be omitted in the VTY config.

Related: OS#5364
Change-Id: I81575dd3f2ade70101df32935a1c3d5469327577
2023-10-04 12:55:30 +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 1cc4c0f487 Fix potential NULL pointer dereferences, discovered by Coverity Scan
See: CID 323362 + CID 323363
Change-Id: I47aa506014d8bddb8c8ce9b506c1c5c7b8056d30
2023-10-04 12:55:03 +02:00
Andreas Eversberg d6b2a4d685 Correctly use SUP_WRITE() macro for GSM 850
Change-Id: I52c99c63e38934fb26c26dba5bf2551ea311228b
2023-10-02 19:37:30 +02:00
Andreas Eversberg 3fb118bd91 Fix typo in sysinfo.c
Change-Id: I12405bef9f7910a354d9ac5153f4adc55095d747
2023-10-02 19:37:28 +02:00
Andreas Eversberg a67c8b32fb Correctly extract bits from SI2*/SI5*
These bits are:
 * EXT-IND
 * BA-IND
 * Multiband reporting

Change-Id: Ie5349464fed0a4276955235c7c87b5bcb299f20d
2023-10-02 19:37:25 +02:00
Andreas Eversberg 00507bdc13 Cleaning gsm48_mm_data_ind()
Get rid of goto and double switch/case by putting connection handling
code into a separate function.

Change-Id: I12454cab06c105ccd9e2495e3a6f0640f2884885
2023-10-02 19:37:24 +02:00
Andreas Eversberg 06b4885b18 ASCI: Show NCH position in VTY together with system information
Related: OS#5364
Change-Id: I5e0a9d469eb70608502dca881808621fa153b666
2023-10-02 19:37:20 +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 e676cf83ee ASCI: Prepare gsm48_rr_rx_acch for voice group channel
The gsm48_rr_rx_acch function receives FACCH/SACCH. This is not only
used for system information on SACCH, but also for short header messages
and regular UI messages on TCH.

Related: OS#5364
Change-Id: I39b27396a31137b3c4bdcb40dccdf3de60458fe2
2023-09-28 13:53:53 +02:00
Andreas Eversberg d575e5bf6e Add header length check to received CCCH messages
Change-Id: I3bc6b0b997e6ea1048c3357d276adfcc1638b02b
2023-09-28 13:53:52 +02:00
Andreas Eversberg 615a88f69b Fix reception of MM messages at gsm48_mm_data_ind()
The patch "ASCI: Add GCC/BCC (call control) to mobility management"
breaks reception of MM messages. No MM connection setup is possible.

This patch fixes the issue.

Change-Id: I263739bb0220d19f14114714fe9d82505bdbd267
2023-09-28 13:53:49 +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 699a3a3978 Fix unset sapi in gsm48_rr_data_ind()
The gsm48_rr_hdr is pushed into the message before sending data to
MM layer. SAPI was not set in this header.

Change-Id: I8345a562050d52d491f3b7192c979d455a63931c
2023-09-28 10:42:51 +02:00
Andreas Eversberg c9f90c4d5a Fix request reference value in gsm48_match_ra()
Do not overwrite the given request reference pointer with the history
buffer's reference. This makes no sense.

Without this fix only the response to the first access burst could be
matched correctly.

Change-Id: Iec636d368e20030beac2861bff61b1a06e7b4821
2023-09-28 10:42:48 +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 245b4b9238 ASCI: Get timing advance and TX power only when included
Instead of assuming that there are TX power and timing advance IEs
included in RSL message, check for existence.

gsm48_rr_rx_acch() may receive frames from FACCH that do not have these
IEs included in the message. These frames are UI frames on DCCH and Bter
frames. E.g. these frames are used on voice group channel to control
uplink.

Related: OS#5364
Change-Id: I87fcd44bba221ab4c5fbd2c79557db2444a10b88
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 3f36843b90 modem: fix grr_st_packet_access_action(): shift rr->cr_hist properly
Pass size in bytes to memcpy(), not number of elements!

Change-Id: I687435f5458e766d9d61143d6e4255f089fe1caf
Fixes: 6db5f8b9c "modem: get rid of app_data.chan_req, use ms->rrlayer"
Related: OS#5500, OS#6131
2023-09-26 21:22:57 +07: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
Vadim Yanitskiy 57b0908a71 modem: grr: clarify a comment in forward_to_rlcmac()
Change-Id: I11286777c70c776c9f6990be988401ebd5b84f0f
2023-09-23 01:52:08 +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 d130d9d7b1 layer23: modem: pass TBF starting time from CFG UL/DL TBF Req
Change-Id: Iae53c6e704a5b868a265216d4cb48b1edc2d7e61
Depends: libosmo-gprs.git I27a7a896fe3839fa4f9b8cd9500c4ab7867bbaa0
Related: OS#5500
2023-08-24 15:47:54 +02:00
Pau Espin 13b1946fa7 layer23: modem: Pass fn from lapdm to L1CTL-CCCH_DATA.ind
Change-Id: I7a9f31ae363fe7de019ff1a906f3978ff3074036
2023-08-24 15:47:51 +02: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 8bbd0d173f l1ctl: Fix fill ph_data_param fn field
This commit fixes recent previous commit filling in the fn field. The
dl->frame_nr is network order, and we want to pass a host order integer
in the primitive. Use the tm.fn which already includes the proper value
calculated from dl->frame_nr.

Fixes: d524c17d90
Related: OS#3626
Change-Id: Id96015c8b419932abb8095c6cb85aceef34e366f
2023-08-10 14:28:06 +02:00
Pau Espin d524c17d90 l1ctl: Fill ph_data_param fn field
Related: OS#3626
Change-Id: I3317296b2bda1088a2af81ba9b135714f8393afd
2023-08-09 16:38:06 +02:00
Andreas Eversberg 845ad38328 Fix VTY command to set IMEISV.
The pointer and size must given for the SV portion of the character
array only.

Fixes: CID#314049, CID#314048
Change-Id: Ieff4ca886dec71aae1b6ecf2b623d600426580da
2023-08-08 04:30:33 +00:00
Pau Espin 171ba46382 layer23: modem: gmm: Adapt log string about no TLLI found
During initial GMM Attach, the GMM layer generates an internal
local TLLI and uses it to do the GMM Attach. Only at the time it
receives the GMM Attach Accept with the assigned TLLI from the network
then explicitly informs other layers about the TLLI update.
Hence, the GMMREG user doesn't really know about the TLLI in use until
the GMM Attach success happens (gmmreg-attach.cnf).
During that time, the TLLI at the app is basically unassigned
(0xffffffff). Hence, during that same time a TLLI update hook in
GMMRR-Assign.req will not work since the app is unaware of the remporary
local TLLI, so no match can be done.
In that specific scenario, that's fine, since anyway it is waiting to
receive the GMMREG-Attach.cnf, which will indicate the assigned TLLI to
it.
In summary, not being able to match the TLLI in GMMRR-Assign.req is not
bad per se, so soften the log error there.

Change-Id: I31c04288789393391084000fbdbcdcedb11d0b68
2023-07-31 18:12:57 +02:00
Pau Espin e2fd48e7d7 layer23: modem: gmm: Log allocated TLLI on Attach Success
Change-Id: I29242873ebec173c430e6d413e6c533ec1e2b97a
2023-07-31 18:03:19 +02:00
Pau Espin c8b951e276 layer23: modem: Fix newline character typo in log line
Change-Id: I3ff9b71ff469e339aadff643b582efb06d5efb6c
2023-07-31 17:46:15 +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 89ef574fe2 layer23: modem: Avoid direct transition ST_PACKET_TRANSFER->ST_PACKET_IDLE
Right now the existing code is switching to state IDLE and hence running
grr_st_packet_idle_onenter() which attempts stuff like starting an attach.
This is all done while the L1CTL RESET + FBSB is still in progress. We
should instead wait to receive confirmation from those.
As an easy implementation for now, simply switch to the
GRR_ST_PACKET_NOT_READY state, which will move to GRR_ST_PACKET_IDLE
once it starts receiving CCCH blocks (aka it will already have gone
through L1CTL RESET + FBSB completely).

Change-Id: Ie797b36701d10c6052500c637a08b061bb1e4bd7
2023-07-24 14:00:47 +02: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
Pau Espin 0a6ad6bbf8 layer23: modem: Submit L1CTL-CCCH_READY.ind
Signal RLC/MAC layer that the lower layers is in packet idle mode ready
to use CCCH (such as packet-access-procedure).

Change-Id: I05050e840a3b267b3b3a278588ee113b45bfbd4c
2023-07-24 14:00:47 +02:00
Vadim Yanitskiy 5462ad040c modem: handle OSMO_GPRS_RLCMAC_L1CTL_PDCH_{ESTABLISH,RELEASE}
Change-Id: Ic39ce696834943dc661c85cbf3d54ccd598b60ce
Depends: libosmo-gprs.git I2568c58646ce7511367275ac96cd55e7fdd7ec18
2023-07-24 14:00:47 +02:00
Vadim Yanitskiy 3f0f1a4214 layer23: modem: implement GPRS-RR FSM
Change-Id: I8a7d85df7b07d85ac86e0b7e340f6bbacc65e1bc
2023-07-24 14:00:41 +02:00
Pau Espin 19450eb435 layer23: modem: gmm: Update own TLLI copy though GMMRR-Assign.req hook
This is needed in order to provide updated TLLI when submitting new user
data from the tundev to the SNDCP layer.

Change-Id: I5c6a2c371ae6d65bf4fe23e665ec939da37112be
2023-07-20 12:36:21 +02:00
Pau Espin 3a031345e1 layer23: modem: llc: Forward LL-Assign.req to SNDCP
Depends: libosmo-gprs.git Change-Id I924dcf3ac9cbb15e26a5e9376f89ca098ab49e0b
Change-Id: I0b0f025a0cd356c997fc4620f2d6be4792fc1d29
2023-07-20 12:09:37 +02:00
Pau Espin 7e262322d1 layer23: modem: gmm: Forward GMMSM-Modify.ind to SM layer
Depends: libosmo-gprs.git Change-Id Ic765b7a565cac4abcf34d8c6868e103971d17822
Change-Id: I3cd90ad85fb77b09c3300e87e454c4fe641edc88
2023-07-20 12:09:29 +02:00
Vadim Yanitskiy 60215bc051 modem: properly handle Dedicated mode or TBF IE
We need to distinguish between Uplink and Downlink TBF assignment in
grr_rx_imm_ass(), because matching the Request Reference IE makes
sense only for the Uplink TBF assignment.

Uplink TBFs are requested by the UEs by sending RACH, while Downlink
TBFs are assigned by the network itself.  The Request Reference IE
is only valid for Uplink assignments and shall be ignored in messages
assigning Downlink TBFs.

Change-Id: Idb9b3203147be3b42256c0bcab3ecdabcf2d2fa9
Related: OS#5500
2023-07-04 01:43:33 +07:00
Vadim Yanitskiy 9f61426a15 layer23: use gsm0502_fn2ccch_block() from libosmogsm
Change-Id: I652a2ab9ddb3cb5082cce911a5cdb4cf8abcf552
Depends: libosmocore.git I8cbd31226754e95887358ed83a928e2f567f4cf3
2023-06-23 00:01:24 +07:00
Vadim Yanitskiy bc04784b14 layer23: cosmetic: move <lapdm.h> to other libosmo* imports
Change-Id: Id4d8df3f230729dc2c65e1bedea705e28feaa029
2023-06-22 23:32:35 +07:00
Vadim Yanitskiy 3211489649 modem: cosmetic: fix formatting in modem_gmm_prim_up_cb()
Change-Id: I1498b92f2dc3d056ca69072dfb077cba65b86b6e
2023-06-17 01:40:39 +07:00
Vadim Yanitskiy 749f0a461c layer23: fix handling of logging category mask (-d option)
In change 67943df4 I broke handling of the logging category mask in
the mobile app.  Adding this option results in a segfault:

  ERROR: osmo_log_info == NULL! You must call log_init() before
         using logging in log_parse_category_mask()!
  Assert failed osmo_log_info src/libosmocore/src/core/logging.c:329

As can be seen, the problem is that we are calling
log_parse_category_mask() before initializing the logging.

As possible solution, I could rearrange the code to parse command
line options after calling osmo_init_logging2().  This would fix
the segfault, but would not fully solve the problem.

If we call log_parse_category_mask() before parsing the config file,
then logging configuration in the config file overwrites the logging
configuration specified via the command line.  But we want the
opposite: the command line setting should overwrite the config file
parameters.  This is handy because there is no need to edit the
config file if you quickly need to test something.

So let's call log_parse_category_mask() after parsing the config file.

Change-Id: I1b2b7804bf99b71f96e9197f7824cfd20431e8a1
Fixes: 67943df4 "layer23: fix parsing of command line options"
2023-06-16 06:51:59 +07:00
Harald Welte df900478de layer23: Update to libosmocore osmo_auth_gen_vec2
libosmogsm has recently deprecated the use of osmo_auth_gen_vec
and the osmo_sub_auth_data structure in favor of newer versions
of this API. Let's migrate to it

Change-Id: I1d9751c5f74a59e7310d07d54a3fdbac213324bd
Depends: libosmocore.git Ie775fedba4a3fa12314c0f7c8a369662ef6a40df
2023-06-15 09:23:45 +00:00
Vadim Yanitskiy 96fec1646d mobile: fix -Wlogical-not-parentheses in gsm48_cc_init()
Found by clang:

  gsm48_cc.c:54:6: warning: logical not is only applied to the left
                   hand side of this comparison [-Wlogical-not-parentheses]
        if (!cc->mncc_upqueue.next == 0)
            ^                      ~~

Change-Id: Ic7ffd3aa25339e24a31bae1b7428f1f93e261858
2023-06-14 20:53:41 +07:00
Vadim Yanitskiy b1e3742a94 modem: do not send RTS.ind if we got PTCCH/D
Change-Id: Idcdf56de7fc6279d8b942f3670ecdc6f88c3dfd1
Related: OS#5500
2023-06-07 15:56:45 +00:00
Pau Espin dae9add949 layer23: modem: Add helper function to get FN from gsm48_req_ref
Change-Id: I1265a580f55473f52e77af6c5f53c1573f8f3e70
2023-06-06 15:57:01 +02:00
Pau Espin 81b3237c88 layer23: modem: Forward LLC-TRANSMITTED.ind RLCMAC->GMM
Change-Id: Ife91ad87fed78daf86e9f28ceed981d61799758e
2023-06-06 15:56:18 +02:00
Pau Espin d400126d0f layer23: modem: Forward Paging Request Type 1/2 to rlcmac layer
The RLCMAC layer in libosmo-gprs-rlcmac will decode the messages and if
matching the MS, forward it to GMM, who will see if it requires initiating
a packet access procedure.

Change-Id: Iee4b5ee5e1e5874b550dd8536b095bf0b5eeb8f4
2023-05-30 16:31:09 +00:00