2021-04-15 01:32:23 +00:00
|
|
|
#pragma once
|
2013-02-05 10:45:28 +00:00
|
|
|
|
2021-04-15 02:14:03 +00:00
|
|
|
/* TRXC read/send buffer size */
|
|
|
|
#define TRXC_MSG_BUF_SIZE 1500
|
2021-04-22 02:06:18 +00:00
|
|
|
/* TRXD read/send buffer size (max. lo MTU) */
|
|
|
|
#define TRXD_MSG_BUF_SIZE 65536
|
2021-04-15 02:14:03 +00:00
|
|
|
|
2020-06-13 14:45:33 +00:00
|
|
|
struct trx_dl_burst_req;
|
2016-01-09 12:13:37 +00:00
|
|
|
struct trx_l1h;
|
2013-02-05 10:45:28 +00:00
|
|
|
|
|
|
|
struct trx_ctrl_msg {
|
|
|
|
struct llist_head list;
|
2018-01-16 17:42:03 +00:00
|
|
|
char cmd[28];
|
|
|
|
char params[100];
|
2013-02-05 10:45:28 +00:00
|
|
|
int cmd_len;
|
2018-01-16 17:42:03 +00:00
|
|
|
int params_len;
|
2013-02-05 12:46:03 +00:00
|
|
|
int critical;
|
bts-trx: (n)ack PDCH DEACT only after TRX answered SETSLOT
Before this patch, PDCH DEACT was (n)acked to the BSC without taking
into account if TRX succeeded or failed to set the TS:
20181123044720655 DRLL rsl.c:2523 (bts=0,trx=0,ts=0,ss=0) Rx RLL DATA_REQ Abis -> LAPDm
20181123044720700 DRSL rsl.c:2805 (bts=0,trx=0,ts=6,pchan=TCH/F_PDCH as PDCH) ss=0 Rx RSL IPAC_PDCH_DEACT
20181123044720700 DRSL rsl.c:2205 (bts=0,trx=0,ts=6,pchan=TCH/F_PDCH as PDCH) Request to PDCH DEACT, but lchan is still active
20181123044720700 DRSL rsl.c:2131 (bts=0,trx=0,ts=6,ss=0) Tx PDCH DEACT NACK (cause = 0x0f)
20181123044720700 DPCU pcu_sock.c:124 Sending info
20181123044720700 DPCU pcu_sock.c:139 BTS is up
20181123044720700 DPCU pcu_sock.c:232 trx=0 ts=7: available (tsc=7 arfcn=868)
20181123044720703 DPCU pcu_sock.c:608 Deactivate request received: TRX=0 TX=6
20181123044720703 DL1C l1sap.c:1519 deactivating channel chan_nr=TCH/F on TS6 trx=0
20181123044720703 DTRX trx_if.c:242 Enqueuing TRX control command 'CMD NOHANDOVER 6 0'
20181123044720703 DL1C l1sap.c:648 deactivate confirm chan_nr=TCH/F on TS6 trx=0
20181123044720703 DRSL rsl.c:714 (bts=0,trx=0,ts=6,ss=0) not sending REL ACK
20181123044720703 DRSL rsl.c:2264 (bts=0,trx=0,ts=6,ss=0) PDCH DEACT operation: channel disconnected, will reconnect as TCH
20181123044720703 DL1C scheduler.c:593 Configuring multiframe with TCH/F+SACCH trx=0 ts=6
20181123044720703 DTRX trx_if.c:242 Enqueuing TRX control command 'CMD SETSLOT 6 1'
20181123044720703 DL1C l1_if.c:780 (bts=0,trx=0,ts=6) bts_model_ts_connect(as_pchan=TCH/F) success, calling cb_ts_connected()
20181123044720703 DRSL rsl.c:2339 (bts=0,trx=0,ts=6,ss=0) PDCH DEACT operation: timeslot connected as TCH/F
20181123044720703 DRSL rsl.c:2440 (bts=0,trx=0,ts=6,ss=0) TCH/F_PDCH switched to TCH/F mode (ts->flags == 0)
20181123044720703 DRSL rsl.c:2103 (bts=0,trx=0,ts=6,ss=0) Tx PDCH DEACT ACK
20181123044720704 DTRX trx_if.c:492 Response message: 'RSP NOHANDOVER 0 6'
20181123044720705 DTRX trx_if.c:492 Response message: 'RSP SETSLOT 0 6 1'
Change-Id: I888de761b65c3ea8bfe623fcf009f3b2b57c926c
2018-11-26 12:59:52 +00:00
|
|
|
void *cb;
|
2013-02-05 10:45:28 +00:00
|
|
|
};
|
|
|
|
|
2020-07-22 16:48:48 +00:00
|
|
|
typedef void trx_if_cmd_generic_cb(struct trx_l1h *l1h, int rc);
|
2019-09-27 22:50:51 +00:00
|
|
|
typedef void trx_if_cmd_poweronoff_cb(struct trx_l1h *l1h, bool poweronoff, int rc);
|
bts-trx: (n)ack PDCH DEACT only after TRX answered SETSLOT
Before this patch, PDCH DEACT was (n)acked to the BSC without taking
into account if TRX succeeded or failed to set the TS:
20181123044720655 DRLL rsl.c:2523 (bts=0,trx=0,ts=0,ss=0) Rx RLL DATA_REQ Abis -> LAPDm
20181123044720700 DRSL rsl.c:2805 (bts=0,trx=0,ts=6,pchan=TCH/F_PDCH as PDCH) ss=0 Rx RSL IPAC_PDCH_DEACT
20181123044720700 DRSL rsl.c:2205 (bts=0,trx=0,ts=6,pchan=TCH/F_PDCH as PDCH) Request to PDCH DEACT, but lchan is still active
20181123044720700 DRSL rsl.c:2131 (bts=0,trx=0,ts=6,ss=0) Tx PDCH DEACT NACK (cause = 0x0f)
20181123044720700 DPCU pcu_sock.c:124 Sending info
20181123044720700 DPCU pcu_sock.c:139 BTS is up
20181123044720700 DPCU pcu_sock.c:232 trx=0 ts=7: available (tsc=7 arfcn=868)
20181123044720703 DPCU pcu_sock.c:608 Deactivate request received: TRX=0 TX=6
20181123044720703 DL1C l1sap.c:1519 deactivating channel chan_nr=TCH/F on TS6 trx=0
20181123044720703 DTRX trx_if.c:242 Enqueuing TRX control command 'CMD NOHANDOVER 6 0'
20181123044720703 DL1C l1sap.c:648 deactivate confirm chan_nr=TCH/F on TS6 trx=0
20181123044720703 DRSL rsl.c:714 (bts=0,trx=0,ts=6,ss=0) not sending REL ACK
20181123044720703 DRSL rsl.c:2264 (bts=0,trx=0,ts=6,ss=0) PDCH DEACT operation: channel disconnected, will reconnect as TCH
20181123044720703 DL1C scheduler.c:593 Configuring multiframe with TCH/F+SACCH trx=0 ts=6
20181123044720703 DTRX trx_if.c:242 Enqueuing TRX control command 'CMD SETSLOT 6 1'
20181123044720703 DL1C l1_if.c:780 (bts=0,trx=0,ts=6) bts_model_ts_connect(as_pchan=TCH/F) success, calling cb_ts_connected()
20181123044720703 DRSL rsl.c:2339 (bts=0,trx=0,ts=6,ss=0) PDCH DEACT operation: timeslot connected as TCH/F
20181123044720703 DRSL rsl.c:2440 (bts=0,trx=0,ts=6,ss=0) TCH/F_PDCH switched to TCH/F mode (ts->flags == 0)
20181123044720703 DRSL rsl.c:2103 (bts=0,trx=0,ts=6,ss=0) Tx PDCH DEACT ACK
20181123044720704 DTRX trx_if.c:492 Response message: 'RSP NOHANDOVER 0 6'
20181123044720705 DTRX trx_if.c:492 Response message: 'RSP SETSLOT 0 6 1'
Change-Id: I888de761b65c3ea8bfe623fcf009f3b2b57c926c
2018-11-26 12:59:52 +00:00
|
|
|
typedef void trx_if_cmd_setslot_cb(struct trx_l1h *l1h, uint8_t tn, uint8_t type, int rc);
|
2020-06-19 15:15:57 +00:00
|
|
|
typedef void trx_if_cmd_getnompower_cb(struct trx_l1h *l1h, int nominal_power, int rc);
|
2020-05-29 14:47:25 +00:00
|
|
|
typedef void trx_if_cmd_setpower_att_cb(struct trx_l1h *l1h, int power_att_db, int rc);
|
bts-trx: (n)ack PDCH DEACT only after TRX answered SETSLOT
Before this patch, PDCH DEACT was (n)acked to the BSC without taking
into account if TRX succeeded or failed to set the TS:
20181123044720655 DRLL rsl.c:2523 (bts=0,trx=0,ts=0,ss=0) Rx RLL DATA_REQ Abis -> LAPDm
20181123044720700 DRSL rsl.c:2805 (bts=0,trx=0,ts=6,pchan=TCH/F_PDCH as PDCH) ss=0 Rx RSL IPAC_PDCH_DEACT
20181123044720700 DRSL rsl.c:2205 (bts=0,trx=0,ts=6,pchan=TCH/F_PDCH as PDCH) Request to PDCH DEACT, but lchan is still active
20181123044720700 DRSL rsl.c:2131 (bts=0,trx=0,ts=6,ss=0) Tx PDCH DEACT NACK (cause = 0x0f)
20181123044720700 DPCU pcu_sock.c:124 Sending info
20181123044720700 DPCU pcu_sock.c:139 BTS is up
20181123044720700 DPCU pcu_sock.c:232 trx=0 ts=7: available (tsc=7 arfcn=868)
20181123044720703 DPCU pcu_sock.c:608 Deactivate request received: TRX=0 TX=6
20181123044720703 DL1C l1sap.c:1519 deactivating channel chan_nr=TCH/F on TS6 trx=0
20181123044720703 DTRX trx_if.c:242 Enqueuing TRX control command 'CMD NOHANDOVER 6 0'
20181123044720703 DL1C l1sap.c:648 deactivate confirm chan_nr=TCH/F on TS6 trx=0
20181123044720703 DRSL rsl.c:714 (bts=0,trx=0,ts=6,ss=0) not sending REL ACK
20181123044720703 DRSL rsl.c:2264 (bts=0,trx=0,ts=6,ss=0) PDCH DEACT operation: channel disconnected, will reconnect as TCH
20181123044720703 DL1C scheduler.c:593 Configuring multiframe with TCH/F+SACCH trx=0 ts=6
20181123044720703 DTRX trx_if.c:242 Enqueuing TRX control command 'CMD SETSLOT 6 1'
20181123044720703 DL1C l1_if.c:780 (bts=0,trx=0,ts=6) bts_model_ts_connect(as_pchan=TCH/F) success, calling cb_ts_connected()
20181123044720703 DRSL rsl.c:2339 (bts=0,trx=0,ts=6,ss=0) PDCH DEACT operation: timeslot connected as TCH/F
20181123044720703 DRSL rsl.c:2440 (bts=0,trx=0,ts=6,ss=0) TCH/F_PDCH switched to TCH/F mode (ts->flags == 0)
20181123044720703 DRSL rsl.c:2103 (bts=0,trx=0,ts=6,ss=0) Tx PDCH DEACT ACK
20181123044720704 DTRX trx_if.c:492 Response message: 'RSP NOHANDOVER 0 6'
20181123044720705 DTRX trx_if.c:492 Response message: 'RSP SETSLOT 0 6 1'
Change-Id: I888de761b65c3ea8bfe623fcf009f3b2b57c926c
2018-11-26 12:59:52 +00:00
|
|
|
|
2018-11-13 18:31:50 +00:00
|
|
|
void trx_if_init(struct trx_l1h *l1h);
|
2019-09-27 22:50:51 +00:00
|
|
|
int trx_if_cmd_poweroff(struct trx_l1h *l1h, trx_if_cmd_poweronoff_cb *cb);
|
|
|
|
int trx_if_cmd_poweron(struct trx_l1h *l1h, trx_if_cmd_poweronoff_cb *cb);
|
2020-07-22 16:48:48 +00:00
|
|
|
int trx_if_cmd_settsc(struct trx_l1h *l1h, uint8_t tsc, trx_if_cmd_generic_cb *cb);
|
|
|
|
int trx_if_cmd_setbsic(struct trx_l1h *l1h, uint8_t bsic, trx_if_cmd_generic_cb *cb);
|
2013-02-05 10:45:28 +00:00
|
|
|
int trx_if_cmd_setrxgain(struct trx_l1h *l1h, int db);
|
2020-05-29 16:01:50 +00:00
|
|
|
int trx_if_cmd_getnompower(struct trx_l1h *l1h, trx_if_cmd_getnompower_cb *cb);
|
2020-05-29 14:47:25 +00:00
|
|
|
int trx_if_cmd_setpower_att(struct trx_l1h *l1h, int power_att_db, trx_if_cmd_setpower_att_cb *cb);
|
2013-02-05 10:45:28 +00:00
|
|
|
int trx_if_cmd_setmaxdly(struct trx_l1h *l1h, int dly);
|
2016-11-04 19:30:35 +00:00
|
|
|
int trx_if_cmd_setmaxdlynb(struct trx_l1h *l1h, int dly);
|
[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
|
|
|
int trx_if_cmd_setslot(struct trx_l1h *l1h, uint8_t tn, trx_if_cmd_setslot_cb *cb);
|
2020-07-22 16:48:48 +00:00
|
|
|
int trx_if_cmd_rxtune(struct trx_l1h *l1h, uint16_t arfcn, trx_if_cmd_generic_cb *cb);
|
|
|
|
int trx_if_cmd_txtune(struct trx_l1h *l1h, uint16_t arfcn, trx_if_cmd_generic_cb *cb);
|
2013-06-12 07:12:04 +00:00
|
|
|
int trx_if_cmd_handover(struct trx_l1h *l1h, uint8_t tn, uint8_t ss);
|
|
|
|
int trx_if_cmd_nohandover(struct trx_l1h *l1h, uint8_t tn, uint8_t ss);
|
2020-08-26 10:52:42 +00:00
|
|
|
int trx_if_cmd_rfmute(struct trx_l1h *l1h, bool mute);
|
2020-06-13 14:45:33 +00:00
|
|
|
int trx_if_send_burst(struct trx_l1h *l1h, const struct trx_dl_burst_req *br);
|
2016-01-09 22:03:34 +00:00
|
|
|
int trx_if_powered(struct trx_l1h *l1h);
|
2013-02-05 10:45:28 +00:00
|
|
|
|
2021-04-14 18:45:49 +00:00
|
|
|
/* The latest supported TRXD PDU version */
|
2021-04-17 04:48:13 +00:00
|
|
|
#define TRX_DATA_PDU_VER 2
|
2019-06-26 19:29:58 +00:00
|
|
|
|
|
|
|
/* Format negotiation command */
|
2020-07-22 16:48:48 +00:00
|
|
|
int trx_if_cmd_setformat(struct trx_l1h *l1h, uint8_t ver, trx_if_cmd_generic_cb *cb);
|