Commit Graph

55 Commits

Author SHA1 Message Date
Pau Espin b4a6069f82 gmm: Several fixes for radio_prio
The "Radio Priority" received in GMM Attach Accept are for SMS and TOM8
SAPs only. For GMM/SM unitdata transferred to LLC, use highest
radio_prio=1.

Change-Id: Ie583c433547fb5ecbb6b6077c39a157961f73cfc
2023-07-31 14:37:34 +02:00
Pau Espin 70c6407f69 gmm: Introduce GMMSM-Modify.ind primitive
TS 24.007 and TS 24.008 seem to lack providing an explicit way to pass
information between GMM and SM (GMMSM interface) when a RAU process
happens in GMM (rx RAU Accept).

This lack of primitive can easily be spotted by looking at TS 24.007
Appending C.15, or even better, at the 3rd page of "C.16(cont’d)" around
the "STOP Trams" timer, where the info is magically available in SM when
being received at GMM.

Change-Id: I81e207d44d88f18f0ee13fb413827606a6f830bc
2023-07-19 19:02:27 +02:00
Pau Espin a8f90e5bc1 gmm: Document spec ref regarding Receive N-PDU Numbers IE in RAU Compl
Change-Id: I8b4c5a6c4c4da3648160aa32f7586c74942c7734
2023-07-19 18:58:23 +02:00
Pau Espin f31984ba35 gmm: Store received PDP Ctx Status and List of Receive N-PDU Numbers
Those IEs are aimed at upper layers (SM, SNDCP) and will be relayed in
follow-up patches.

Change-Id: I3a43b5e0417796f7dce4010cd6a6d3fd2d9c543e
2023-07-18 18:03:42 +02:00
Pau Espin 34f4b94a98 gmm: Make OSMO_GPRS_GMM_TLLI_UNASSIGNED def publicly available
This can be used for users receiving the GMMRR_ASSIGN_REQ primitive to
find out if it's a creation, update or deletion of a TLLI.

Change-Id: I881b1370b283ceee98c035ed42b91f7e12611979
2023-07-18 11:31:20 +02:00
Pau Espin 4c9ea11604 cosmetic: gmm: Fix typo in comment
Change-Id: I9c32def9571294abe2e67235a50809839ed5966a
2023-07-17 12:12:48 +02:00
Pau Espin f60efde896 gmm: Accept event LOW_LVL_FAIL in RAU/SR_INITIATED states
This even is triggered by the GSM itself due to internal timeouts as a
consequence of lower layers not resolving the request (with accept or
reject events).

Change-Id: Ic1072629595e75c411b421e71f6ffac5dd41da3b
2023-07-05 13:49:20 +02:00
Pau Espin fd397fe215 gmm: Avoid submitting GMMSM-Release.ind if no session was requested
Change-Id: I2fecfd122fc4be863be184f1ff08d9a31e07b956
2023-05-31 14:47:56 +02:00
Pau Espin d2fd394e4d gmm: Implement rx RAU Reject
Change-Id: I0d4d8288b78cfd3140c786a52a3906eaf37ebe6b
2023-05-29 16:22:13 +02:00
Pau Espin b182b7c26d gmm: Fix typo checking IE presence in Rx Attach Rej
Change-Id: Ifaf653d89efd4ff4776e0e9b9e8dff625c4f9ebb
2023-05-29 16:22:13 +02:00
Pau Espin 5e083ed3b9 gmm: Initial implementation of T3166, rx Auth & Ciph Reject
As specified in 3GPP TS 24.008 Table 11.3/3.

Change-Id: I2c24b968e90cf5ec71fa8a777ec57b407eec015f
2023-05-29 16:22:13 +02:00
Pau Espin 120401f60d gmm: Tx Auth & Ciph Failure
Change-Id: I3ebb3dba20010e57f29dd5b8bbec457c2b08a8e1
2023-05-29 16:22:13 +02:00
Pau Espin cd5810291e gmm: Rename s/ciph_auth/auth_ciph/
The procedure is called "Authentication and ciphering", not the other
way around.

Change-Id: I02c7edede8db8dbe94e129529ad8fb03fe1b4089
2023-05-29 16:22:13 +02:00
Pau Espin 1576144542 gmm: Initial implementation of rx GMM Information msg
Basic implementation of gprs_gmm_decode_network_name() was cherry-picked
from osmocom-bb 2dfa84e73dca455900e6522f61f5c610077783b7
decode_network_name().

