Commit Graph

19 Commits

Author SHA1 Message Date
Pau Espin 9cf485e45b rlcmac: Submit GMMRR-PAGE.ind upon rx of Paging Request Type 1/2
Change-Id: I64db4277b5c54870a258d63c554f470011bcc989
2023-05-25 16:46:05 +02:00
Pau Espin 7bbdcc4414 gmm: Provide rlcmac with IMSI & PTMSI information
This information will be needed once the GRR layer starts listening for
paging requests, which identify MS by either PTMSI or IMSI.

Change-Id: I3a0c4a57c3d624c3ebb40ae2cc0c96626ccc2c99
2023-05-25 16:07:26 +02:00
Pau Espin a03f36654b gmmrr: Add new LLC_TRANSMITTED.ind
This event doesn't show up as an explicit primitive in TS 24.007 GMMRR
SAP, but it is clearly needed to (re)arm the READY timer in GMM layer as
per TS 24.008 section 4.7.2.1.1:
"""
The READY timer is started:
- in the MS when the GMM entity receives an indication from lower layers that an LLC frame other than LLC
NULL frame has been transmitted on the radio interface;
"""

Change-Id: I9fd4047cfae4a12ad3be41860032eeda263d3276
2023-05-22 12:49:25 +02:00
Pau Espin 29b2abf47c gmm, rlcmac: Properly handle P-TMSI vs TLLI
Change-Id: I44c95b3bc973b9dfcc79daf6b529fd2826f574e8
2023-04-27 14:28:10 +02:00
Pau Espin 67a57b5272 Rename internal g_ctx -> g_{layer_name}_ctx
Otherwise if a test includes {layer_name}_private.h from several
libraries to use private APIs it will fail due to colliding g_ctx
pointers of different types.

Change-Id: Ib8a844551452b79bdb3a81968ffc1fd42ee1c5d9
2023-04-13 18:20:53 +02:00
Vadim Yanitskiy cce691d19e rlcmac: do not attempt to decode PTCCH/D blocks, discard them
PTCCH/D blocks use different encoding than PDTCH/D blocks, and passing
them to gprs_rlcmac_handle_gprs_dl_block() results in decoding errors:

  DRLCMAC NOTICE rlcmac.c:496 Failed decoding dl ctrl block:
  7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 2b 2b 2b 2b 2b 2b 2b

We don't implement PTCCH yet, so discard these blocks starting at
Fn=12 within the period of 104 frames (see 3GPP 45.002, table 6).

Change-Id: I555004987cf2daa995b9ea21c90ac699199c4e9a
2023-03-17 09:06:03 +07:00
Pau Espin bab234c2ea rlcmac: gprs_rlcmac_prim_call_down/up_cb(): Avoid propagating rc=1
rc=1 Only has meaning in call to rlcmac_down_cb().
gprs_rlcmac_prim_call_down_cb() called by internal rlcmac code
guarantess the prim is always freed, and hence returning 1 has not
meaning there.

Same applies for up direction.

Change-Id: Ibd9c44150e8dbec5fbaa98e14aa16703935dac71
2023-03-09 10:24:56 +01:00
Pau Espin 441fdec9d4 rlcmac: Log tx of primitive to lower layers
Change-Id: Ifc3a71c2177657f17020b5ad87c43598942edf76
2023-03-09 10:24:56 +01:00
Pau Espin 154ff41292 rlcmac: ul_tbf: Implement support for TBF Starting Time
While reworking tbf_ul_ass_fsm, avoid being in "ASSIGN" state while
waiting to send Pkt Ctrl Ack. The PCU is free to ask the TBF to transmit
data before receiving Pkt Ctrl Ack; the time where it can start
transmitting data is actually controlled by TBF Starting Time.

Change-Id: Id81f16743f2c464e01caf27ba2eb8c0fc715fe8a
2023-03-09 10:22:04 +01:00
Pau Espin ef3c599b98 rlcmac: Lower logging rx prim from lower layers
Let's set it as DEBUG, since that code path can be called quite a lot.

