Commit Graph

223 Commits

Author SHA1 Message Date
Pau Espin 1352cae927 sndcp: Allow cb users taking ownership of primitives
Change-Id: Ie3ddc835d8393e934d3f357108c81f639247c485
2023-05-03 14:44:11 +02:00
Pau Espin dbb588df52 llc: use GRR instead of BSSGP to tx XID.req in MS mode
Change-Id: Ib2ada2cc7160202f9da5b177da8263076e1eef69
2023-05-03 13:18:41 +02:00
Pau Espin d06e29bc9d sm: Avoid freeing the SME object too quickly
At that point in time we may still need it, for instance to send the
primitive to the upper layers. Still, we want it to be t the correct
state when that happens. Hence, delay freeing the object to happen in
next loop iteration, so that it is still available to submit the
primitive, and even skip freeing the object if the SM SAP user decides
to re-activate the PDP context in a synchronous code path from the
primitive callback.

Change-Id: I28655fc6286c92403e3e461cb6433b8567e20fd1
2023-05-03 12:26:43 +02:00
Pau Espin e23c097a5c sm: Implement rx Act PDP Ctx Rej
Change-Id: Ib534ebc2a3a0674675621da2f8bd0de218a08ef0
2023-05-03 12:26:43 +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 644780008d gmm: Rework sess_id to identify one GMME
The GMM layer doesn't really have to differentiate between SM
connections, everything is sent over the LLC "GMM" SAPI.
However, we still want to identify/related a given MS if there are
multiple MS using the stack.

Change-Id: Ib757f016824d918ce8b74ae0c2a652a6c1823556
2023-05-02 20:01:44 +02:00
Pau Espin ca7d0a9527 gmm: Fix typo in param name passed to logging macro
Change-Id: Ib8025f29ddd9916907e14becaadad66336306e8a
2023-05-02 19:48:49 +02:00
Pau Espin 01875bc060 gmm: Directly confirm GMMSM-Establish.req if already attached
Change-Id: I6d1e73888dc1e1e1e5ca0860d839dee24de89a0f
2023-05-02 18:24:18 +02:00
Pau Espin d25e9bce80 gmm: Switch state before announcing events to user
Update the state in the FSM before triggering paths implemented by the
user which may also again interact with the FSM. If the state is not
updated earlier, then the new interactions may encounter the FSM in an
unexpected state with regards to the event received.

Change-Id: I10eb23f6db5ff3b0b90f9066aa4fa44c8cb85170
2023-05-02 18:09:21 +02:00
Pau Espin c8cf2e8adf llc: Fix N(U) wrongly reset during LLGM-ASSIGN.req
Change-Id: Ifd6d59703cc2d267fc37595a1ad47e326ebd2a30
2023-05-02 17:00:33 +02:00
Pau Espin 8ea5b7146f llc: Log received wrong FCS field
Change-Id: I448680ee82fca226df4d33650537167b2e496e24
2023-05-02 13:58:18 +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
Pau Espin 101c3d5da0 sm: Fill gmmsm.establish_req.attach_with_imsi
Change-Id: Ie4fbadc1c3a32375ccae84a4d54366d59ab7fe2f
2023-04-26 11:30:11 +00:00
Oliver Smith 7cb7ab6358 debian: set compat level to 10
Related: OS#5958
Change-Id: Icfdbea7cbe4681cd3b286471032fd6dd7226888f
2023-04-26 11:13:24 +00:00
Pau Espin 0eb8152aa1 sm: Fix potential null access due to missing check
Change-Id: I15532898f00c62cb2a63973decb401e929517cb3
2023-04-25 17:17:10 +02:00
Pau Espin d4858baf35 sm: Destroy PDP Context if activation fails
There's no use in keeping them in inactive state.
This allows upper layers recreating them upon next SMREG-PDP_ACT.req.

