Commit Graph

291 Commits

Author SHA1 Message Date
Pau Espin c25b28c809 rlcmac: tbf_ul: Fix TI bit never set when encoding the block
The TI bit was correctly set (together with the TLLI) in
create_new_bsn(), but was not properly propagated later on in
create_ul_acked_block() to the intermediate struct before the final
encoding to the packed structure containing the final message
(gprs_rlcmac_rlc_write_ul_data_header).

Change-Id: I6ba361bc9bc47230954cca19c7f2f8cf74d8278e
2023-03-02 16:28:34 +01:00
Pau Espin c7a55b3c4a rlcmac: Fix gprs_rlcmac_ul_tbf_in_contention_resolution() for 1phase access
Change-Id: I7d08be3d8fa584ebad98d3548c05bd1ff284ba7e
2023-03-02 16:28:26 +01:00
Pau Espin aef4114abb rlcmac: Fill radio_priority in Dl Ack/Nack Channel Request Description
Change-Id: I740fac72cb418d4b61499990b13208fcd4bb922f
2023-02-27 17:12:51 +01:00
Pau Espin 9a44df6084 tbf_dl: Fix state_fsm instance not freed
Change-Id: I2f89810dd346cee904dcff0b598e229bd5f84a9f
2023-02-27 16:22:16 +01:00
Pau Espin 294b886be6 rlcmac: Implement T3182
Related: OS#550
Change-Id: I4fe9523af1b53c826ccfdd8700bab2a9e1413662
2023-02-21 19:44:43 +01:00
Pau Espin 6f87373fc0 rlcmac: ul_tbf_fsm: rework Rx UL ACK/NACK fsm events
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
2023-02-21 19:38:18 +01:00
Pau Espin 184fcce168 rlcmac: ul_tbf: Fix ul_state wrong check
This error was introduced when importing and rerwitting code from
osmo-pcu.git.

Fixes: 8c2734fa43
Change-Id: Id4d7ad5fb393580a2e760513bb513ba968d2c1ef
2023-02-21 19:38:18 +01:00
Pau Espin 4486aa276c rlcmac: Use finished UL TBF to request a new one after Final UL ACK/NACK
Change-Id: I4eb873250f5ee7eafb5b6126382ce088091d0447
2023-02-21 19:38:15 +01:00
Pau Espin 13c2601974 rlcmac: ul_tbf: Fail if data block CV=0 retransmitted > 4 times
Change-Id: I1a2e1bca296591c34e25faca3f9048e0274ebbd1
2023-02-21 17:27:46 +01:00
Pau Espin 4da257390f rlcmac: ul_tbf: Submit event FIST_UL_DATA_SENT before LAST_UL_DATA_SENT
If there's only 1 block to be sent, the LAST_UL_DATA_SENT was being sent
before the FIRST_UL_DATA_SENT one, which created problems in the FSM
(when adding more logic later).

Furthermroe, this change also makes it send retransmission events, which
makes it similar for both FIRST and LAST events. This will also be
needed for T3182.

