Commit Graph

130 Commits

Author SHA1 Message Date
Pau Espin 9cf485e45b rlcmac: Submit GMMRR-PAGE.ind upon rx of Paging Request Type 1/2
Change-Id: I64db4277b5c54870a258d63c554f470011bcc989
2023-05-25 16:46:05 +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 8700df25d7 llc: Implement LLGM-TRIGGER.req
Change-Id: Id1af5912f407fe055a59a4bb217936307697975f
2023-05-25 15:28:31 +02:00
Pau Espin 409bb636d9 Fix typo llgm -> llgmm everywhere
Change-Id: Ic9cd63a6086526efdbd9184729bfae4b1cea56c1
2023-05-25 15:26:59 +02:00
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 72ea2cf2fc llc: Add APIs to submit LLGM-trigger/suspend/resume.req primitives
This commit also adds an initial implementation of
LLGM-suspend/resume.req.

Change-Id: I890c7a4ace6fb8ca362ec41bd18e9c229191a587
2023-05-23 16:43:15 +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 7d7040976f sm: Forward forth and back the P-TMSI signature
Change-Id: Ia69b6f885d612c42ab015822031e4c7262f4714e
2023-05-22 10:43:28 +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 824d00f9e7 sm: Provide RAI obtained from network
MS needs to store this information, hence the app needs to be provided
with it.

Change-Id: Icd357d8c7f4848441da011d59a4e520785d64779
2023-05-22 08:42:47 +00: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 c57f5d70c4 sm: Allow passing old RAI during attach
This is stored by the MS and hence shall be passed by the application.

Change-Id: I13118bed3f7035ff9b4c2c21ed9557f48f5596e6
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 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 4c2f0ced47 sm: Use & forward to upper layers the PTMSI & TLLI received from GMM
App and SM itself 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: I7b1b8ac414474652b438f15b7f07961032a0f56d
2023-05-05 14:44:58 +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 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 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 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
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
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 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 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 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
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
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 e0ec0a3fcc rlcmac: Move create_pkt_ctrl_ack() to tbf base class
The code to generate a PKT CTRL ACK is the same for a DL TBF and an UL
TBF.
Move it to the generic base class in order to be able to generate it for
a DL TBF in a follow up patch.

Change-Id: I767696b445842ebc32b35c320273b13f63076ca4
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