Commit Graph

93 Commits

Author SHA1 Message Date
Pau Espin 2a50ef7b07 rlcmac: Add APIs to decode P1/P2 Rest Octets
Change-Id: I59c6723d969880a4481e3b86a172d59f0edeb1e4
2023-05-25 15:10:19 +02:00
Pau Espin 5d8283f31b gmm: Implement periodic RAU procedure
Related: OS#5501
Change-Id: Ie7cba8a2fe3b97bebc558c957cc1bcbe3cc81dbc
2023-05-23 16:53:25 +02:00
Pau Espin a2fe6f302a gmm: Initial implementation of READY timer
Change-Id: I451ce08d80fb247c28819de065136e2e4d49f3f5
2023-05-22 17:45:01 +02:00
Pau Espin c6e7a3bd88 gmm: Introduce APIs & unit test to enc/dec GPRS Timer IE
enc/dec implementation and unit test are imported from osmo-sgsn.git
b83aabaa95695c61a64e5e990944f8e55934a976.

Change-Id: Ia3b903e8bc7890489390dcc5b2d4b60efd55dc2c
2023-05-22 13:42:12 +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 104562737c gmm: Forward forth and back the P-TMSI signature
Change-Id: Ibf12589e7d3029f80b4ced99992155deb9dba036
2023-05-22 10:43:28 +02:00
Pau Espin 73bc3768d9 rlcmac: Fix TFI not assigned during UL TBF CCCH ImmAss
Change-Id: Ieda67c27e2cfd75922efa9613cafce7adb639e5c
2023-05-22 08:42:47 +00:00
Pau Espin 1d1b704dca gmm: Allow passing old RAI during attach
This is stored by the MS and hence shall be passed by the application.

Change-Id: I22ffa8a169c09445e7126892616f61b8d01cbfe7
2023-05-22 08:42:47 +00:00
Pau Espin 1ccc5e384b sm: Fix APN IE content not transmitted in Act PDP Ctx Req
Change-Id: I70be2ff5e7e0fea5e93d7b9963064c38a0382f30
2023-05-05 19:27:14 +02:00
Pau Espin a76164cd6e tests/gmm: Avoid printing rej_cause if GMMSM-Establish.cnf outcome is accepted
Otherwise it prints memory regions not really filled in.

Change-Id: I9c46e5a42e6b002f51ab19bc5d85b7bdd7da2a4f
2023-05-05 14:39:00 +02:00
Pau Espin 028380ddbb sndcp: Initiate LL-XID.req only if we have something to send at L3
Change-Id: I324d841ae4d725d55d2807067cdd56c4457fa941
2023-05-03 14:44:15 +02:00
Pau Espin ab92a12c0a sm: Fix encoding of dynamic IP address in PDPActCtxReq
Change-Id: I2d830604d9d9a3f6939926ab67967d5527fdf5c3
2023-05-03 12:26:40 +02:00
Pau Espin 226c2a140c gmm: Implement GMMSM-UNITDATA.ind
Change-Id: Ib1ac220292c61419a65f27fa88a731357728459d
2023-05-03 11:17:36 +02:00
Pau Espin 0db37aa9cf gmm: Introduce SIM_AUTH primitive to resolve authentication
New GMM-GMMREG-SIM_AUTH.ind/rsp primitives are added to allow GMM
resolving authentication request received from the network.
The user of the GMMREG SAP is responible for doing the resolution using
its SIM.

Depends: libosmocore.git Change-Id Id619459c17976b77cd2c7e4179123bb06807285c
Change-Id: I5c97642baac5ed29de63ae93fc7f0ecde5edf735
2023-04-28 19:01:30 +02:00
Pau Espin 088e4d6cbb gmm: Increase log level of Rx msg log lines
Change-Id: I461d6815ec42e5f77ee5d6e4d307011c566b61f0
2023-04-27 14:28:25 +02:00
Pau Espin 1f9da70942 gmm: Print IMSI and TLLI in LOGGMME macro
Change-Id: I34145eb83c1678bcf1b32ae6cbf3e4b01c717406
2023-04-27 14:28: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 a7760cfba0 gmm: Provide allocated P-TMSI in GMMREG-ATTACH.cnf
This allows the upper layers to find out the P-TMSI allocated by the
network.

