aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2023-07-31rlcmac: keep looking up GRE based on old TLLIPau Espin Pedrol4-1/+7
This is needed after RAU Update since the PCU may still be using the old TLLI to reference the MS for a while until it finds out about the TLLI update. Change-Id: I2653db3dac58342df02a1b4d0c76e69e0e8d583f
2023-07-31rlcmac: Fix OSMO_GPRS_RLCMAC_GMMRR_LLC_TRANSMITTED declared in wrong offsetPau Espin Pedrol1-1/+1
This enum should match osmo_gprs_gmm_gmmrr_prim_type, and I placed that osmocom-specific enum at the wrong place in the rlcmac counterpart. Change-Id: I3f198c756866417f8f975373f84fd3ec4da608fa
2023-07-31gmm: Several fixes for radio_prioPau Espin Pedrol3-12/+14
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-31llc: Fix potential null ptr dereference in LL-Xid.IndPau Espin Pedrol1-2/+7
Closes: Coverity CID#322365 Change-Id: Icc65af3ea9a44a5daf80e47717564f6adf37444b
2023-07-28rlcmac: Initial selection of packet-access-procedure mode based on ↵Pau Espin Pedrol3-1/+34
originating cause Change-Id: I930a1fcf23506f75562a6795f9a6e42b187d2974
2023-07-28rlcmac: Use enum gprs_rlcmac_radio_priority internally everywherePau Espin Pedrol8-40/+59
This simplifies the array handling in the LLC queue, and moves param checking to the rx rlcmac_prim path instead of deep in the llc_queue enqueuing code. This commit also fixes the RADIO_PRIORITY field in the Channel Request Description section of PKT DL ACK/NCK, since gprs_rlcmac_llc_queue_highest_radio_prio_pending() now returns the enum normalized 0..3 as expected by the field format (before it was returning 1..4). Change-Id: If2d1946522bc4a1c19d65acb23605f1a3f05ab45
2023-07-28sndcp: Forward QoS params from SM to LLCPau Espin Pedrol5-0/+56
Change-Id: I70e355ef27d24bdaf00e54f0e7126193f5bbf19f
2023-07-28sm: Introduce APIs to enc/dec QoS ProfilePau Espin Pedrol10-4/+475
Ported from open5gs.git/lib/gtp/v1/types.{c,h} 5764f7267d16a8ea6aeedc6c227552575915def5, for which I was the author too. The ARP extra byte field at the start of the IE val which is introduced in the GTP variant is dropped when porting to SM, since it's not present there (and offsets/sizes are adjusted). The QoS code is moved is moved into a common/ directory where a new libosmo-gprs-common.la private static library is created. This is done in order to be able to resuse the QoS dec/enc code in several libraries since it's actually planned to use it in SNDCP and SM layers. The most natural place to add the APIs is SM, and that's where the public API to accees the enc/dec is provided, since the user app will have to use them in the SM SAP. However, the SNDCP will also have to decode the QoS recived by SM through the SNSM SAP, and we don't really want libosmo-gprs-sndcp depend on libosmo-gprs-sm. This way libosmo-gprs-sndcp will be able to use the private APIs directly in a follow-up commit. Change-Id: I6c0676e55bb1f0f424f41d8d04d4f5e5bf376f4f
2023-07-28llc: Set proper Radio Priority when submitting GRR-UNITDATA.reqPau Espin Pedrol4-4/+11
Change-Id: I2ace165003469c2a43d7333634171896699d5a5d
2023-07-28sndcp: Use radio_prio assigned by SM when submitting LLC unitdata.reqPau Espin Pedrol3-8/+19
Change-Id: I632329bb1f34efb4d9263241e2cda5b559f1ff59
2023-07-28sm: Forward RadioPrio & QoS in SNSM-Activate.indPau Espin Pedrol1-2/+4
Change-Id: Ia8226f6e687f86b2502b27f9979dce13cf751c01
2023-07-28cosmetic: sm: Fix wrong reference in commentPau Espin Pedrol1-1/+1
Change-Id: I8828e0019f6446c3a17d09e8483573bf752c159f
2023-07-28sndcp: Initialize N201-U & N201-I to default settingsPau Espin Pedrol1-0/+20
LLC is only expected to signal new values if SNDCP XID params are received, or if the default N201 values change. Change-Id: I68f54d329b326895ed8f010cf50f20fa30948d30
2023-07-28llc: Set proper SAPI when transmitting UNITDATA.req to GRR/BSSGPPau Espin Pedrol1-2/+7
Change-Id: I962e25789849f89c532f5ede386fa029600d9901
2023-07-28sndcp: Update n201_u & n201_i indicatd by LLC layerPau Espin Pedrol3-6/+23
Change-Id: I7429701ae49c2a694dcad3e3d5ec639ab9927f5b
2023-07-28llc: Submit LL-XID-IND to L3 if N201-U or N201-I changesPau Espin Pedrol2-17/+31
Change-Id: I8135c5cef4df69a7c3a540050da0837bf2059df2
2023-07-26llc: Apply N201-I & N201-U requested by the networkPau Espin Pedrol5-1/+79
Change-Id: I2f2cb8b831266b8e4251c2832e6545bef776658c
2023-07-26llc: Introduce function to log XID fields and use upon Rx/TxPau Espin Pedrol4-0/+40
Change-Id: I8c6b07305c0bcecb4e1681967884a3e62c813592
2023-07-26llc: xid: Introduce some helper internal functions to make code easier to followPau Espin Pedrol2-11/+26
Take the chance to fix wrong indentation on related function parameter. Change-Id: I8c0163583efc2720a4b2675ce93293c184f80d0c
2023-07-24rlcmac: recalculate CV as needed when already in Countdown procedurePau Espin Pedrol3-16/+60
Getting out of contention resolution means we may have to update our calculated CV state because we are no longer sending TLLI. Same happens if a new tx CS is provided by the network, since different block size means different CV. In this commit only code paths for the state where already in Countdown Procedure are added. If TBF has to enter Countdown Procedure due the above mentioned changes, it will do so using regular path where a new RLC block is created. Related specs: TS 44.060 9.3.1 Related: OS#6018 Change-Id: I6ca88c005060ba1302d46717e45b0d9731d86d8d
2023-07-24rlcmac: Apply tx_cs requested by the network through PKT UL ACK/NACKPau Espin Pedrol2-1/+15
Recalculating CV when in Countdown Procedure will be implemented in a follow-up commit. Related: OS#6108 Change-Id: I1e7b28c2e5f1d77a962ec3070f3a027b8f66a69e
2023-07-24rlcmac: Avoid discard packets when in Countdown procedurePau Espin Pedrol3-4/+8
Discarding a packet through CoDel during Countdown procedure may end up in the transmitted CV=14..0 being incorrect, since we are not really yet recalculating them once we enter Countdown procedure. Hence, to make it simpler for now, avoid dropping packets when in Countdown procedure to avoid having to recalculate them. Change-Id: I311302b5282767dc806b1dfe053994f175390b69
2023-07-24rlcmac: ul_tbf: Move logic selecting proper queue to helper functionPau Espin Pedrol1-4/+13
This clarifies the logic behind selecting the proper queue, and it will be used further in the future, for instance when recalculating CV once already in Countdown procedure. Change-Id: Icceaf53048e9662176385b2976e2bc8e3387df71
2023-07-21rlcmac: Log LLC PDUs enqueued in llc_queuePau Espin Pedrol2-1/+17
This allows gathering more information on the state of the queue and helps in understanding possible bugs on the CV calculation algo. Related: OS#6108 Change-Id: I97f4977944a6f82abc7b39c4e578de9d8e152740
2023-07-21rlcmac: Mark received BSNs falling out of the V(N)/RBB when V(R) is raisedPau Espin Pedrol3-11/+15
Problem this patch is fixing: The current RLCMAC window code ported from osmo-pcu is never invalidating the BSNs which have been received after they are not needed. As a result, when the DL TBF keeps sending data for a long time, and finally BSN wraps around 127->0, when this implementation receives the BSN=0, it will find it is already received and hence will discard it, and then keep asking for BSN=0 nevertheless in PKT DL ACK, causing an endless loop where PCU stays submitting the same block forever. Explanation of the solution: The V(N) array contains the status of the previous WS (64 in GPRS) data blocks. This array is used to construct the RRB signaled to the peer during PKT DL ACK/NACK messages together with the SSN (start sequence number), which in our case is mainly V(R), aka one block higher than the highest received block in the rx window. Hence, whenever PKT DL ACK/NACK is transmitted, it contains an RRB ranging [V(R)-1,...V(R)-WS)] mod SNS (SNS=128 in GPRS). The receive window is basically [V(Q) <= BSN < V(R)] mod SNS, as is of size 64. The V(R) is increased whenever a highest new block arrives which is in the receive window (guaranteeing it will be increased to at most V(Q)+64. Since we are only announcing state of blocks from V(R)..V(R)-WS, and blocks received which are before that BSN are dropped since don't fall inside the rx window, we can securely mark as invalid those blocks falling behind V(R)-WS whenever we increase V(R). Related: OS#6102 Change-Id: I962111995e741a7e9c230b2dd4904c2fa9a828e9
2023-07-21rlcmac: rlc_window_dl: Fix RBB generationPau Espin Pedrol1-1/+1
We want to do mod sns on the BSN, not on the boolean returned by gprs_rlcmac_rlc_v_n_is_received(). This is a typo which occurred while porting the code from osmo-pcu.git void gprs_rlc_ul_window::update_rbb(char *rbb), where the following line is used: """ if (m_v_n.is_received((ssn()-1-i) & mod_sns())) """ Change-Id: I37c8fd5c2528f035f077c3e05105f913922ffd84
2023-07-21rlcmac: Log SSN and FINAL_ACK when preparing PKT DL ACK/NACK msgPau Espin Pedrol2-5/+8
Change-Id: Ia8cd3ea341308887953fe76df6821c429b3d8e77
2023-07-20rlcmac: Fix LOGPTBFDL macro log categoryPau Espin Pedrol1-1/+1
Change-Id: I7f90981a114070ff13c508f0c6800cc1dd2cfe14
2023-07-20rlcmac: Fix null ptr dereferencePau Espin Pedrol1-1/+1
Caught by ASan during test run. This can happen if gprs_rlcmac_ul_tbf_schedule_next_llc_frame() finds no more llc frames to submit during the loop iteration. Change-Id: I5bd6dd6c6b7dc4b911af7bc119cf85eb810959a0
2023-07-20rlcmac: tbf_ul: Free TBF if submitting RACH.req failsPau Espin Pedrol3-2/+14
Change-Id: I63d68e524629a90931497d1181f134830b4819f9
2023-07-20sndcp: Handle LL-ASSIGN.indPau Espin Pedrol1-0/+20
Change-Id: I924dcf3ac9cbb15e26a5e9376f89ca098ab49e0b
2023-07-20llc: Introduce LL-ASSIGN.indPau Espin Pedrol5-4/+43
TS 24.007, TS 24.008, TS 44.064 nor TS 44.065 explain how the TLLI update happening during GMM RAU propagates to the SNDCP layer. GMM only has interfaces towards LLC and GRR, and uses LLGMM-Assign.Req and GMMRR-Assign.req to update the TLLI in the respective layers. This patch adds a new primitive in the LL interface (LLC->SNDCP) LL-Assign.ind to propagate the LLGM-Assign.req received from GMM towards SNDCP, so that it can use the new TLLI in order to address the specific MS. Change-Id: Icb858f5397414b6d4183c21f13d35c0166ca7635
2023-07-20sndcp: Answer SNSM-DEACTIVATE.ind with .respPau Espin Pedrol4-0/+22
Change-Id: I8ddebf93d3150cc952f9e5fc5d6f3cfc99e912a5
2023-07-20sm: Handle GMMSM-MODIFY.ind primitivePau Espin Pedrol3-1/+145
Change-Id: Ic765b7a565cac4abcf34d8c6868e103971d17822
2023-07-19gmm: Introduce GMMSM-Modify.ind primitivePau Espin Pedrol7-8/+126
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-19gmm: Document spec ref regarding Receive N-PDU Numbers IE in RAU ComplPau Espin Pedrol1-0/+5
Change-Id: I8b4c5a6c4c4da3648160aa32f7586c74942c7734
2023-07-18gmm: Fix typos in testPau Espin Pedrol1-3/+3
The TLLI was wrong (I tooked the one from the Attach Accept msg instead of RAU accept message defined above). Change-Id: I2f7d61c72febad24fde285578e20485a23b8e175
2023-07-18gmm: Store received PDP Ctx Status and List of Receive N-PDU NumbersPau Espin Pedrol3-1/+18
Those IEs are aimed at upper layers (SM, SNDCP) and will be relayed in follow-up patches. Change-Id: I3a43b5e0417796f7dce4010cd6a6d3fd2d9c543e
2023-07-18gmm: Make OSMO_GPRS_GMM_TLLI_UNASSIGNED def publicly availablePau Espin Pedrol3-6/+6
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-18rlcmac: Introduce L1CTL-CCCH_READY.ind primitivePau Espin Pedrol5-34/+49
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-17cosmetic: gmm: Fix typo in commentPau Espin Pedrol1-1/+1
Change-Id: I9c32def9571294abe2e67235a50809839ed5966a
2023-07-14cosmetic: gmm: fix spec reference formatPau Espin Pedrol1-1/+1
Change-Id: Id4b52b6110fc8012d5d3b4d341b9702e3142c334
2023-07-11doc: add PDCH timing diagram illustrating UL/DL delayVadim Yanitskiy1-0/+15
Change-Id: I7d01c833b6b746d74e6ecd8c65c929a320a95d17
2023-07-05gmm: Accept event LOW_LVL_FAIL in RAU/SR_INITIATED statesPau Espin Pedrol1-0/+8
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-05rlcmac: tbf_dl: Implement T3192Pau Espin Pedrol5-6/+58
Related: OS#5500 Change-Id: I49c9068d1819d6189103908f6f92ce05952b74e6
2023-07-05rlcmac: tbf_dl: Implement T3190Pau Espin Pedrol4-4/+37
Related: OS#5500 Change-Id: I3f69fde298dcd64d30b9d648a96717a8378864c4
2023-07-05rlcmac: defer going to pkt_idle_timer after freeing TBFPau Espin Pedrol5-10/+54
Give some time to pending tx blocks to be transmitted before jumping back to CCCH. Change-Id: I563ad2ee6aacd65314e998626dc27adc29221a7d
2023-07-04rlcmac: tbf_ul: Move to packet-idle state when T3164 triggersPau Espin Pedrol8-42/+174
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-04rlcmac: Rework tbf destructor to signal free() to its gre objectPau Espin Pedrol5-8/+40
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-04rlcmac: add OSMO_GPRS_RLCMAC_L1CTL_PDCH_{ESTABLISH,RELEASE}.reqVadim Yanitskiy5-0/+113
* 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