The library itself only contains a bunch of boilerplate to build the
library and have usual initialization, logging, prim APIs.
There's not yet much logic specific in it yet, but will make next
commits easier to review.
Related: OS#5501
Change-Id: Ie098576954a55e5046c2463390ab7133511c1eb3
The code to generate a PKT CTRL ACK is the same for a DL TBF and an UL
TBF.
Move it to the generic base class in order to be able to generate it for
a DL TBF in a follow up patch.
Change-Id: I767696b445842ebc32b35c320273b13f63076ca4
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
We'll need to get one event for each Pkt UL ACK/NACK the UL TBF receives
in order to implement T3182 properly in a follow-up patch, hence rework
the events sent to the FSM (merge events about Final ACK and Contention
Resolution in one generic UL ACK/NACK event with some data parameters).
Change-Id: I4420abd69a318bd93fde73a67239456466071497
Measurement related functionality is not yet implemented and hence the
related fields cannot be filled in yet.
Related: OS#5500
Change-Id: I6ae2df07929fb6c4733e87b18cebe75a6f24f520
This commit imports pdch_ul_controller.{c,h} from osmo-pcu.git
d8cea3c618dbd2a343e6c012e5545006d44fc244 and adapts it to be of use on
the MS side.
Related: OS#5500
Change-Id: I9d38a8de4240e65585cc8bbe3c044473af5a83e5
This code imports code from osmo-pcu.git
d8cea3c618dbd2a343e6c012e5545006d44fc244 (heavy modified to adapt to
current code base).
With this patch the RLCMAC layer is already capable of decoding RLC/MAC
GPRS data blocks and submit them as LLC frames to the upper layer.
Related: OS#5500
Change-Id: Ie7535606916c0800c0e1bd9555be022c81ea257d
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
This is basically an import of relevant code from osmo-pcu.git
08523c2286dfe27402f8e2eb4b98da5a529c7915 which allows encoding LLC
frames into RLC/MAC uplink data blocks.
A 1-to-1 import was not possible for several reasons:
* osmo-pcu uses C++ in some places
* osmo-pcu implements encoding of DL data blocks, not UL data blocks
* Some osmo-pcu code is still not really polished and stuff is still
mixed (for instance rlc_window(_ul).c/h were split into their own
files here).
Hence this was not a "copy all files and leave as they are" import, but
rather looking at the encode path starting on osmo-pcu.git scheduler and
see which code had to be pulled in to encode the RLC/MAC blocks.
Due to the slightly different requerirements for UL and DL blocks, it is
well possible that further work in needed in order to have the code
produce correct blocks. This is only a first step to pull in all code so
that stuff can be fixed in smallish incremental steps.
Related: OS#5500
Change-Id: I0a01d79d16bbfc63aa88e6bb0f432f3772645730
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
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
Move types defined by spec not directly/solely intended for the CSN1
encoder/decoder operation to a separate types.h header.
More and more types will be added there which will be used by the data
domain inside and outside the library.
Change-Id: Ib0fdae48fc3e76d701d21644826e5ffd8553fecb
That header is used (and should only be used) to contain CSN1 related
code for the encoder/decoder.
Hence rename it, otherwise it looks like a general placeholder for any
kind of stuff.
Change-Id: I84ea63ed0b804699fd995a2e0c07ced17b3ad4c8
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
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
An initial header structure and LOG defines is created in a similar way
to those already existing for libosmo-gprs-llc and sndcp.
Related: OS#5500
Change-Id: Ic9ba207cafeada1b174f1b085e0d1d9a38c66b0a
This allows forwarding GRR-UNITDATA.ind/req up & down the stack, to be
on pair with the BSSGP LLC SAP.
Change-Id: I6a4454b4aa2c96e1f4ce7e2a5d5aba8ec1cf3f60
Before this patch, the response was being crafted synchronously through
a direct function call. This patch provides initial support to trigger
the primitives so that the application using the SNDCP layer can handle
the indication and submit a response.
The different XID L3 params are still not being passed to the app, that
will be done in a subsequent patch.
Change-Id: I0a5069fd3dc0d6c3dd28aeae09b51c49dd8be92d
This commit follows a similar approach to Change-Id
I588eb576b2703262f4ab9566ec362920d8390cfd, this time targeting the SNDCP
layer, creating a new library for it.
This new library depends on headers from libosmo-gprs-llc since the
SNDCP spec takes the interface towards lower interfaces from same
llc_prim. It doesn't really call any API from the libosmo-gprs-llc
library to dispatch the primitive, that's left for the application, so
that it can be reused against other implementations.
Most of the SNDCP data structures and APIs are kept private and used
only internally. The Higher/lower layers are expected to interact with
it through the sndcp_prim API.
This commit also implements some of the code paths of the public API by
means on importing SNDCP code from osmo-sgsn.git commit
57b63875c762a784127a13becd1c2549ca6c5454.
The import of code cannot be done in a separate commit since existing code
in osmo-sgsn.git is low quality and has tons of layer violations in all
directions.
Hence, this commit aims at being an initial point of having some working
SNDCP stack by means of a few unit tests, but by no means aims to be a
total working implementation. Some code paths are missing; bugs are
expected at this point.
Change-Id: Ie05b5d721cf0a6147ed45c1feb75ad829865252b
Add missing definition for the <Multiple Blocks Packet Downlink
Assignment> structure. It's not 100% complete, but should serve
a good starting point if we ever need to support this.
Change-Id: I544245f690fdd14a94f858a5f3cd8f8d39d17611
Related: OS#5500
Use a self-explanatory name instead of the one with magic numbers.
It's safe to rename it because this API is not used anywhere yet.
Change-Id: I884cba359bfda21cf45fa846e5b7ff20d129bdf7
Related: OS#5500
Thanks to the unit tests, it was found that decoding of the LH part,
specifically the EGPRS Packet Uplink Assignment structure, is done
incorrectly. This patch fixes incorrect decoding.
Double usage of the UnionType element in the IA_EGPRS_t has a side
effect: the M_UINT actually consumes one bit, so the remaining bit
stream is shifted and decoded incorrectly.
Replace a combination of M_UINT and M_CHOICE with two M_UNIONs.
Remove struct IA_EGPRS_t, which is not used anywhere yet.
For reference, see 3GPP TS 44.018, table 10.5.2.16.1.
Change-Id: I7fedbad1ac4d744d1d3941553e573d4202e9d24a
Fixes: I39a29dc9b5b22ce4374ae33336696014e326d012
Related: OS#5500
This new API is needed for the MS side GPRS implementation in order
to be able to establish an Uplink TBF. Both wireshark and osmo-pcu
rely on hand-written code for parsing and generating the IA Rest
Octets IE, making no use of the CSN.1 codec.
We already have some (mostly commented out) CSN.1 definitions needed
for decoding the IA Rest Octets IE, inherited as-is from wireshark.
Ths patch adds the missing bits and a few unit test vectors.
Note that decoding of the LH part, specifically the EGPRS Packet
Uplink Assignment structure, is currently done incorrectly because
there is a problem in the IA_EGPRS_t definition. This will be
fixed in a follow-up patch.
For reference, see 3GPP TS 44.018, table 10.5.2.16.1.
Change-Id: I39a29dc9b5b22ce4374ae33336696014e326d012
Related: OS#5500
Most of the existing (and added) data structures are kept private, since
most of those don't really need to be used outside internal code in the
library.
Most if not all the interaction from upper and lower layers towards LLC
is now done through the new llc_prim pubic interface. This interface is
based on 3GPP TS 44.064 section 7.1.2.
This commit also implements some of the code paths of the public API by
means on importing LLC code from osmo-sgsn.git commit
57b63875c762a784127a13becd1c2549ca6c5454.
The import of code cannot be done in a separate commit since existing code
in osmo-sgsn.git is low quality and has tons of layer violations in all
directions.
Hence, this commit aims at being an initial point of having some working
LLC stack by means of a few unit tests, but by no means aims to be a
total working implementation. Some code paths are missing; bugs are
expected at this point.
Related: OS#5502
Change-Id: I588eb576b2703262f4ab9566ec362920d8390cfd