Change-Id: I95000ccfb9b4d24804ce916976d26aec8e51c749
2023-04-26 12:19:54 +00:00
Pau Espin 0dd7d3c980 gmm: Append 'P-TMSI type' IE to GPRS Attach Req when needed
Depends: libosmocore.git Change-Id Ief4e03785f01f07c8d97b33bbb55c89a863baccc
Change-Id: I79d8f2dae356fc25467553955f43fffb2661ab47
2023-04-26 13:38:57 +02:00
Vadim Yanitskiy 3e3fe6bbf5 rlcmac: cfg_ul_tbf_req: indicate USF for each active timeslot
According to 3GPP TS 45.002, section 6.3.2.2.1, in the case of multi-
slot Uplink TBF allocation, a USF (Uplink State Flag) is given for
each PDCH allocated to the MS.  Thus we need to indicate a USF value
for each PDCH to the lower layers: add ul_usf[8] to cfg_ul_tbf_req.

According to 3GPP TS 44.060, section 5.2.2, in the case of multi-slot
Downlink TBF allocation, a DL TFI (Temporary Flow Identity) given to
the MS is not limited to the scope of a single PDCH and applies to
all timeslots allocated.  We're already doing this fine.

Change-Id: I1dda0b4eedcaca7e93f832fc875507028c3ff3eb
Related: OS#5500
2023-04-24 18:27:54 +07:00
Vadim Yanitskiy 08f243e116 rlcmac: fix typo in TBF CFG logging messages
Change-Id: I46bcbdb35ee52575e778464b93a8a3b21b8f465b
Related: OS#5500
2023-04-24 18:26:23 +07:00
Vadim Yanitskiy b4a3b4ff94 rlcmac: fix st_new_on_enter(): actually release the TBF
The comment above the invocation of configure_ul_tbf() suggests that
the lower layers need to be notified about the *release* of a tbf_nr.

Change-Id: Iabfe9c7ee23335d6eae8017071651b78a36079bf
Related: OS#5500
2023-04-24 18:25:49 +07:00
Pau Espin ae90ee8b71 sndcp: Test MS vs NET paths separately and implement missing prims for MS
Related: OS#5502
Change-Id: Iebce37a50917b13c23de1528469d66c310ced7f2
2023-04-14 18:39:29 +02:00
Pau Espin dd17a692f9 sm: Start using SNSM SAP
Related: OS#5501
Change-Id: Ic5525bfa92e2591757d999610c0d59849d022d8d
2023-04-14 18:39:29 +02:00
Pau Espin aa1102494f sm: Fix swapped endianness in struct gprs_sm_pdp_addr
Change-Id: Icd72bbe6d297bc583097c68d3cf86a616fabd36d
2023-04-14 18:38:12 +02:00
Pau Espin e6e5dea4a5 llc: Implement some parts of LL-ESTABLISH.req/cnf
As seen in TS 23.007 C.6.
We still don't need/want to implement ABM (acknowledged mode), hence
only the interface related parts are implemented, and transmit of SABM
message is left for the future.

Change-Id: I27aff368f4a70d30c23523946d72a751e100f298
2023-04-14 16:24:33 +02:00
Pau Espin d81d675c73 tests/sndcp: Fix incorrect check comparing against wrong SAPI
Change-Id: I03e75d290efdd682e6d2705921c76708a3bffef5
2023-04-14 16:24:01 +02:00
Pau Espin 63ac570f05 Fix typo LLGM -> LLGMM
The interface name is LLGMM, as presented in TS 44.06 7.1.0 and TS
24.007

