trxcon: Suppress POWERON to TRX if we're already powered on.
commitfd6c211eab32d489a304bb3ae63774887a3d6024
authorHarald Welte <laforge@gnumonks.org>
Thu, 30 May 2019 13:21:45 +0000 (30 15:21 +0200)
committerVadim Yanitskiy <axilirator@gmail.com>
Fri, 31 May 2019 15:35:31 +0000 (31 22:35 +0700)
treeacb7e2b8cdc50b65d0a0f717c7879d25df95c863
parent1a66c2991cbd90e5bdc51bfcfcfcd851b4abb2a3
trxcon: Suppress POWERON to TRX if we're already powered on.

The existing logic unconditionally wants to send a POWERON command
on TRXC whenever L1CTL_FBSB_REQ is received.  That may cause some
problems when sending subsequent L1CTL_FBSB_REQ, e.g. due to signal loss.

Sending POWEROFF when transceiver is not powered on is normal though.
This can happen if trxcon is restarted while fake_trx was running.

The existing FSM state could unfortunately not been used, as it's a
mixture between the TRX connection state and the command/response state.

The current solution is just a work around. We definitely need to
introduce separate state machines for transceiver and its TRXC
interface.

Change-Id: I834e8897b95a2490811319697fc7cab6076db480
src/host/trxcon/l1ctl.c
src/host/trxcon/trx_if.c
src/host/trxcon/trx_if.h