Commit Graph

283 Commits

Author SHA1 Message Date
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 2d121dcdb1 rlcmac: Introduce L1CTL-CCCH_READY.ind primitive
This is used by lower layer L1CTL to notify the upper layer RLCMAC when
it's prepared to use CCCH.

Change-Id: I4cfb1e2db217a97b7a1dc8849cd13d58e4034c56
2023-07-18 11:31:05 +02:00
Pau Espin 4c9ea11604 cosmetic: gmm: Fix typo in comment
Change-Id: I9c32def9571294abe2e67235a50809839ed5966a
2023-07-17 12:12:48 +02:00
Pau Espin 7d3f3ad57e cosmetic: gmm: fix spec reference format
Change-Id: Id4b52b6110fc8012d5d3b4d341b9702e3142c334
2023-07-14 16:09:33 +02:00
Vadim Yanitskiy fc2228e050 doc: add PDCH timing diagram illustrating UL/DL delay
Change-Id: I7d01c833b6b746d74e6ecd8c65c929a320a95d17
2023-07-11 18:36:07 +07: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 cabca87921 rlcmac: tbf_dl: Implement T3192
Related: OS#5500
Change-Id: I49c9068d1819d6189103908f6f92ce05952b74e6
2023-07-05 13:49:20 +02:00
Pau Espin 5dc23ea408 rlcmac: tbf_dl: Implement T3190
Related: OS#5500
Change-Id: I3f69fde298dcd64d30b9d648a96717a8378864c4
2023-07-05 13:49:20 +02:00
Pau Espin 1026e0a417 rlcmac: defer going to pkt_idle_timer after freeing TBF
Give some time to pending tx blocks to be transmitted before jumping
back to CCCH.

Change-Id: I563ad2ee6aacd65314e998626dc27adc29221a7d
2023-07-05 13:49:13 +02:00
Pau Espin 806426525d rlcmac: tbf_ul: Move to packet-idle state when T3164 triggers
TS 44.018 3.5.2.1.4:
"The one phase packet access procedure is completed at a successful
contention resolution. The mobile station has entered the packet transfer
mode. Timer T3141 is stopped on the network side. Timer T3164 is stopped
on the mobile station side."

Change-Id: Ic7420a42e2e81effdde587d7e49acd66b404354c
2023-07-04 14:29:25 +02:00
Pau Espin 2f47cf4edb rlcmac: Rework tbf destructor to signal free() to its gre object
This will be needed in follow-up patches for the MS to trigger actions
when TBFs are freed (like going back to IDLE mode, or start
packet-access-procedure).

Change-Id: I72959e27f2f62c84218d740cfb9e396d70562929
2023-07-04 14:13:02 +02:00
Vadim Yanitskiy f77d343966 rlcmac: add OSMO_GPRS_RLCMAC_L1CTL_PDCH_{ESTABLISH,RELEASE}.req
* Send the PDCH_ESTABLISH.req on receipt of RR IMM ASS,
* Sending of PDCH_RELEASE.req is to be implemented.

Change-Id: I2568c58646ce7511367275ac96cd55e7fdd7ec18
Related: OS#5500
2023-07-04 14:13:02 +02:00
Pau Espin 3406697bcf rlcmac: tbf_dl: Fix typo in event name
Change-Id: I089d8e5f0a3e8946cc78a0e9645a8d040aa7dddf
2023-07-04 14:12:49 +02:00
Pau Espin b96ceaa9e3 rlcmac: tbf_fsl_fsm: Expect ev LAST_DL_DATA_RECVD in state FINISHED
Change-Id: Iff581e53cdbf9057b65c478f7ce9f3387c4a1646
2023-07-04 13:19:28 +02:00
Pau Espin 93290a2470 rlcmac: BS_CV_MAX=0 should be interpreted as =1 when calculating N3104_MAX
In the test more PDUs are submited in LLC in order to avoid trigger
max_retrans=4 for last block, which would trigger beforehand in that
case.

Change-Id: Ia83173afdbb25df18c7cead7857fe1b39a1ce82f
2023-06-21 11:55:56 +02:00
Pau Espin 1e1675091c rlcmac: Submit UL block to lower layers before freeing TBF
Change-Id: I236a5fd0e97b0b323153a4b6cf95b785348cf7df
2023-06-06 14:23:27 +02:00
Pau Espin ad51d7797c rlcmac: tbf_ul: Handle SBA from CCCH Imm Ass
Change-Id: I8563b6d61b93d86c15282995352ca9312e167160
2023-06-06 12:54:53 +02:00
Pau Espin 90a46d1d2a rlcmac: Implement UL TBF Countdown procedure
The Countdown procedure (decreasing CV field in UL RLCMAC data blocks)
is defined in TS 44.060 9.3.1.

It is implemented by means of counting/calculating the amount of RLC/MAC
blocks to be transmitted based on the LLC frames in the several LLC
queues, without actually generating the RLC/MAC blocks. The blocks
cannot be generated ahead of time because that wouldn't allow recreating
them in case Tx UL CS changes, or if a higher priority LLC frames
arrives.
The functions calculating the required amount of RLC/MAC blocks are
coded so that they early return to avoid spending more time than
necessary counting blocks (< BS_CV_MAX).
An extra heuristic optimization to be used when LLC queues are long is left
documented as a TODO, in order to test further the general non-optimized
path for now. Once the counting is proved to work reliably, that and
other heuristic optimizations ca be implemented, like keeping and
decreasing CV cached counter while no Tx CS change occurs or no new LLC
frames are enqueued.

Change-Id: If043c86a0c2b89d0ac0b8174de39fbcb22bed8cb
2023-06-06 12:54:38 +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 7b9654c4d0 sm: Handle GMMSM-Release.ind
Change-Id: Ia2ac9dbffe29c3509f1088ceb327569a331ec598
2023-05-31 14:47:56 +02:00
Pau Espin 4c225a7912 rlcmac: Avoid generating UL data if no data to be sent available
Dummy LLC commands only make sense in the network->MS direction, in
order to delay closing the DL TBF (3GPP TS 44.064 6.4.2.2). That code in
the MS is a leftover from porting code from osmo-pcu.

Change-Id: I062aa9aea4f7d66a70ed53eae1c67780ddc3dca5
2023-05-29 16:22:13 +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 16ed7760f1 rlcmac: P1,P2 Rest Octets: Add missing final padding to definitions
Change-Id: I26f1405bd99a7c1aba0782a25e22a69943493a69
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 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 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 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 73bc3768d9 rlcmac: Fix TFI not assigned during UL TBF CCCH ImmAss
Change-Id: Ieda67c27e2cfd75922efa9613cafce7adb639e5c
2023-05-22 08:42:47 +00: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