Change-Id: I9b81f8f9113a95cc75666dac5ff9e315d0845fcb
2023-05-29 16:22:13 +02:00
Pau Espin 770ed7fc24 gmm: Implement rx GMM STATUS msg
Change-Id: I46719a3bf6d5e93e25f41f01f5c2ab889ff62803
2023-05-29 16:22:10 +02:00
Pau Espin 42f51083f5 gmm: Implement submitting GMMSM-RELEASE.ind when MS becomes detached
Change-Id: I74176eba870b19b30666ab5deef5eb56f0f0fd83
2023-05-29 11:35:35 +02:00
Pau Espin 7638cb7e7b gmm: Stop READY timer upon receiving force_stdby IE
Change-Id: I44d0f69571f6425fef74a10602001aca4ecb5716
2023-05-29 11:35:35 +02:00
Pau Espin 489499caa9 gmm: Implement P-TMSI Reallocation Cmd/Compl
Change-Id: I1bf8bf5f4299db7b026fed2e2c21c07f15690942
2023-05-29 11:35:32 +02:00
Pau Espin 7bbdcc4414 gmm: Provide rlcmac with IMSI & PTMSI information
This information will be needed once the GRR layer starts listening for
paging requests, which identify MS by either PTMSI or IMSI.

Change-Id: I3a0c4a57c3d624c3ebb40ae2cc0c96626ccc2c99
2023-05-25 16:07:26 +02:00
Pau Espin c9f5abdbff gmm: Implement GMMR-PAGE.ind
Submit an LLGM-TRIGGER.req as described in TS 24.007 C.13.

Change-Id: Iba77b4a5280ce08f099f4e15934fa92d4ba8ba10
2023-05-25 15:48:44 +02:00
Pau Espin 409bb636d9 Fix typo llgm -> llgmm everywhere
Change-Id: Ic9cd63a6086526efdbd9184729bfae4b1cea56c1
2023-05-25 15:26:59 +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 05b127acbb gmm: Initial implementation of T3312
The RAU procedure triggered by T3312 expiration will be implemented
in a follow-up patch.

Change-Id: If1ca164b7a6c7f7750e2e2f0812d6fde828ed4a4
2023-05-22 18:46:46 +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 1947a84469 gmm: Provide RAI obtained from network
MS needs to store this information, hence the app needs to be provided
with it.

Change-Id: Ifdc4d0ccb8bb5ad145cd749bc83df202e91627a3
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
Vadim Yanitskiy a57e7293df copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH
Change-Id: I1235050daa0a7e6bb82a7bdcefeac4360dcaa188
2023-05-18 17:22:26 +07:00
Pau Espin ed7c99f6ba grr,bssgp,llc,sndcp: Define qos_params
3GPP TS 44.064 loosely defines "QoS params" on each primitive by listing
the fields, which are a bit different on each primitive.

Change-Id: I6760bace69d400edd4576ec2820e29b74f8dfca5
2023-05-05 18:38:19 +02:00
Pau Espin 6979b511fb gmm: Provide allocated PTMSI & TLLI to upper layers
Upper layers (SM or app) may need access to PTMSI or TLLI.

PTMSI:
- App may want to store it somewhere in order to reuse it next time
   it wants to GMM Attach.
TLLI:
- App will need the TLLI to identify the MS when sending/receiving
  primitives over SN SAP (app<->SNDCP).
- SM layer will need the TLLI to communicate over SNSM SAP (SM<->SNDCP),
  as well as relay the information to the app if the GMM Attach happens
  implicitly over SMREG-Act_Pdp_Ctx.req -> GMMSM-Establish-Req.

Change-Id: I552c43c55409773e2d13b72cba45a866165f203f
2023-05-05 14:40:30 +02:00
Pau Espin f9f7bd31c3 gmm: Fix false positive compilation error with gcc 13.1.1
Newer gcc errors about "cause" being uninitialized, but cause is
guaranteed to be set in the "case GPRS_GMM_MS_EV_LOW_LVL_FAIL" path, it
just fails to find out.

Since the approach used previously is a bit hacky, let's simplify it.

Change-Id: I1c96b0aa92d4f9205a1d4d1760c787fe0e0ed169
2023-05-04 16:12:37 +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 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 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 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 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
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 0bd994ee70 gmm: Free allocated GMMEs when freeing main context
Change-Id: I092b2d133467d1c2dcb8dfe5def99d49807b6273
2023-03-29 18:36:53 +02:00