dexter has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/30922 )
Change subject: abis_rsl: fix frame number calculation
......................................................................
abis_rsl: fix frame number calculation
The formula that is used to recover the (relative) frame number from the
T1, T2, T3 parameters matches the definition in the spec, but since the
partial term t3-t2 can be negative special precaution is required when
performing the MOD 26 operation. This is due to the truncated modulo
implementation in C/C++, which has a very specific understanding on how
to deal with negative input parameters.
The libosmocore gsm_gsmtime2fn(() offers a correct implementation, so
lets use it.
Change-Id: I5fb2b0ada8d409730ac22963741fb4ab0026abdd
Related: OS#5198
---
M src/osmo-bsc/abis_rsl.c
1 file changed, 7 insertions(+), 7 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 640ff4d..df8163c 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -1800,10 +1800,10 @@
/* Handle packet channel rach requests */
static int rsl_rx_pchan_rqd(struct chan_rqd *rqd)
{
- uint8_t t1, t2, t3;
uint32_t fn;
uint8_t rqd_ta;
uint8_t is_11bit;
+ struct gsm_time gsm_time;
/* Process rach request and forward contained information to PCU */
if (rqd->ref.ra == 0x7F) {
@@ -1816,13 +1816,13 @@
is_11bit = 0;
rqd_ta = rqd->ta;
- /* See also 3GPP TS 04.08, section 10.5.2.38 and 3GPP TS 08.58, section 9.3.8 */
- t1 = rqd->ref.t1;
- t2 = rqd->ref.t2;
- t3 = rqd->ref.t3_low | (rqd->ref.t3_high << 3);
- fn = (51 * ((t3-t2) % 26) + t3 + 51 * 26 * t1);
+ gsm_time.t1 = rqd->ref.t1;
+ gsm_time.t2 = rqd->ref.t2;
+ gsm_time.t3 = rqd->ref.t3_low | (rqd->ref.t3_high << 3);
+ fn = gsm_gsmtime2fn(&gsm_time);
- LOG_BTS(rqd->bts, DRSL, LOGL_INFO, "CHAN RQD: fn(t1=%u,t3=%u,t2=%u) = %u\n", t1, t3, t2, fn);
+ LOG_BTS(rqd->bts, DRSL, LOGL_INFO, "CHAN RQD: fn(t1=%u,t3=%u,t2=%u) = %u\n",
+ gsm_time.t1, gsm_time.t3, gsm_time.t2, fn);
}
return pcu_tx_rach_ind(rqd->bts, rqd_ta, rqd->ref.ra, fn, is_11bit,
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/30922
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I5fb2b0ada8d409730ac22963741fb4ab0026abdd
Gerrit-Change-Number: 30922
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/30907 )
Change subject: sndcp: Initial support for async SN-XID.ind and SN-XID.rsp
......................................................................
Patch Set 3: Code-Review+1
(1 comment)
File src/sndcp/sndcp_prim.c:
https://gerrit.osmocom.org/c/libosmo-gprs/+/30907/comment/9d925831_9ba62408
PS3, Line 224: PRIM_OP_RESPONSE
(would be cleaner to do this in a separate patch)
--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/30907
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: I0a5069fd3dc0d6c3dd28aeae09b51c49dd8be92d
Gerrit-Change-Number: 30907
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: daniel <dwillmann(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-CC: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 12 Jan 2023 13:52:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment