Change in osmocom-bb[master]: common/l1ctl.c: fix: use signed type for TA in l1ctl_tx_param_req()
Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10816 ) Change subject: common/l1ctl.c: fix: use signed type for TA in l1ctl_tx_param_req() .. Patch Set 1: Code-Review+2 -- 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: comment Gerrit-Change-Id: I6ee42b5fa2ca9ebe187f0b933465c49f840a55c2 Gerrit-Change-Number: 10816 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Comment-Date: Fri, 07 Sep 2018 09:01:41 + Gerrit-HasComments: No Gerrit-HasLabels: Yes
Change in osmocom-bb[master]: common/l1ctl.c: fix: use signed type for TA in l1ctl_tx_param_req()
Harald Welte has submitted this change and it was merged. ( 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(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified 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: merged Gerrit-Change-Id: I6ee42b5fa2ca9ebe187f0b933465c49f840a55c2 Gerrit-Change-Number: 10816 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (102)
Change in osmocom-bb[master]: common/l1ctl.c: fix: use signed type for TA in l1ctl_tx_param_req()
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