Change-Id: I0b13fa374003a7c48bc259a8c45227b86beca454
2023-03-09 10:19:21 +01:00
Pau Espin f41223d479 rlcmac: Ignore DATA.ind with len=0
Change-Id: I342c7999261832a5d981e5831e428d2cbd82729e
2023-03-09 10:19:18 +01:00
Pau Espin dfe49c5f44 rlcmac: Handle SI13 from L1CTL
Change-Id: Ifaddf0e6e5cad7ea25672804c83c254579874813
2023-02-20 12:31:25 +01:00
Pau Espin b1ec9a1973 rlcmac: Introduce DL TBF creation through PCH ImmAss
This patch only introduces the gprs_rlcmac_dl_tbf subclass and
allocates/frees it based on PCH ImmAss, and adds initial paths for
received blocks. It also provides a unit test to showcase the scenario.

Change-Id: I7f98e3456ef35d80becdad3481afeb771457b0ef
2023-02-20 12:31:25 +01:00
Pau Espin d80a7b1d2e rlcmac: Implement GMMRR-ASSIGN.req
Change-Id: I3178aa1af4a6c05c84253c6befcd4c786b8dd8e9
2023-02-13 10:51:12 +01:00
Pau Espin 0984044e1c rlcmac: Initial implementation of UL TBF assignment and scheduler
This patch is another step towards a working RLC/MAC implementation. It adds:
* An initial data model with MS (gprs_rlcmac_entity) and ul_tbf.
* A UL_TBF state FSM from initial to FLOW status
* A UL_TBF assignemnt FSM, covering both 1phase and 2phase assignments.
* Triggering of UL_TBF allocation and assignment FSM when new LLC data
  is pushed from upper layers.
* A scheduler generating some ctrl messages (PktResReq and UlDummyCtrlBlk)
  when indicated by the network.

This patch is pushed as a WIP state since it already contains a
considerable amount of code and lots of new files, which can be
used/extended at a later point, making parallel contribution easier.

Related: OS#5500
Change-Id: I420c57a9d0b63f9c2805a7c2ae8ce85532a48eef
2023-02-13 10:43:29 +01:00
Pau Espin eeac4ad43c rlcmac: Introduce lower primitive layer API
This primitive API allows the application to drive the RLCMAC layer
based on a lower L1CTL interface.

* RACH req are requested to the lower layers by the RLCMAC through the
  RACH.req primitive.
* Received ImmAss, SI are fed to the RLC/MAC layer through CCCH_DATA.ind
* The RLCMAC registers DL and UL TBFs in the lower part (firwmare,
  L1CTL):
** The lower part will trigger PDCH_RTS.ind in every TS in the
  "(dl_slotmask|ul_slotmask)" superset, with the received USF. This
  allows UL uplink to transmit blocks when requested by USF, or UL/DL TBF
  to answer polls from PCU at a specific N+X FN (RRBP). This also allows
  the RLCMAC layer to update its GSM clock and trigger internall
  timeouts.
** The lower part will trigger PDCH_DATA.ind in every TS in the
  dl_slotmask if either a CTRL block is received or a data block
  matching the configured dl_tfi is received.
** Upon receival of PDCH_DATA.ind, the RLCMAC layer updates its FN clock
  and submits PDCH_DATA.req based on USF.

This commit only adds the primitive set and API to submit/receive them,
but doesn't really implement them yet internally.

Related: OS#5500
Change-Id: I3d97425ec75059ceae983de869419230e8c4df01
2023-02-13 10:37:30 +01:00
Pau Espin 88c52f1af9 rlcmac: Fix prim memleak passing GRR-UNITDATA.req
Change-Id: I16d737e6691fd964026260f829230106abcc7ef1
2023-02-06 20:25:23 +01:00
Pau Espin 134840b003 rlcmac: Enqueue LLC PDUs based on RadioPriority and SAPI
llc_queue and codel code has been taken from osmo-pcu.git
6a5b1b1f3ef83f87a9df1d4511e22f59039e11ed and have been refactored to fit
in libosmo-gprs (removed llc_pdu structs, reworked struct types being
enqueued, etc.). Support for queues based on radio_prio has also been
added.

Related: OS#5500
Change-Id: Icdaa046fb6a71367f10beee16dcf9a5b7b61022e
2023-01-30 17:56:09 +01:00
Pau Espin 1b25684110 rlcmac: Introduce primitives for SAPs towards higher layers
The GRR primitives and types are kept 1-to-1 ABI compatible
to those at libosmo-gprs-llc so that they can be forwarded as pointers.
Still, we want to keep the types duplicated in order to avoid having to
depend one library on another, since the forwarding of one layer to the
other is done by the app and can use whatever it wishes on either side.

Related: OS#5500
Change-Id: I1870fa6a264612c5a669bfb832e6e8c0a892cb74
2023-01-25 23:37:09 +01:00