Change-Id: I701dbe00ff2af62c45d862a9211b5b1120f3efa3
2023-02-21 17:27:46 +01:00
Pau Espin 46a4f3ed66 rlcmac: Implement T3168 (Pkt Res Req timeout 2phase access)
Change-Id: Ibf011ca94e50542b67353cd8f7f74c5be955af34
2023-02-21 17:27:46 +01:00
Pau Espin 96fe992644 rlcmac: Fix null ptr access in dl_tbf object
Fixes: Coverity CID#310022
Change-Id: I3817d9e77a440682fa2c538e0fbee295ffdbcfff
2023-02-21 17:27:46 +01:00
Pau Espin f15ee0daa5 rlcmac: tbf_dl: Fix msgb null ptr access if dl block contains several LLC frames
Fixes: Coverity CID#310023
Change-Id: I627724fda5b9ffcf13433ea69af908d725e94299
2023-02-21 17:27:46 +01:00
Pau Espin 5daf94b203 rlcmac: ul_tbf: Answer Pkt Ul Ack/Nack poll with Pkt Ctrl Ack
Related: OS#5500
Change-Id: I833d0f189c06d093ce9bd4c36c37024cf5cb6446
2023-02-21 17:27:43 +01:00
Pau Espin bf1f5f3613 rlcmac: ul_tbf: Append TLLI when in contention resolution
Change-Id: I4023f21930e93c8cc10befc92f917139b656175a
2023-02-21 17:11:04 +01:00
Pau Espin a9da84ac9f rlcmac: Implement N3104
Related: OS#5500
Change-Id: Ia8c35aad7a537ab76447187847f8cee8c379352c
2023-02-21 17:11:00 +01:00
Pau Espin 7ff9597b43 rlcmac: tbf_ul: Allow sending UL data if in state FINISHED
This can happen for instance if MS sent al the data but PCU didn't
receive it all (some it was lost) so it can still keep asking the MS to
submit data. In this case, the MS shall attempt retransmit of some
unacked data.

Change-Id: I2333a0a432c0c6f223bc1043ddb0d9c34842a5a3
2023-02-20 13:28:55 +01:00
Pau Espin dfe49c5f44 rlcmac: Handle SI13 from L1CTL
Change-Id: Ifaddf0e6e5cad7ea25672804c83c254579874813
2023-02-20 12:31:25 +01:00
Pau Espin 175d251fb7 rlcmac: Implement T3166
Change-Id: I58dd757cbb5d8279fdf7fbdfb6f38ec0119c6156
2023-02-20 12:31:25 +01:00
Pau Espin 6a90da108a rlcmac: Implement T3164
Change-Id: I1a3d7b552b36b84d84ca27572ce313265810fd3d
2023-02-20 12:31:25 +01:00
Pau Espin b9e06c9955 rlcmac: tbf_*: Unlink the freeing tbf from its gre
Change-Id: I2079c4440a05f4b44c9b7bece383c69e84198302
2023-02-20 12:31:25 +01:00
Pau Espin b853424a28 rlcmac: tbf_ul: Fix wrong function called looking up msg size
Change-Id: I9d5afee36a633c311b5657181d0de7cbddd593e0
2023-02-20 12:31:25 +01:00
Pau Espin 8c2734fa43 rlcmac: Implement Rx of UL ACK/NACK
Related: OS#5500
Change-Id: I5e3d8e77042d3ad1618e6b62bc1a377a93239580
2023-02-20 12:31:25 +01:00
Pau Espin b3b0388f6b rlcmac: llc_queue: Fix access to null msgb during dequeue
Change-Id: I513aaef6ad0f44b5a6d32be512bdd8b4fdabb4e7
2023-02-20 12:31:25 +01:00
Pau Espin 4113903f63 rlcmac: Implement Tx of DL ACK/NACK
Measurement related functionality is not yet implemented and hence the
related fields cannot be filled in yet.

Related: OS#5500
Change-Id: I6ae2df07929fb6c4733e87b18cebe75a6f24f520
2023-02-20 12:31:25 +01:00
Pau Espin cccba723b4 rlcmac: Introduce initial poll answer infrastructure
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
2023-02-20 12:31:25 +01:00
Pau Espin f4f69fbde0 rlcmac: Implement initial DL rx data path
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
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 e8ad79e3a8 rlcmac: Initial ul_tbf data support
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
2023-02-13 10:51:07 +01:00
Pau Espin 60bd08e44d rlcmac: Make sure entities are freed if lib is re-initialized
This allows proper memory cleanup of the whole library everytime we want
to run a new unit test in the same proces.

