Commit Graph

31 Commits

Author SHA1 Message Date
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 22189e7329 llc: add definitions of service primitive parameters
Change-Id: Iaa520a818b05c962e0d3be9607d3a8c5991f539e
2022-09-22 01:02:21 +07:00
Vadim Yanitskiy f981c629d5 llc: rename enum osmo_gprs_llc_{primitive->prim_type}
Change-Id: Ie0f9cd174934c54940217b89e46568a7c1b76b96
2022-09-22 01:02:21 +07:00
Vadim Yanitskiy 4a108f3a89 llc: separate enum osmo_gprs_llc_primitive to llc_prim.h
Change-Id: Ida9ce56f48474313064d798ea7b9a72e9b99bb8d
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 c892acda1f llc: re-define value-string API as static inline functions
Using static inline functions allows for type checking at compile-time.

Change-Id: I1b3245f62f5182aa91dbad7958d89220f7107337
Fixes: I6d0e1a878fb80c57a901da08798620a6ea4471a4
2022-09-22 01:00:37 +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 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 8ab2897836 llc: add missing LLE <-> (RLC/MAC,BSSGP) primitives
3GPP TS 44.064, section 7.1.2, Table 7: "LLC layer service primitives".

Change-Id: I10bb63220585424584185ce2bde2d9f8fd0d8342
2022-09-18 20:45:44 +07:00
Vadim Yanitskiy d622de8362 llc: add missing LLGMM primitive types
From 3GPP TS 44.064 version 16.0.0 (2020-08) Release 16.

Change-Id: I85d3403f26ed1d80453affb7e01803402ccd7937
2022-09-18 20:45:44 +07:00
Vadim Yanitskiy 4566897df8 llc: enum osmo_gprs_llc_primitive: drop Req/Ind/Rsp/Cnf
The libosmocore's prim API offers 'enum osmo_prim_operation', which
contains all required primitive operations: Req/Ind/Rsp/Cnf.  Having
LLC primitive types discriminated by operation is redundant.

Change-Id: Ifa7512d0f6c7d3577358fd1449707315ba55894d
2022-09-18 20:45:44 +07:00
Vadim Yanitskiy 2f1755face llc: enum osmo_gprs_llc_sapi: fix spec reference
The actual SAPI values are given in section 6.2.3, table 2.

Change-Id: I84de7718e12b6b55a1735da148d7f8b0dacb72df
2022-09-18 20:45:44 +07:00
Vadim Yanitskiy 609e7b4cd4 llc: ensure all symbols have 'osmo_gprs_llc_' prefix
Change-Id: I569d8023d701bd14ee78baa9394b6983d9cafca8
2022-09-18 20:45:42 +07:00
Vadim Yanitskiy efef180c86 llc: check-in basic LLC definitions from osmo-sgsn.git
osmo-sgsn.git fb6cf3221ef4989441c09a650011e4a334c37d12

Change-Id: I6ed0f4820b3a12a00be71ce63757765551743101
2022-09-18 20:25:36 +07:00
Vadim Yanitskiy 2639b78795 Initial libosmo-gprs-llc library skeleton
Change-Id: Ia537acc6f4e6ab576dc7959d427b80f62c474296
2022-09-02 00:58:05 +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 8e3f0fd84a rlcmac: make logging category configurable
Change-Id: Icfef6de126304da81120f1d7b212992ead3409aa
2022-08-24 20:56:17 +07:00
Vadim Yanitskiy 6f5f26d4f1 rlcmac: fix using incomplete type 'struct value_string'
Change-Id: I6f261c0e57a8d341f6e613a2845a6f2cb52d3830
2022-08-22 20:57:01 +07:00
Vadim Yanitskiy c831aa477a csn1: add CSN_DESCR_EXTERN for extern declarations
Change-Id: Ieb721c97c8e9acee5057bb04be73f27b2871687b
2022-08-22 20:56:57 +07:00
Vadim Yanitskiy 8f7941e5e5 csn1: cosmetic: coding style improvements for #defines
Change-Id: Ia00809aa95b91006149d62abbeda9493b5a64728
2022-08-22 06:00:47 +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 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 2f6b575c75 rlcmac: use #pragma once in gprs_rlcmac.h
Change-Id: I2a6f53e62aa09da8daa147499901008bf2d4b881
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 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 a92f3b946a csn1: use #pragma once in csn1.h
Change-Id: Ieb739a1166d297336705ec693668c9d49506089c
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