This in turn delays reconfiguring the lower layers (L1CTL-CFG_UL_TBF.req
mask=0x0) until the last block has been transmited.
Change-Id: Ic38b4207623ccbda3b77d4b0a47431c25de95034
The poll is part of the FSM mechanism to get events to transit over the
different states. Register it from within the FSM to have more fine
grained control as well as have knowledge about the FN being reserved.
This knowledge will be used ina follow up patch for the UL TBF to wait
for the correct PKT CTRL ACK BLOCk.conf.
Change-Id: Iaa8ad8052b9f3b52b05af2b7fc9cb8172f1b6bb7
The different paths will be updated as required as needed in the future.
Until now it was difficult while still valuable to have access to
current FN+TS, even if only for logging.
Follow up patch will use this info to be able to calculate poll FN from
RRBP more deep in the stack (ul_tbf_fsm).
Change-Id: Ifa09cd70c915aa3a2b799412cb02315aaebc0503
The RA value does change during RACH retransmissions, so we cannot
expect a specific value in gprs_rlcmac_handle_ccch_imm_ass_ul_tbf()
anymore. Offload checking it to the lower layers.
* Rename submit_rach_req() to submit_packet_access_req().
* Get rid of gen_chan_req(), indicate only the access cause.
Ideally, we should also rename the OSMO_GPRS_RLCMAC_L1CTL_RACH
to something like OSMO_GPRS_RLCMAC_L1CTL_PKT_CHAN_ACCESS, but
let's better do this separately.
Change-Id: If0de3ed86b1e2897d70183f3b0f4fbfd7d2bda80
Related: osmocom-bb.git Iab6d9147f6e0aeb99239affacf318a3897fd6ffe
Related: OS#5500, OS#6131
This also fixes a memcpy writing out of bounds reported by Coverity
CID#323120 in gprs_rlcmac_tbf_ul_ass_start_from_dl_tbf_ack_nack(), due
to the difference of size between struct gprs_rlcmac_ul_tbf_allocation
and struct gprs_rlcmac_dl_tbf_allocation.
While fixing it, actually properly implement passing of the 1 only
interesting TS to the tbf_ul_ass_fsm at that point in time.
Change-Id: I89b15982b73f00599183981142495d7b9befbb78
This code part will also be used by tbf_ul_ass_fsm.c to temporarily
configure lower layers with ctx->phase1_alloc in order to receive RTS
indications which the RLC/MAC uses to tick the FSM in state
GPRS_RLCMAC_TBF_UL_ASS_ST_WAIT_TBF_STARTING_TIME1.
Change-Id: I174327b25b726662a6b5902008e205ddb3de2fe0
This is needed after RAU Update since the PCU may still be using the old
TLLI to reference the MS for a while until it finds out about the TLLI update.
Change-Id: I2653db3dac58342df02a1b4d0c76e69e0e8d583f
This enum should match osmo_gprs_gmm_gmmrr_prim_type, and I placed that
osmocom-specific enum at the wrong place in the rlcmac counterpart.
Change-Id: I3f198c756866417f8f975373f84fd3ec4da608fa
The "Radio Priority" received in GMM Attach Accept are for SMS and TOM8
SAPs only. For GMM/SM unitdata transferred to LLC, use highest
radio_prio=1.
Change-Id: Ie583c433547fb5ecbb6b6077c39a157961f73cfc
This simplifies the array handling in the LLC queue, and moves param
checking to the rx rlcmac_prim path instead of deep in the llc_queue
enqueuing code.
This commit also fixes the RADIO_PRIORITY field in the Channel Request
Description section of PKT DL ACK/NCK, since
gprs_rlcmac_llc_queue_highest_radio_prio_pending() now returns the enum
normalized 0..3 as expected by the field format (before it was returning
1..4).
Change-Id: If2d1946522bc4a1c19d65acb23605f1a3f05ab45
Ported from open5gs.git/lib/gtp/v1/types.{c,h} 5764f7267d16a8ea6aeedc6c227552575915def5,
for which I was the author too.
The ARP extra byte field at the start of the IE val which is introduced in the
GTP variant is dropped when porting to SM, since it's not present there
(and offsets/sizes are adjusted).
The QoS code is moved is moved into a common/ directory where a new
libosmo-gprs-common.la private static library is created.
This is done in order to be able to resuse the QoS dec/enc code in
several libraries since it's actually planned to use it in SNDCP and SM
layers.
The most natural place to add the APIs is SM, and that's where the
public API to accees the enc/dec is provided, since the user app will
have to use them in the SM SAP.
However, the SNDCP will also have to decode the QoS recived by SM
through the SNSM SAP, and we don't really want libosmo-gprs-sndcp depend
on libosmo-gprs-sm. This way libosmo-gprs-sndcp will be able to use the
private APIs directly in a follow-up commit.
Change-Id: I6c0676e55bb1f0f424f41d8d04d4f5e5bf376f4f
Getting out of contention resolution means we may have to update our
calculated CV state because we are no longer sending TLLI.
Same happens if a new tx CS is provided by the network, since different
block size means different CV.
In this commit only code paths for the state where already in Countdown
Procedure are added. If TBF has to enter Countdown Procedure due the
above mentioned changes, it will do so using regular path where a new
RLC block is created.
Related specs: TS 44.060 9.3.1
Related: OS#6018
Change-Id: I6ca88c005060ba1302d46717e45b0d9731d86d8d
Discarding a packet through CoDel during Countdown procedure may end up
in the transmitted CV=14..0 being incorrect, since we are not really yet
recalculating them once we enter Countdown procedure.
Hence, to make it simpler for now, avoid dropping packets when in
Countdown procedure to avoid having to recalculate them.
Change-Id: I311302b5282767dc806b1dfe053994f175390b69
Problem this patch is fixing:
The current RLCMAC window code ported from osmo-pcu is never
invalidating the BSNs which have been received after they are not
needed.
As a result, when the DL TBF keeps sending data for a long time, and
finally BSN wraps around 127->0, when this implementation receives the
BSN=0, it will find it is already received and hence will discard it,
and then keep asking for BSN=0 nevertheless in PKT DL ACK, causing an
endless loop where PCU stays submitting the same block forever.
Explanation of the solution:
The V(N) array contains the status of the previous WS (64 in GPRS) data
blocks. This array is used to construct the RRB signaled to the peer
during PKT DL ACK/NACK messages together with the SSN (start sequence
number), which in our case is mainly V(R), aka one block higher than the
highest received block in the rx window.
Hence, whenever PKT DL ACK/NACK is transmitted, it contains an RRB
ranging [V(R)-1,...V(R)-WS)] mod SNS (SNS=128 in GPRS).
The receive window is basically [V(Q) <= BSN < V(R)] mod SNS, as is of
size 64.
The V(R) is increased whenever a highest new block arrives which is in the
receive window (guaranteeing it will be increased to at most V(Q)+64.
Since we are only announcing state of blocks from V(R)..V(R)-WS, and
blocks received which are before that BSN are dropped since don't fall
inside the rx window, we can securely mark as invalid those blocks
falling behind V(R)-WS whenever we increase V(R).
Related: OS#6102
Change-Id: I962111995e741a7e9c230b2dd4904c2fa9a828e9
TS 24.007, TS 24.008, TS 44.064 nor TS 44.065 explain how the TLLI
update happening during GMM RAU propagates to the SNDCP layer.
GMM only has interfaces towards LLC and GRR, and uses LLGMM-Assign.Req
and GMMRR-Assign.req to update the TLLI in the respective layers.
This patch adds a new primitive in the LL interface (LLC->SNDCP)
LL-Assign.ind to propagate the LLGM-Assign.req received from
GMM towards SNDCP, so that it can use the new TLLI in order to address
the specific MS.
Change-Id: Icb858f5397414b6d4183c21f13d35c0166ca7635
TS 24.007 and TS 24.008 seem to lack providing an explicit way to pass
information between GMM and SM (GMMSM interface) when a RAU process
happens in GMM (rx RAU Accept).
This lack of primitive can easily be spotted by looking at TS 24.007
Appending C.15, or even better, at the 3rd page of "C.16(cont’d)" around
the "STOP Trams" timer, where the info is magically available in SM when
being received at GMM.
Change-Id: I81e207d44d88f18f0ee13fb413827606a6f830bc
This can be used for users receiving the GMMRR_ASSIGN_REQ primitive to
find out if it's a creation, update or deletion of a TLLI.
Change-Id: I881b1370b283ceee98c035ed42b91f7e12611979
This is used by lower layer L1CTL to notify the upper layer RLCMAC when
it's prepared to use CCCH.
Change-Id: I4cfb1e2db217a97b7a1dc8849cd13d58e4034c56
TS 44.018 3.5.2.1.4:
"The one phase packet access procedure is completed at a successful
contention resolution. The mobile station has entered the packet transfer
mode. Timer T3141 is stopped on the network side. Timer T3164 is stopped
on the mobile station side."
Change-Id: Ic7420a42e2e81effdde587d7e49acd66b404354c
This will be needed in follow-up patches for the MS to trigger actions
when TBFs are freed (like going back to IDLE mode, or start
packet-access-procedure).
Change-Id: I72959e27f2f62c84218d740cfb9e396d70562929
* Send the PDCH_ESTABLISH.req on receipt of RR IMM ASS,
* Sending of PDCH_RELEASE.req is to be implemented.
Change-Id: I2568c58646ce7511367275ac96cd55e7fdd7ec18
Related: OS#5500
The Countdown procedure (decreasing CV field in UL RLCMAC data blocks)
is defined in TS 44.060 9.3.1.
It is implemented by means of counting/calculating the amount of RLC/MAC
blocks to be transmitted based on the LLC frames in the several LLC
queues, without actually generating the RLC/MAC blocks. The blocks
cannot be generated ahead of time because that wouldn't allow recreating
them in case Tx UL CS changes, or if a higher priority LLC frames
arrives.
The functions calculating the required amount of RLC/MAC blocks are
coded so that they early return to avoid spending more time than
necessary counting blocks (< BS_CV_MAX).
An extra heuristic optimization to be used when LLC queues are long is left
documented as a TODO, in order to test further the general non-optimized
path for now. Once the counting is proved to work reliably, that and
other heuristic optimizations ca be implemented, like keeping and
decreasing CV cached counter while no Tx CS change occurs or no new LLC
frames are enqueued.
Change-Id: If043c86a0c2b89d0ac0b8174de39fbcb22bed8cb