diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2018-09-07 00:36:35 +0700 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-09-07 09:02:19 +0000 |
commit | 65f80df49244b2b9e27606139c7ab1c7b7ec33fe (patch) | |
tree | 9b92894ae0fbbd551af74cfdc48c379704ea8d8c /src/host/layer23 | |
parent | 5c94d87c62cf60bcbf144eda7666f38ce1ebac88 (diff) |
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
Diffstat (limited to 'src/host/layer23')
-rw-r--r-- | src/host/layer23/include/osmocom/bb/common/l1ctl.h | 2 | ||||
-rw-r--r-- | src/host/layer23/src/common/l1ctl.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/host/layer23/include/osmocom/bb/common/l1ctl.h b/src/host/layer23/include/osmocom/bb/common/l1ctl.h index 824b1b03..e4dbdedc 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 @@ int l1ctl_tx_data_req(struct osmocom_ms *ms, struct msgb *msg, uint8_t chan_nr, 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 f4c214d4..3c570428 100644 --- a/src/host/layer23/src/common/l1ctl.c +++ b/src/host/layer23/src/common/l1ctl.c @@ -388,7 +388,7 @@ int l1ctl_tx_tch_mode_req(struct osmocom_ms *ms, uint8_t tch_mode, } /* 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; |