2020-07-06 17:56:08 +00:00
|
|
|
/* Provision TRX over TRXC protocol FSM */
|
|
|
|
|
|
|
|
/* (C) 2020 by sysmocom - s.m.f.c. GmbH <info@sysmocom.de>
|
|
|
|
* Author: Pau Espin Pedrol <pespin@sysmocom.de>
|
|
|
|
*
|
|
|
|
* All Rights Reserved
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
[VAMOS] osmo-bts-trx: properly handle per-timeslot TSC values
Each timeslot can have its own Training Sequence Code value, which
may optionally be included in the NM_MT_SET_CHAN_ATTR message sent
over the A-bis/OML. If it's not present, then the TSC value for a
timeslot is derived from the BCC part of BSIC, which is always
included in the NM_MT_SET_BTS_ATTR message.
On the TRXC interface, the BTS global TSC value is indicated to the
transceiver using either of the 'SETTSC' or 'SETBSIC' commands.
The transceiver then applies this value for all timeslots by default,
however it can be redefined for each timeslot individually using
additional arguments of the 'SETSLOT' command (see section 25.2.4.1
in the user manual [1] for more details).
Currently, trx_set_ts_as_pchan() sends TRX_PROV_EV_CFG_TSC to the
transceiver provisioning FSM, together with the per-timeslot TSC
value. This event causes the FSM to modify the global TSC value,
that is going to be or has already been sent to the transceiver.
This is wrong, the global TSC value shall not be overwritten.
Remove the TRX_PROV_EV_CFG_TSC, and include per-timeslot Training
Sequence Code and Set in the data structure that gets passed together
with the TRX_PROV_EV_CFG_TS instead. Implement handling of the
optional per-timeslot TSC in trx_if_cmd_setslot().
[1] https://downloads.osmocom.org/docs/latest/osmobts-usermanual.pdf
Change-Id: Idc5796151e3e83f42d60c2d4cb7c35890d76a7f5
Related: SYS#4895, OS#4941
2021-05-24 00:16:50 +00:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2020-07-06 17:56:08 +00:00
|
|
|
#include <osmocom/core/fsm.h>
|
|
|
|
|
|
|
|
enum trx_provision_fsm_states {
|
|
|
|
TRX_PROV_ST_CLOSED,
|
|
|
|
TRX_PROV_ST_OPEN_POWEROFF,
|
|
|
|
TRX_PROV_ST_OPEN_WAIT_POWERON_CNF,
|
|
|
|
TRX_PROV_ST_OPEN_POWERON,
|
|
|
|
TRX_PROV_ST_OPEN_WAIT_POWEROFF_CNF,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct trx_prov_ev_cfg_ts_data {
|
|
|
|
uint8_t tn;
|
|
|
|
uint8_t slottype;
|
[VAMOS] osmo-bts-trx: properly handle per-timeslot TSC values
Each timeslot can have its own Training Sequence Code value, which
may optionally be included in the NM_MT_SET_CHAN_ATTR message sent
over the A-bis/OML. If it's not present, then the TSC value for a
timeslot is derived from the BCC part of BSIC, which is always
included in the NM_MT_SET_BTS_ATTR message.
On the TRXC interface, the BTS global TSC value is indicated to the
transceiver using either of the 'SETTSC' or 'SETBSIC' commands.
The transceiver then applies this value for all timeslots by default,
however it can be redefined for each timeslot individually using
additional arguments of the 'SETSLOT' command (see section 25.2.4.1
in the user manual [1] for more details).
Currently, trx_set_ts_as_pchan() sends TRX_PROV_EV_CFG_TSC to the
transceiver provisioning FSM, together with the per-timeslot TSC
value. This event causes the FSM to modify the global TSC value,
that is going to be or has already been sent to the transceiver.
This is wrong, the global TSC value shall not be overwritten.
Remove the TRX_PROV_EV_CFG_TSC, and include per-timeslot Training
Sequence Code and Set in the data structure that gets passed together
with the TRX_PROV_EV_CFG_TS instead. Implement handling of the
optional per-timeslot TSC in trx_if_cmd_setslot().
[1] https://downloads.osmocom.org/docs/latest/osmobts-usermanual.pdf
Change-Id: Idc5796151e3e83f42d60c2d4cb7c35890d76a7f5
Related: SYS#4895, OS#4941
2021-05-24 00:16:50 +00:00
|
|
|
|
|
|
|
/* Training Sequence Code and Set */
|
|
|
|
uint8_t tsc_set;
|
|
|
|
uint8_t tsc_val;
|
|
|
|
bool tsc_valid;
|
2020-07-06 17:56:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum trx_provision_fsm_events {
|
2020-07-22 17:56:44 +00:00
|
|
|
TRX_PROV_EV_OTHER_TRX_READY,
|
2020-07-06 17:56:08 +00:00
|
|
|
TRX_PROV_EV_OPEN,
|
|
|
|
TRX_PROV_EV_CFG_ENABLE,
|
|
|
|
TRX_PROV_EV_CFG_BSIC,
|
|
|
|
TRX_PROV_EV_CFG_ARFCN,
|
|
|
|
TRX_PROV_EV_CFG_TSC,
|
|
|
|
TRX_PROV_EV_CFG_TS,
|
|
|
|
TRX_PROV_EV_CFG_RXGAIN,
|
|
|
|
TRX_PROV_EV_CFG_SETMAXDLY,
|
2020-07-22 16:48:48 +00:00
|
|
|
TRX_PROV_EV_RXTUNE_CNF,
|
|
|
|
TRX_PROV_EV_TXTUNE_CNF,
|
|
|
|
TRX_PROV_EV_NOMTXPOWER_CNF,
|
|
|
|
TRX_PROV_EV_SETBSIC_CNF,
|
|
|
|
TRX_PROV_EV_SETTSC_CNF,
|
|
|
|
TRX_PROV_EV_SETFORMAT_CNF,
|
2020-07-06 17:56:08 +00:00
|
|
|
TRX_PROV_EV_POWERON_CNF,
|
|
|
|
TRX_PROV_EV_POWEROFF_CNF,
|
|
|
|
TRX_PROV_EV_CLOSE,
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct osmo_fsm trx_prov_fsm;
|