Change-Id: I568e2f783a575ae457f0845eca34951ae9822eeb
2023-02-13 10:44:30 +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 9dc9da3ea6 rlcmac: llc_queue: Make sure queue is cleared before freeing mem
Change-Id: Iadd08c727d46dfb5cac4df5219ecbcbacf6482eb
2023-02-10 13:13:58 +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 168629eb24 rlcmac: Refactor msg_type enums and value_string
Add prefixes, clean formatting, move to proper place, etc.

Change-Id: Ic55782d90c0d7876fc37d1da130b859857c11447
2023-02-01 18:28:11 +01:00
Pau Espin 94e32c4bdf rlcmac: Move spec related definitions for general use to types.h
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
2023-02-01 18:23:41 +01:00
Pau Espin 4e0a9770ec rlcmac: Rename ts_*.c -> csn1_ts_*.c
Done for files containing mostly (99%) of CSN1 related structrs and
encdec functions.

File ts_44_064.c is kept as is since it's not CSN1 related.
File csn1_ts_44_060.c still contains some enums and value_string which will
be split into ts_44_060.c in a follow up commit.

Change-Id: I93ad9f90e7496b81ccfe679a614589373f244166
2023-02-01 18:23:17 +01:00
Pau Espin 6d30091174 rlcmac: Rename gprs_rlcmac.h -> csn1_defs.h
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
2023-02-01 18:20:29 +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
Pau Espin 28dd01ed25 rlcmac: Support extending log categories in the future
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
2023-01-25 23:33:57 +01:00
Pau Espin c0ba710d6b llc: Initial support for GRR-UNITDATA.ind/req
This allows forwarding GRR-UNITDATA.ind/req up & down the stack, to be
on pair with the BSSGP LLC SAP.

