Change in osmocom-bb[master]: common/l1ctl.c: fix: use signed type for TA in l1ctl_tx_param_req()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Thu Sep 6 20:31:43 UTC 2018


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10816


Change subject: common/l1ctl.c: fix: use signed type for TA in l1ctl_tx_param_req()
......................................................................

common/l1ctl.c: fix: use signed type for TA in l1ctl_tx_param_req()

Despite the correct range of Timing Advance value is [0..63],
there is a special feature in OsmocomBB which allows one to
simulate the distance between both MS and a BTS by playing
with the signal delay.

It was discovered that l1ctl_tx_param_req() is using an unsigned
'uint8_t' type for Timing Advance value, while other code and
L1CTL protocol is using signed 'int8_t'. This may result in
distortion of negative values, so let's fix this!

Change-Id: I6ee42b5fa2ca9ebe187f0b933465c49f840a55c2
---
M src/host/layer23/include/osmocom/bb/common/l1ctl.h
M src/host/layer23/src/common/l1ctl.c
2 files changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/16/10816/1

diff --git a/src/host/layer23/include/osmocom/bb/common/l1ctl.h b/src/host/layer23/include/osmocom/bb/common/l1ctl.h
index 824b1b0..e4dbded 100644
--- a/src/host/layer23/include/osmocom/bb/common/l1ctl.h
+++ b/src/host/layer23/include/osmocom/bb/common/l1ctl.h
@@ -14,7 +14,7 @@
 	uint8_t link_id);
 
 /* Transmit L1CTL_PARAM_REQ */
-int l1ctl_tx_param_req(struct osmocom_ms *ms, uint8_t ta, uint8_t tx_power);
+int l1ctl_tx_param_req(struct osmocom_ms *ms, int8_t ta, uint8_t tx_power);
 
 int l1ctl_tx_crypto_req(struct osmocom_ms *ms, uint8_t chan_nr,
 	uint8_t algo, uint8_t *key, uint8_t len);
diff --git a/src/host/layer23/src/common/l1ctl.c b/src/host/layer23/src/common/l1ctl.c
index f4c214d..3c57042 100644
--- a/src/host/layer23/src/common/l1ctl.c
+++ b/src/host/layer23/src/common/l1ctl.c
@@ -388,7 +388,7 @@
 }
 
 /* Transmit L1CTL_PARAM_REQ */
-int l1ctl_tx_param_req(struct osmocom_ms *ms, uint8_t ta, uint8_t tx_power)
+int l1ctl_tx_param_req(struct osmocom_ms *ms, int8_t ta, uint8_t tx_power)
 {
 	struct msgb *msg;
 	struct l1ctl_info_ul *ul;

-- 
To view, visit https://gerrit.osmocom.org/10816
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ee42b5fa2ca9ebe187f0b933465c49f840a55c2
Gerrit-Change-Number: 10816
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180906/f9b29130/attachment.htm>


More information about the gerrit-log mailing list