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
This commit is contained in:
Vadim Yanitskiy 2018-09-07 00:36:35 +07:00 committed by Harald Welte
parent 5c94d87c62
commit 65f80df492
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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;