Change-Id: I6a4454b4aa2c96e1f4ce7e2a5d5aba8ec1cf3f60
2023-01-23 20:56:41 +01:00
Pau Espin 847a26d45a sndcp: Fix missing dep link against libmath
It is already present in libosmo-gprs-sndcp.pc.in Libs.private, but it
was forgotten at compile time.
That makes it fail under some systems when linking against it (like jenkins):
/build/deps/install/stow/libosmo-gprs/lib/libosmo-gprs-sndcp.so: undefined reference to `ceil'

Change-Id: Iba9629b323b50b28cc4c54cf35b2e39ee89bc192
2023-01-17 14:33:11 +01:00
Pau Espin 94dfdc8bfd llc: Allow app provided callbacks to retain ownership of passed primitive
This way the app can, for instance, simply forward the primtiive pointer
from LLC callback to SNDCP layer, which will in the end take the
ownership of the primitive and free it.

Change-Id: I6ea91b8f190a399c4bcf6c7cba9a65809aaf3ddb
2023-01-12 15:38:32 +01:00
Pau Espin df5a72f556 llc: Log error loading gprs chiper plugins
Change-Id: Ie0438b444c2aff8991736806256fb67b59ee8bcc
2023-01-12 15:38:32 +01:00
Pau Espin f4256b74d3 sndcp: Initial support for async SN-XID.ind and SN-XID.rsp
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
2023-01-12 15:38:32 +01:00
Pau Espin 80a74d3a4c sndcp: Fix wrong prim op passed in osmo_gprs_sndcp_prim_alloc_sn_xid_rsp()
Change-Id: I0644bf481c06a2cfc1d9f57995eefedf36e8b839
2023-01-12 15:38:16 +01:00
Pau Espin 9a425c8070 sndcp: Fix wrong field used printing nsapi
Change-Id: If16665af02369fcb8da8e996ba17f11d8987956e
2023-01-09 14:38:33 +01:00
Pau Espin 24a100bac8 sndcp: Initial libosmo-gprs-sndcp support
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
2023-01-04 14:54:04 +00:00
Vadim Yanitskiy 36a6ff60f0 rlcmac: rename s/SI_13_t/SI13_RestOctets_t/
Change-Id: I74ed534b9b52b70cdf8e4e2d4d960bb1d9aaf27b
2023-01-02 12:56:38 +00:00
Vadim Yanitskiy 79a945feba rlcmac: use OSMO_ASSERT instead of plain assert()
Change-Id: Ia834285cbaba34e2f0783bf83bd2f3934d74d778
2023-01-02 12:56:38 +00:00
Vadim Yanitskiy 3095b63610 rlcmac: remove unneeded includes
Change-Id: Ie82fb9e5fe607f925bb8a698a789ef79f168add2
2023-01-02 12:56:38 +00:00
Vadim Yanitskiy caef6c1b13 rlcmac: implement the missing IA_MultiBlock_PktDlAss_t
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
2023-01-02 12:56:38 +00:00
Vadim Yanitskiy d2edff76d0 rlcmac: rename s/IA_EGPRS_00_t/IA_EGPRS_PktUlAss_t/
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
2023-01-02 12:56:38 +00:00
Vadim Yanitskiy 376f2a1297 rlcmac: fix coding of EGPRS Packet Uplink Assignment in IA RestOctets
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
2023-01-02 12:56:38 +00:00
Vadim Yanitskiy 84b385d15c rlcmac: add decoder and test vectors for IA Rest Octets
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
2023-01-02 12:56:38 +00:00
Pau Espin f2c6bb980d llc: Initialize gprs_cipher
Change-Id: Ifac6239a3695b69f694eb55574de64a62b0787ed
2022-12-23 13:32:44 +01:00
Pau Espin 91c87d6907 llc: Proper separation of public & private APIs, Introduce llc_prim API
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
2022-12-21 04:49:08 +07:00
Pau Espin f6e4b3be4c llc: rework logging, add LOGLLC macro
Change-Id: I8ad3267f890a21b6c935b36b256b00bd0a4da8d6
Related: OS#5502
2022-12-21 04:49:08 +07:00
Pau Espin 05a16204f9 llc: add enum osmo_gprs_llc_{location,prim_sap}
Change-Id: I5606c0b41196f25adbc00cfdce9927daaed9a901
Related: OS#5502
2022-12-21 04:48:19 +07:00
Pau Espin 1868001ee0 llc: add libosmogsm dependency
libosmogsm is needed for the follow-up patch [1].

Change-Id: Iee45fb87905ea29df02a48003396bde27e6c550c
Related: [1] I588eb576b2703262f4ab9566ec362920d8390cfd
Related: OS#5502
2022-12-21 03:46:08 +07:00
Pau Espin 384172005c llc: fix typo: OSMO_GPRS_LLC_SAPI_SNDCP{12->11}
Change-Id: Icee190d0e20044d3808a8b1beb237a987a795d8e
Related: OS#5502
2022-12-21 03:16:08 +07:00
Vadim Yanitskiy 1880e28bbc llc: implement Exchange Identification (XID) codec
Change-Id: I16b3f7ab82c489144098aad0dccc4c67d8382c67
2022-09-28 23:01:16 +07:00
Vadim Yanitskiy 11d55e8fc4 llc: add missing enum osmo_gprs_llc_xid_type values
See 3GPP TS 44.064 version 16.0.0 Release 16, table 6.

Change-Id: Ifdca0c742727a030008a01848153c23e0e0017bd
2022-09-26 17:12:34 +07:00
Vadim Yanitskiy ed231df931 llc: add value-string for enum osmo_gprs_llc_xid_type
Change-Id: I90b6a1aa4e13984f4c43245df1308d0c3f82636f
2022-09-26 17:12:34 +07:00
Vadim Yanitskiy 0b5a816356 llc: make logging category configurable
Similar to Icfef6de126304da81120f1d7b212992ead3409aa, let's add
osmo_gprs_llc_set_log_cat() allowing the API users to change
logging category for libosmo-gprs-llc (DLGLOBAL is default).

Change-Id: I9deb794db1c80257ba81523f815232208381bc27
2022-09-22 01:54:07 +07:00
Vadim Yanitskiy 76ac335541 llc: osmo_gprs_llc_hdr_dump[_buf](): also print SAPI name
Change-Id: I95763e622bb3c3678c06901ddaecfc200d359d8d
2022-09-22 01:02:21 +07:00
Vadim Yanitskiy 0963447322 llc: add struct value_string osmo_gprs_llc_sapi_names[]
Change-Id: I8ae048ab9e6b63697951fa3f74ce671c88328f5f
2022-09-22 01:02:21 +07:00
Vadim Yanitskiy c1ca5406bc llc: implement LLC PDU codec based on code from osmo-sgsn.git
osmo-sgsn.git 13ccbc1e6120fe78f6f9f950d7242090920ca41b

Change-Id: I61d7e2e6d0a8f2cdfc2113e637e447dc428cc70d
2022-09-22 00:56:15 +07:00
Vadim Yanitskiy bae1ec285b llc: add -export-symbols-regex '^osmo_' to CFLAGS
Change-Id: I7fac3ef730ea4b2719002dd61289b22c424f43f4
2022-09-18 20:45:44 +07:00
Vadim Yanitskiy 4762fcc885 llc: import FCS (CRC24) calculation API from osmo-sgsn.git
osmo-sgsn.git fb6cf3221ef4989441c09a650011e4a334c37d12

Changes made:

* Add 'osmo_' prefix to gprs_llc_fcs(),
* osmo_gprs_llc_fcs() takes size_t and returns uint32_t,
* crc24_calc() takes size_t.

Change-Id: Ib4465c289d9ef2a1b8ef5730c559bc799bb1f012
2022-09-18 20:45:44 +07:00
Vadim Yanitskiy fcd76ba2d1 llc: add definitions from 3GPP TS 44.064 section 6.4
Change-Id: I6d0e1a878fb80c57a901da08798620a6ea4471a4
2022-09-18 20:45:44 +07:00
Vadim Yanitskiy 2639b78795 Initial libosmo-gprs-llc library skeleton
Change-Id: Ia537acc6f4e6ab576dc7959d427b80f62c474296
2022-09-02 00:58:05 +07:00
Vadim Yanitskiy 4e50861ea0 rlcmac/ts_44_018: add missing M_PADDING_BITS to SI_13_t
According to table 10.5.2.37b.1, SI 13 Rest Octets IE does contain
spare padding.  Adding M_PADDING_BITS fixes decoder warnings about
unhandled remaining bits.

Change-Id: I44fb7e2a60da022ee99f1a6cd4f2635bef2bfe1e
2022-08-24 21:15:56 +07:00
Vadim Yanitskiy 74ec6d9cb6 rlcmac: add osmo_gprs_rlcmac_decode_si13ro()
Change-Id: Ic8446509ef474b8496e5557aab3d2a9e94e11897
2022-08-24 21:15:56 +07:00
Vadim Yanitskiy 4a04f1d5ab rlcmac: split ts_24_008.c out of ts_44_060.c
Change-Id: Idedf52423fef18b929e8096fbe4e130b5a6c7d2c
2022-08-24 21:15:53 +07:00
Vadim Yanitskiy 931b64ee79 rlcmac: split gprs_rlcmac.c onto ts_44_{060,018}.c
Change-Id: I2b941f06a70a25e92ba3fd2638f87360a5aa5435
2022-08-24 21:03:51 +07:00
Vadim Yanitskiy 8e3f0fd84a rlcmac: make logging category configurable
Change-Id: Icfef6de126304da81120f1d7b212992ead3409aa
2022-08-24 20:56:17 +07:00
Vadim Yanitskiy 56a2d28f59 csn1: #include <stddef.h> in csn1.h for offsetof()
Do not require the API user to include <stddef.h>:

  note: 'offsetof' is defined in header '<stddef.h>';
        did you forget to '#include <stddef.h>'?

Change-Id: I2a144c9967b90d78d95db103eebce83822d8c64d
2022-08-22 06:00:28 +07:00
Vadim Yanitskiy 00498acb16 rlcmac: add -export-symbols-regex '^osmo_' to LDFLAGS
Change-Id: I17c0f1d7b7f3ec07eb880e4db46e316a5753edd3
2022-08-07 17:51:26 +07:00
Vadim Yanitskiy 2b4c0972b8 rlcmac: expose [osmo_gprs_rlcmac_]egprs_pkt_ch_req_type_names[]
Change-Id: Ieb8046b16e1b992dc20055539988af6c3a9a7a4e
2022-08-07 17:51:26 +07:00
Vadim Yanitskiy 2532d04f17 rlcmac: properly expose osmo_gprs_rlcmac_encode_ms_ra_cap()
Change-Id: Ib5660f3a384ae8eea976197ad7b7135dbae180e5
2022-08-07 17:51:26 +07:00
Vadim Yanitskiy 6e7618e575 rlcmac: prefix enc/dec function names with 'osmo_gprs_'
Change-Id: Ibd8038582699f1f8e7b159898fd431208f13dd9b
2022-08-07 17:51:26 +07:00
Vadim Yanitskiy 4c5163c6f1 rlcmac: do not expose internal CSN.1 callbacks and dissectors
Change-Id: Ida9d16b41a2241d72cf5650ad4757ca3ca1da5f3
2022-08-07 17:51:26 +07:00
Vadim Yanitskiy 812b95e444 rlcmac: do not expose PSI1_AdditionsR6_t and EGPRS_PacketChannelRequest_t
Change-Id: I1917148ae384b0995c79107a688b02b4997b0c76
2022-08-07 17:51:26 +07:00
Vadim Yanitskiy ed06cbbfbc libosmo-gprs-rlcmac: check-in PDU definitions from osmo-pcu.git
This commit introduces a new library called 'libosmo-gprs-rlcmac',
which is going to be used by osmo-pcu and osmocom-bb for parsing
and generation of PDUs defined using CSN.1 (see 3GPP TS 24.007).

The actual RLC/MAC definitions are imported from osmo-pcu.git [1].

Change-Id: Ic322543e6d9a870beec83fa1166352e4a51366e7
Related: [1] osmo-pcu.git 0eaa3d379828517b5478d0202a26f6f3eb561a4e
2022-08-07 17:51:26 +07:00
Vadim Yanitskiy eb2ab031d4 csn1: add -export-symbols-regex '^osmo_' to LDFLAGS
Expose only those symbols which contain perfis 'osmo_'.

Change-Id: I9d084e9a2660ab14801f9ce418748b7580e9e131
2022-08-07 17:51:26 +07:00
Vadim Yanitskiy d833ff4574 csn1: csnStreamInit() -> osmo_csn1_stream_init()
Change-Id: I8b1486b99e4beb3161ed515889e967556a29cbc1
2022-08-07 17:51:26 +07:00
Vadim Yanitskiy 5ff3db84d3 csn1: csnStream{En,De}coder() -> osmo_csn1_stream_{en,de}code()
Change-Id: Iba7b40daf37be8759bb652e3c34653df1ed92d9e
2022-08-07 17:51:26 +07:00
Vadim Yanitskiy 40f95ed7c4 libosmo-csn1: check-in CSN.1 codec from osmo-pcu.git
This commit introduces a new library called 'libosmo-csn1', which
is going to be used by osmo-pcu and osmocom-bb for parsing and
generation of PDUs defined using CSN.1 (see 3GPP TS 24.007).

The actual CSN.1 codec is imported from osmo-pcu.git [1].

Change-Id: Ib195d1e2a53aead4f89c799cef1e5f1be110aad9
Related: [1] osmo-pcu.git 0eaa3d379828517b5478d0202a26f6f3eb561a4e
Depends: libosmocore.git Ie8c0effb764547a0f9cc8c6825e11a6617501e95
2022-08-07 17:51:26 +07:00