Change-Id: I59577d27bedd26903c9b1bfc64792f0891cea728
2023-03-30 14:16:29 +02:00
Pau Espin 5e205c8375 Introduce libosmo-gprs-sm
This patch itnroduces all the boilerplate required to build and package
a new libosmo-gprs-sm.so library, which aims to contain the SM layer
implementation.
A minimal implementation is provided together with a unit test,
showcasing Activation of a PDP Context and requesting implicit GPRS
attach to GMM if it is not yet attached.
This commit also adds/improves code in GMM layer implementing the GMMSM
SAP which is used to interact SM<->GMM.

Related: OS#5501
Change-Id: I9b4a9a6364f7799540475e7e1d10ab2310768281
2023-03-30 13:49:29 +02:00
Pau Espin 1da58d01cd rlcmac: Release UL_TBF L1CTL resources upon free
Change-Id: I4c98d5431a8409a6d428e96f9bfbb442bd75b24f
2023-03-29 17:49:07 +02:00
Pau Espin 0a9b9097e2 rlcmac: Fix DL_ASS polls removed when UL TBF released
The DL_TBF for the assignment is not created until later on when the
DL_TBF is first used, only the DL_ASS request is stored as part of the
gpre->tbf_dl_ass_fsm.
Since no DL_TBF existed, the POLL was being stored if the DL_ASS
referred the UL_TBF by means of GlobalTFI->ULTBF.
Instead, let's not require an UL_TBF to be present and simply pass the
GRE along which can be used to send the PKT_CTRL_ACK later on when the
scheduling the poll triggers.

Change-Id: Icdaa30e9ff942fb53cc4bbd801e4542b8885b32a
2023-03-29 14:39:19 +02:00
Pau Espin 7934a41252 gmm: Initial implementation of GPRS Detach
This patch contains further work on several areas for the GMM layer,
like fixes and improvements in existing primitives, initial FSM
implementation, initial Tx and Rx of some GMM messages, etc.

Related: OS#5501
Change-Id: If6cbb1d425b3a9f713348f1dea4747e2b6be0a44
2023-03-27 17:40:18 +02:00
Vadim Yanitskiy 7c5bef2c64 rlcmac: fix wrong MSGT_PACKET_{RESOURCE_REQUEST->DOWNLINK_ACK_NACK}
Change-Id: I3c475afc3f7cca42dcf9b1d90c2ac425d3158708
Related: OS#5500
2023-03-25 16:52:45 +07:00
Pau Espin 8a72adf9cb gmm: Initial implementation of GPRS Attach
This patch contains further work on several areas for the GMM layer,
like fixes and improvements in existing primitives, initial FSM
implementation, initial Tx and Rx of some GMM messages, etc.

Related: OS#5501
Change-Id: I212053b3a3f27ef7d63503c3d5ef08453b2d2056
2023-03-24 12:57:24 +01:00
Pau Espin 146643b0f3 Create skeleton for libosmo-gprs-gmm
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
2023-03-15 10:43:49 +01:00
Vadim Yanitskiy f829a685ad tests/llc: local libs must be first in *_LDADD
Otherwise the linker may pick system-installed libs instead.

Change-Id: If5299340ad72407d01e728febf356a07a1d99681
2023-03-14 14:26:22 +00:00
Vadim Yanitskiy 2ffa413b1e tests: move '-I$(top_srcdir)/include/' to AM_CPPFLAGS
The '-I' is a preprocessor flag, so it should be in AM_CPPFLAGS.

Change-Id: Ic3e3dc75789850d2884d3e757f05ff01e136a5f4
2023-03-13 10:46:01 +00:00
Pau Espin 9eb8ef1c3f rlcmac: Implement DL TBF CCCH & PACCH allocation with TBF Starting Time
Change-Id: Idafb4e37971e93c7e8667b8669a29755485e95bb
2023-03-09 10:25:37 +01:00
Pau Espin 8efb05eaca rlcmac: Log sched of PktCtrlAck requested by UL ASS poll
Change-Id: I81ac177d7abdcd49d2b231ae059ec859b433dd03
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 9a212cc2b6 rlcmac: dl_tbf: Improve logic requesting a new UL TBF
Change-Id: I702872ba32a410bb5f09943af3cdadca482562db
2023-03-06 07:59:03 +00:00
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 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