Commit Graph

24 Commits

Author SHA1 Message Date
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 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 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 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
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 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
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
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 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
Vadim Yanitskiy 7a6e1874cb copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH
Change-Id: I408cde7f2b4642500e5362052365c92856c02bef
2023-05-18 18:51:15 +07:00
Pau Espin c16126317d layer23: modem: grr: Log ignored CCCH ImmAss
There seems to be some bug when using virtphy where sometimes the
received T2 and/or T3 in the ImmASs is not matching what we sent.
This helps in showing the problem and not failing silently.

Change-Id: Iaecd2616733d84f35a825916fe888142800b426b
2023-05-04 12:03:49 +02:00
Pau Espin fbd2f733a7 layer23: modem: Delay GPRS attach at startup until modem is ready
Wait until SIM is ready, network system information ws obtained and
it announced the MS is able to use GPRS against it.

Change-Id: I5029d9e8a47b8544b3b803c4db6352269bac3c0e
2023-05-03 18:38:34 +02:00
Vadim Yanitskiy b29a26c620 modem: add test VTY command to send CHANNEL REQUEST
Do not call grr_tx_chan_req() unconditionally from grr_rx_bcch().
Add a special (hidden, expert mode) VTY command for that.

Change-Id: I049a8d7f58ae9703d06dff235973ba376702c873
Related: OS#5500
2023-03-16 13:46:53 +00:00
Vadim Yanitskiy 8240ef74fc modem: move GRR specific code into its own file
Change-Id: I25caa0bd01e3d090803512f5b13cad58439f44f8
Related: OS#5500
2023-03-14 15:06:26 +00:00