Change in ...osmo-trx[master]: Transceiver: Don't stop TRX if pulling from OFF timeslot

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Fri Sep 6 13:06:24 UTC 2019


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/15436


Change subject: Transceiver: Don't stop TRX if pulling from OFF timeslot
......................................................................

Transceiver: Don't stop TRX if pulling from OFF timeslot

BTS may have any timeslot disabled, or may have not yet sent initial
SETSLOT cmd to properly configure the timeslot.

Change-Id: Icf62e5d1200c7a440f255bb46023cdbf61532b7f
---
M Transceiver52M/Transceiver.cpp
M Transceiver52M/Transceiver.h
2 files changed, 31 insertions(+), 22 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/36/15436/1

diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 079d1d7..a6cc46f 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -587,9 +587,11 @@
 /*
  * Pull bursts from the FIFO and handle according to the slot
  * and burst correlation type. Equalzation is currently disabled.
- * returns true on success (bi filled), false on error (bi content undefined).
+ * returns 0 on success (bi filled), negative on error (bi content undefined):
+ *        -1: timeslot is off (fn and tn in bi are filled),
+ *        -2: read error
  */
-bool Transceiver::pullRadioVector(size_t chan, struct trx_ul_burst_ind *bi)
+int Transceiver::pullRadioVector(size_t chan, struct trx_ul_burst_ind *bi)
 {
   int rc;
   struct estim_burst_params ebp;
@@ -605,25 +607,11 @@
   radioVector *radio_burst = mReceiveFIFO[chan]->read();
   if (!radio_burst) {
     LOGCHAN(chan, DMAIN, ERROR) << "ReceiveFIFO->read() returned no burst";
-    return false;
+    return -2;
   }
 
   /* Set time and determine correlation type */
   burstTime = radio_burst->getTime();
-  CorrType type = expectedCorrType(burstTime, chan);
-
-  /* Debug: dump bursts to disk */
-  /* bits 0-7  - chan 0 timeslots
-   * bits 8-15 - chan 1 timeslots */
-  if (mWriteBurstToDiskMask & ((1<<bi->tn) << (8*chan)))
-    writeToFile(radio_burst, chan);
-
-  /* No processing if the timeslot is off.
-   * Not even power level or noise calculation. */
-  if (type == OFF) {
-    delete radio_burst;
-    return false;
-  }
 
   /* Initialize struct bi */
   bi->nbits = 0;
@@ -638,6 +626,21 @@
   bi->tsc = 0;
   bi->ci = 0.0;
 
+  CorrType type = expectedCorrType(burstTime, chan);
+
+  /* Debug: dump bursts to disk */
+  /* bits 0-7  - chan 0 timeslots
+   * bits 8-15 - chan 1 timeslots */
+  if (mWriteBurstToDiskMask & ((1<<bi->tn) << (8*chan)))
+    writeToFile(radio_burst, chan);
+
+  /* No processing if the timeslot is off.
+   * Not even power level or noise calculation. */
+  if (type == OFF) {
+    delete radio_burst;
+    return -1;
+  }
+
   /* Select the diversity channel with highest energy */
   for (size_t i = 0; i < radio_burst->chans(); i++) {
     float pow = energyDetect(*radio_burst->getVector(i), 20 * mSPSRx);
@@ -702,12 +705,12 @@
 
   delete rxBurst;
   delete radio_burst;
-  return true;
+  return 0;
 
 ret_idle:
   bi->idle = true;
   delete radio_burst;
-  return true;
+  return 0;
 }
 
 void Transceiver::reset()
@@ -1032,9 +1035,15 @@
 bool Transceiver::driveReceiveFIFO(size_t chan)
 {
   struct trx_ul_burst_ind bi;
+  int rc;
 
-  if (!pullRadioVector(chan, &bi))
-    return false;
+  if ((rc = pullRadioVector(chan, &bi)) < 0) {
+    if (rc == -1) { /* timeslot off, warn and continue processing */
+      LOGCHAN(chan, DMAIN, NOTICE) << unsigned(bi.tn) << ":" << bi.fn << " timeslot is off";
+      return true;
+    }
+    return false; /* other errors: we want to stop the process */
+  }
 
   if (!bi.idle)
     logRxBurst(chan, &bi);
diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h
index 0d09854..30f6a60 100644
--- a/Transceiver52M/Transceiver.h
+++ b/Transceiver52M/Transceiver.h
@@ -182,7 +182,7 @@
   void pushRadioVector(GSM::Time &nowTime);
 
   /** Pull and demodulate a burst from the receive FIFO */
-  bool pullRadioVector(size_t chan, struct trx_ul_burst_ind *ind);
+  int pullRadioVector(size_t chan, struct trx_ul_burst_ind *ind);
 
   /** Set modulus for specific timeslot */
   void setModulus(size_t timeslot, size_t chan);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/15436
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: Icf62e5d1200c7a440f255bb46023cdbf61532b7f
Gerrit-Change-Number: 15436
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190906/4a5700c1/attachment.htm>


More information about the gerrit-log mailing list