Transceiver: Store TRXD version per channel

The setting is negotiatied by osmo-bts-trx on each channel, so let's
keep and use state per channel instead of overwriting the state from
different channels.
Take the chance to change related log lines to also print the channel
number.

Change-Id: If9cf95e89d38d0155ab48b8c0977ca5f381c2aad
This commit is contained in:
Pau Espin 2019-07-22 17:47:02 +02:00 committed by pespin
parent 88f86a14ba
commit c3325b9aeb
2 changed files with 9 additions and 8 deletions

View File

@ -129,7 +129,7 @@ Transceiver::Transceiver(int wBasePort,
mSPSTx(tx_sps), mSPSRx(rx_sps), mChans(chans), mExtRACH(false), mEdge(false),
mOn(false), mForceClockInterface(false),
mTxFreq(0.0), mRxFreq(0.0), mTSC(0), mMaxExpectedDelayAB(0), mMaxExpectedDelayNB(0),
mWriteBurstToDiskMask(0), mVersionTRXD(0)
mWriteBurstToDiskMask(0)
{
txFullScale = mRadioInterface->fullScaleInputValue();
rxFullScale = mRadioInterface->fullScaleOutputValue();
@ -198,6 +198,7 @@ bool Transceiver::init(FillerType filler, size_t rtsc, unsigned rach_delay,
mTxPriorityQueues.resize(mChans);
mReceiveFIFO.resize(mChans);
mStates.resize(mChans);
mVersionTRXD.resize(mChans);
/* Filler table retransmissions - support only on channel 0 */
if (filler == FILLER_DUMMY)
@ -885,14 +886,14 @@ void Transceiver::driveControl(size_t chan)
// set TRXD protocol version
unsigned version_recv;
sscanf(params, "%u", &version_recv);
LOGC(DTRXCTRL, INFO) << "BTS requests TRXD version switch: " << version_recv;
LOGCHAN(chan, DTRXCTRL, INFO) << "BTS requests TRXD version switch: " << version_recv;
if (version_recv > TRX_DATA_FORMAT_VER) {
LOGC(DTRXCTRL, INFO) << "rejecting TRXD version " << version_recv
<< "in favor of " << TRX_DATA_FORMAT_VER;
LOGCHAN(chan, DTRXCTRL, INFO) << "rejecting TRXD version " << version_recv
<< "in favor of " << TRX_DATA_FORMAT_VER;
sprintf(response, "RSP SETFORMAT %u %u", TRX_DATA_FORMAT_VER, version_recv);
} else {
LOGC(DTRXCTRL, NOTICE) << "switching to TRXD version " << version_recv;
mVersionTRXD = version_recv;
LOGCHAN(chan, DTRXCTRL, NOTICE) << "switching to TRXD version " << version_recv;
mVersionTRXD[chan] = version_recv;
sprintf(response, "RSP SETFORMAT %u %u", version_recv, version_recv);
}
} else if (match_cmd(command, "_SETBURSTTODISKMASK", &params)) {
@ -1023,7 +1024,7 @@ void Transceiver::driveReceiveFIFO(size_t chan)
if (!bi.idle)
logRxBurst(chan, &bi);
switch (mVersionTRXD) {
switch (mVersionTRXD[chan]) {
case 0:
trxd_send_burst_ind_v0(chan, mDataSockets[chan], &bi);
break;

View File

@ -218,8 +218,8 @@ private:
unsigned mMaxExpectedDelayAB; ///< maximum expected time-of-arrival offset in GSM symbols for Access Bursts (RACH)
unsigned mMaxExpectedDelayNB; ///< maximum expected time-of-arrival offset in GSM symbols for Normal Bursts
unsigned mWriteBurstToDiskMask; ///< debug: bitmask to indicate which timeslots to dump to disk
unsigned mVersionTRXD; ///< Format version to use for TRXD protocol communication
std::vector<unsigned> mVersionTRXD; ///< Format version to use for TRXD protocol communication, per channel
std::vector<TransceiverState> mStates;
/** Start and stop I/O threads through the control socket API */