Change-Id: Ic9f9ae3becb0c26a55a3b08959a00a7df0bdb5b2
2023-04-25 17:15:24 +02:00
Pau Espin 128c382a3a gmm: Allow cb callers to take ownsership of msgb primitive
Change-Id: Ic60e73d8ba13681217bcb35e4b66cc565239cfd2
2023-04-25 16:46:42 +02:00
Pau Espin dbe3406566 gmm: Fix typo triggering assert on T3310 timeout
Change-Id: Iee803dcfa9e629852aac6246b403e7614245a0b9
2023-04-25 14:35:17 +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 0b603f41cf sm: Handle PCO in rx PDP Ctx Accept
Related: OS#5501
Change-Id: I15ff08cbefb463c8785a138406921563941e7e7d
2023-04-14 18:46:16 +02:00
Pau Espin ae5856f4e3 sm: Handle radio_prio,qos,llc_sapi in rx PDP Ctx Accept
Related: OS#5501
Change-Id: Icbd9ba82b6d8cbcfcaf5a80ddc801139c409c585
2023-04-14 18:39:29 +02:00
Pau Espin f644ae9d11 sm: Parse PDP address in rx PDP Ctx Accept
Related: OS#5501
Change-Id: Ic41edc14445f0f5d4ef20bb30b53d66fb56435de
2023-04-14 18:39:29 +02: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 70720ccb69 sndcp: Allocate snme->comp.{data,proto} during snme alloc
This way we guarantee the llist object is always available even before
an XID.req is received (which may not be the case in NET mode).

Change-Id: Ib9540cc62a61ad7cb26ae90ec1500f1a022bada5
2023-04-14 16:24:01 +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 e10eb80f7b sndcp: Fix potential null ptr access if SNE not found
Change-Id: Ie04ec971680ea2aaa905539fafc936af8f14e9f5
2023-04-14 16:24:01 +02:00
Pau Espin 9c04466d9b sm: Fix typo in LOGMS macro
Change-Id: I954fcd03ba2c24cebbd8e92c309e490afae14613
2023-04-13 18:49:29 +02:00
Pau Espin 67a57b5272 Rename internal g_ctx -> g_{layer_name}_ctx
Otherwise if a test includes {layer_name}_private.h from several
libraries to use private APIs it will fail due to colliding g_ctx
pointers of different types.

Change-Id: Ib8a844551452b79bdb3a81968ffc1fd42ee1c5d9
2023-04-13 18:20:53 +02:00
Pau Espin 9ed5ad88ec gmm: Implement rx Attach Reject
Relaed: OS#5501
Depends: libosmogore.git Change-Id I2d36d76ee6fe8ed1a36e37a7d74fbbdc9c27c2c7
Change-Id: Id4ad73ea25a380db9692892422e76ba44084649c
2023-04-13 14:21:56 +02:00
Pau Espin 508871730d gmm: Implement T3310 (Tattach)
Related: OS#5501
Change-Id: I0ba24820f63c44b6dc7568e86fc36965a042d613
2023-04-13 12:56:34 +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 e8b8fb1b60 llc: Free allocated LLMEs when freeing main context
Change-Id: Ifb51a956d5a41f01184db4d453c64128db439f7c
2023-03-29 18:39:39 +02:00
Pau Espin 0bd994ee70 gmm: Free allocated GMMEs when freeing main context
Change-Id: I092b2d133467d1c2dcb8dfe5def99d49807b6273
2023-03-29 18:36:53 +02:00
Pau Espin 1b2ff8be92 gmm: Free ms_fsm when freeing gmme
Change-Id: I0f2dd55bf0241a37a06e2ea438ca6ac2418eb7b8
2023-03-29 18:34:05 +02:00
Pau Espin 5295c462c0 gmm: Several fixes to GMMSM prim alloc functions
Change-Id: Ie49cb448806101a24c58a85f7073e13baccada5b
2023-03-29 18:07:01 +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 7cdeab1b46 rlcmac: gprs_rlcmac_tbf_free():Call proper free function for DL TBF
Change-Id: I65c37dd4ea20f039680e0927722b332d1140e62e
2023-03-29 16:39:48 +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