[PATCH] osmo-trx[master]: sigProcLib.h: Fix whitespaces. No non-whitespace changes.

2017-03-23 Thread Alexander Chemeris
r index, interpolate a sample.
+@param inSig The signal from which to interpolate.
+@param ix The index.
+@return The interpolated signal value.
 */
 complex interpolatePoint(const signalVector ,
-float ix);
+ float ix);
 
 /**
-   Given a correlator output, locate the correlation peak.
-   @param rxBurst The correlator result.
-   @param peakIndex Pointer to value to receive interpolated peak index.
-   @param avgPower Power to value to receive mean power.
-   @return Peak value.
+Given a correlator output, locate the correlation peak.
+@param rxBurst The correlator result.
+@param peakIndex Pointer to value to receive interpolated peak index.
+@param avgPower Power to value to receive mean power.
+@return Peak value.
 */
 complex peakDetect(const signalVector ,
-  float *peakIndex,
-  float *avgPwr);
+   float *peakIndex,
+   float *avgPwr);
 
 /**
 Apply a scalar to a vector.
@@ -193,7 +193,7 @@
 @param scale The scalar.
 */
 void scaleVector(signalVector ,
-complex scale);
+ complex scale);
 
 /**
 Rough energy estimator.
@@ -290,14 +290,14 @@
unsigned max_toa_ab);
 
 /**
-   Downsample 4 SPS to 1 SPS using a polyphase filterbank
+Downsample 4 SPS to 1 SPS using a polyphase filterbank
 @param burst Input burst of at least 624 symbols
 @return Decimated signal vector of 156 symbols
 */
 signalVector *downsampleBurst(signalVector );
 
 /**
-   Decimate a vector.
+Decimate a vector.
 @param wVector The vector of interest.
 @param factor Decimation factor.
 @return The decimated signal vector.
@@ -318,7 +318,7 @@
 
 /**
 Demodulate 8-PSK EDGE burst with soft symbol ooutput
-   @param rxBurst The burst to be demodulated.
+@param rxBurst The burst to be demodulated.
 @param sps The number of samples per GSM symbol.
 @param channel The amplitude estimate of the received burst.
 @param TOA The time-of-arrival of the received burst.

-- 
To view, visit https://gerrit.osmocom.org/2151
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I7718cca45c245c9e91250ab2877f5436d4029698
Gerrit-PatchSet: 2
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>


osmo-trx[master]: Call vectorSlicer() right before packing bits for transmissi...

2017-03-21 Thread Alexander Chemeris

Patch Set 2:

> Could you elaborate, why is this better than before?

vectorSlicer() converts soft-bits from -1..+1 to 0..1 while we want to keep 
SoftVector in -1..+1 mode until the last minute, because at some point we'll 
want to transmit -1..+1 to osmo-bts instead of converting it from 0..1 back to 
-1..+1 on the osmo-bts side.
Plus it removes code duplication - we call it once instead of twice.

-- 
To view, visit https://gerrit.osmocom.org/2139
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idd6ddd7ac219afb0df055a692632678b66373764
Gerrit-PatchSet: 2
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>
Gerrit-HasComments: No


[MERGED] osmo-trx[master]: Move BURST_THRESH from Transceiver.cpp to sigProcLib.h to ma...

2017-03-28 Thread Alexander Chemeris
Alexander Chemeris has submitted this change and it was merged.

Change subject: Move BURST_THRESH from Transceiver.cpp to sigProcLib.h to make 
it reusable.
..


Move BURST_THRESH from Transceiver.cpp to sigProcLib.h to make it reusable.

Change-Id: I5a90e26858c0fbb2ddb7ef23cb0fd66a64b4
---
M Transceiver52M/Transceiver.cpp
M Transceiver52M/sigProcLib.h
2 files changed, 9 insertions(+), 9 deletions(-)

Approvals:
  Tom Tsou: Looks good to me, approved
  Harald Welte: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index e37c08e..d32967e 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -44,15 +44,6 @@
 /* Number of running values use in noise average */
 #define NOISE_CNT  20
 
-/*
- * Burst detection threshold
- *
- * Decision threshold value for burst gating on peak-to-average value of
- * correlated synchronization sequences. Lower values pass more bursts up
- * to upper layers but will increase the false detection rate.
- */
-#define BURST_THRESH   4.0
-
 TransceiverState::TransceiverState()
   : mRetrans(false), mNoiseLev(0.0), mNoises(NOISE_CNT), mPower(0.0)
 {
diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h
index 6413b47..04c4757 100644
--- a/Transceiver52M/sigProcLib.h
+++ b/Transceiver52M/sigProcLib.h
@@ -50,6 +50,15 @@
   SIGERR_INTERNAL,
 };
 
+/*
+ * Burst detection threshold
+ *
+ * Decision threshold value for burst gating on peak-to-average value of
+ * correlated synchronization sequences. Lower values pass more bursts up
+ * to upper layers but will increase the false detection rate.
+ */
+#define BURST_THRESH4.0
+
 /** Convert a linear number to a dB value */
 float dB(float x);
 

-- 
To view, visit https://gerrit.osmocom.org/2149
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5a90e26858c0fbb2ddb7ef23cb0fd66a64b4
Gerrit-PatchSet: 2
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>


[MERGED] osmo-trx[master]: Move Transceiver::detectBurst() to sigProcLib to make it reu...

2017-03-28 Thread Alexander Chemeris
Alexander Chemeris has submitted this change and it was merged.

Change subject: Move Transceiver::detectBurst() to sigProcLib to make it 
reusable.
..


Move Transceiver::detectBurst() to sigProcLib to make it reusable.

Change-Id: I3cbe8e6e4f39dde02c945e6c9086c040e276845c
---
M Transceiver52M/Transceiver.cpp
M Transceiver52M/Transceiver.h
M Transceiver52M/sigProcLib.cpp
M Transceiver52M/sigProcLib.h
4 files changed, 56 insertions(+), 37 deletions(-)

Approvals:
  Tom Tsou: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index c1a63fd..e37c08e 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -542,38 +542,6 @@
   }
 }
 
-int Transceiver::detectBurst(signalVector ,
- complex , float , CorrType type)
-{
-  int rc = 0;
-
-  switch (type) {
-  case EDGE:
-rc = detectEdgeBurst(burst, mTSC, BURST_THRESH, mSPSRx,
- amp, toa, mMaxExpectedDelayNB);
-if (rc > 0)
-  break;
-else
-  type = TSC;
-  case TSC:
-rc = analyzeTrafficBurst(burst, mTSC, BURST_THRESH, mSPSRx,
- amp, toa, mMaxExpectedDelayNB);
-break;
-  case RACH:
-rc = detectRACHBurst(burst, BURST_THRESH, mSPSRx, amp, toa,
- mMaxExpectedDelayAB);
-break;
-  default:
-LOG(ERR) << "Invalid correlation type";
-  }
-
-  if (rc > 0)
-return type;
-
-  return rc;
-}
-
-
 /*
  * Demodulate GMSK by direct rotation and soft slicing.
  */
@@ -679,7 +647,8 @@
   }
 
   /* Detect normal or RACH bursts */
-  rc = detectBurst(*burst, amp, toa, type);
+  rc = detectAnyBurst(*burst, mTSC, BURST_THRESH, mSPSRx, type, amp, toa,
+  (type==RACH)?mMaxExpectedDelayAB:mMaxExpectedDelayNB);
 
   if (rc > 0) {
 type = (CorrType) rc;
diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h
index 425b004..3c70e5c 100644
--- a/Transceiver52M/Transceiver.h
+++ b/Transceiver52M/Transceiver.h
@@ -202,10 +202,6 @@
   /** send messages over the clock socket */
   void writeClockInterface(void);
 
-  /** Detectbursts */
-  int detectBurst(signalVector ,
-  complex , float , CorrType type);
-
   /** Demodulate burst and output soft bits */
   SoftVector *demodulate(signalVector ,
  complex amp, float toa, CorrType type);
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index 6f50f04..2de1816 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -1925,6 +1925,38 @@
   return rc;
 }
 
+int detectAnyBurst(signalVector , unsigned tsc, float threshold,
+   int sps, CorrType type, complex , float ,
+   unsigned max_toa)
+{
+  int rc = 0;
+
+  switch (type) {
+  case EDGE:
+rc = detectEdgeBurst(burst, tsc, threshold, sps,
+ amp, toa, max_toa);
+if (rc > 0)
+  break;
+else
+  type = TSC;
+  case TSC:
+rc = analyzeTrafficBurst(burst, tsc, threshold, sps,
+ amp, toa, max_toa);
+break;
+  case RACH:
+rc = detectRACHBurst(burst, threshold, sps, amp, toa,
+ max_toa);
+break;
+  default:
+LOG(ERR) << "Invalid correlation type";
+  }
+
+  if (rc > 0)
+return type;
+
+  return rc;
+}
+
 signalVector *downsampleBurst(signalVector )
 {
   signalVector *in, *out;
diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h
index 7bdbde8..6413b47 100644
--- a/Transceiver52M/sigProcLib.h
+++ b/Transceiver52M/sigProcLib.h
@@ -255,6 +255,28 @@
 unsigned max_toa);
 
 /**
+8-PSK/GMSK/RACH burst detector
+@param burst The received GSM burst of interest
+@param tsc Midamble type (0..7) also known as TSC
+@param threshold The threshold that the received burst's 
post-correlator SNR is compared against to determine validity.
+@param sps The number of samples per GSM symbol.
+@param amplitude The estimated amplitude of received TSC burst.
+@param toa The estimate time-of-arrival of received TSC burst (in 
symbols).
+@param max_toa The maximum expected time-of-arrival (in symbols).
+@return positive value (CorrType) if threshold value is reached,
+negative value (-SignalError) on error,
+zero (SIGERR_NONE) if no burst is detected
+*/
+int detectAnyBurst(signalVector ,
+   unsigned tsc,
+   float threshold,
+   int sps,
+   CorrType type,
+   complex ,
+   float ,
+   unsigned max_toa);
+
+/**
Downsample 4 SPS to 1 SPS using a polyphase filterbank
 @param burst Input burst of at least 624 symbols

[MERGED] osmo-trx[master]: sigProcLib: Add operator<< to print CorrType to a string.

2017-03-28 Thread Alexander Chemeris
Alexander Chemeris has submitted this change and it was merged.

Change subject: sigProcLib: Add operator<< to print CorrType to a string.
..


sigProcLib: Add operator<< to print CorrType to a string.

Change-Id: I3d68cbdab8fb504d7f155029654a576d318a201e
---
M Transceiver52M/sigProcLib.cpp
M Transceiver52M/sigProcLib.h
2 files changed, 25 insertions(+), 0 deletions(-)

Approvals:
  Tom Tsou: Looks good to me, approved
  Harald Welte: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index 2de1816..d57f8b4 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -2166,3 +2166,26 @@
   sigProcLibDestroy();
   return false;
 }
+
+std::string corrTypeToString(CorrType corr) {
+  switch (corr) {
+  case OFF:
+return "OFF";
+  case TSC:
+return "TSC";
+  case RACH:
+return "RACH";
+  case EDGE:
+return "EDGE";
+  case IDLE:
+return "IDLE";
+  default:
+return "unknown";
+  }
+}
+
+std::ostream& operator<<(std::ostream& os, CorrType corr)
+{
+  os << corrTypeToString(corr);
+  return os;
+}
diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h
index 04c4757..4f2c13e 100644
--- a/Transceiver52M/sigProcLib.h
+++ b/Transceiver52M/sigProcLib.h
@@ -41,6 +41,8 @@
   EDGE,///< timeslot should contain an EDGE burst
   IDLE ///< timeslot is an idle (or dummy) burst
 };
+std::string corrTypeToString(CorrType corr);
+std::ostream& operator<<(std::ostream& os, CorrType corr);
 
 enum SignalError {
   SIGERR_NONE,

-- 
To view, visit https://gerrit.osmocom.org/2150
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3d68cbdab8fb504d7f155029654a576d318a201e
Gerrit-PatchSet: 2
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>


osmo-trx[master]: osmo-trx: Separate command line switch to enable EDGE filler.

2017-03-22 Thread Alexander Chemeris

Patch Set 2:

> Maybe we can replace both -r and -E with new --filler which will
 > figure out appropriate filler based on other options by checking if
 > edge is enabled or not?

That's exactly what this patch is moving away from. Right now -r option has 
different behavior based on whether -e is specified or not, which means that I 
can't generate random GMSK burst if I run in EDGE mode, which is very 
inconvenient.

What we can do is to make this a control interface command rather than a 
command line parameter. It'll make it harder to use, but more clean from the 
code perspective.

-- 
To view, visit https://gerrit.osmocom.org/2143
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic8808bbe3f06740ef3fec1d1865ecb57fbcfabab
Gerrit-PatchSet: 2
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>
Gerrit-HasComments: No


[PATCH] osmo-trx[master]: sigProcLib: make energyDetect() simpler by returning actual ...

2017-03-22 Thread Alexander Chemeris
Hello Max, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/2136

to look at the new patch set (#2).

sigProcLib: make energyDetect() simpler by returning actual energy.

Change-Id: I9bf97f2dc03fea9bebcf43198dfb05f6e4694e9c
---
M Transceiver52M/Transceiver.cpp
M Transceiver52M/sigProcLib.cpp
M Transceiver52M/sigProcLib.h
3 files changed, 9 insertions(+), 17 deletions(-)


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

diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index f156ad4..3df482f 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -606,7 +606,7 @@
 {
   int rc;
   complex amp;
-  float toa, pow, max = -1.0, avg = 0.0;
+  float toa, max = -1.0, avg = 0.0;
   int max_i = -1;
   signalVector *burst;
   SoftVector *bits = NULL;
@@ -641,7 +641,7 @@
 
   /* Select the diversity channel with highest energy */
   for (size_t i = 0; i < radio_burst->chans(); i++) {
-energyDetect(*radio_burst->getVector(i), 20 * mSPSRx, 0.0, );
+float pow = energyDetect(*radio_burst->getVector(i), 20 * mSPSRx);
 if (pow > max) {
   max = pow;
   max_i = i;
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index c1cf12e..41b18cf 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -1721,10 +1721,7 @@
   return (amp.abs()) / rms;
 }
 
-bool energyDetect(signalVector ,
- unsigned windowLength,
- float detectThreshold,
-  float *avgPwr)
+float energyDetect(signalVector , unsigned windowLength)
 {
 
   signalVector::const_iterator windowItr = rxBurst.begin(); 
//+rxBurst.size()/2 - 5*windowLength/2;
@@ -1735,8 +1732,7 @@
 energy += windowItr->norm2();
 windowItr+=4;
   }
-  if (avgPwr) *avgPwr = energy/windowLength;
-  return (energy/windowLength > detectThreshold*detectThreshold);
+  return energy/windowLength;
 }
 
 /*
diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h
index 1b646cd..87c0229 100644
--- a/Transceiver52M/sigProcLib.h
+++ b/Transceiver52M/sigProcLib.h
@@ -176,17 +176,13 @@
 complex scale);
 
 /**
-Energy detector, checks to see if received burst energy is above a 
threshold.
-@param rxBurst The received GSM burst of interest.
+Rough energy estimator.
+@param rxBurst A GSM burst.
 @param windowLength The number of burst samples used to compute burst 
energy
-@param detectThreshold The detection threshold, a linear value.
-@param avgPwr The average power of the received burst.
-@return True if burst energy is above threshold.
+@return The average power of the received burst.
 */
-bool energyDetect(signalVector ,
- unsigned windowLength,
-  float detectThreshold,
-  float *avgPwr = NULL);
+float energyDetect(signalVector ,
+   unsigned windowLength);
 
 /**
 RACH aka Access Burst correlator/detector.

-- 
To view, visit https://gerrit.osmocom.org/2136
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I9bf97f2dc03fea9bebcf43198dfb05f6e4694e9c
Gerrit-PatchSet: 2
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>


[PATCH] osmo-trx[master]: Call vectorSlicer() right before packing bits for transmissi...

2017-03-22 Thread Alexander Chemeris
Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/2139

to look at the new patch set (#3).

Call vectorSlicer() right before packing bits for transmission to osmo-bts.

vectorSlicer() converts soft-bits from -1..+1 to 0..1 while we want
to keep SoftVector in -1..+1 mode until the last minute, because at some
point we'll want to transmit -1..+1 to osmo-bts instead of converting it
from 0..1 back to -1..+1 on the osmo-bts side.

Plus it removes code duplication - we call it once instead of twice.

Change-Id: Idd6ddd7ac219afb0df055a692632678b66373764
---
M Transceiver52M/Transceiver.cpp
M Transceiver52M/sigProcLib.cpp
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/39/2139/3

diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 3f624d0..85dd629 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -962,6 +962,9 @@
   if (!rxBurst)
 return;
 
+  // Convert -1..+1 soft bits to 0..1 soft bits
+  vectorSlicer(rxBurst);
+
   /*
* EDGE demodulator returns 444 (148 * 3) bits
*/
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index d82157e..9ea81c1 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -2069,8 +2069,6 @@
   bits = signalToSoftVector(dec);
   delete dec;
 
-  vectorSlicer(bits);
-
   return bits;
 }
 
@@ -2100,7 +2098,6 @@
 
   /* Soft slice and normalize */
   bits = softSliceEdgeBurst(*rot);
-  vectorSlicer(bits);
 
   delete dec;
   delete eq;

-- 
To view, visit https://gerrit.osmocom.org/2139
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Idd6ddd7ac219afb0df055a692632678b66373764
Gerrit-PatchSet: 3
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>


[MERGED] osmo-trx[master]: sigProcLib: Slice SoftVector instead of signalVector for GMS...

2017-03-22 Thread Alexander Chemeris
Alexander Chemeris has submitted this change and it was merged.

Change subject: sigProcLib: Slice SoftVector instead of signalVector for GMSK 
demod.
..


sigProcLib: Slice SoftVector instead of signalVector for GMSK demod.

This makes it similar to 8-PSK demod and also saves a bit of lines ofcode and
should give us a tiny improvement in performance.

Ideally we need to remove vector slicing at all, because in osmo-bts-trx
we convert back to +-1.0 again (actually to +-127, but it doesn't mater).
So we should rather transmit +-1.0 values to avoid double conversion.

Change-Id: If9ed6f0f80fbe88c994b2f9c3cae91d0d57f4442
---
M Transceiver52M/sigProcLib.cpp
M Transceiver52M/sigProcLib.h
2 files changed, 22 insertions(+), 26 deletions(-)

Approvals:
  Tom Tsou: Looks good to me, approved
  Max: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index 0a1fd44..56a1a58 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -737,20 +737,6 @@
   return true;
 }
 
-bool vectorSlicer(signalVector *x)
-{
-
-  signalVector::iterator xP = x->begin();
-  signalVector::iterator xPEnd = x->end();
-  while (xP < xPEnd) {
-*xP = (complex) (0.5*(xP->real()+1.0F));
-if (xP->real() > 1.0) *xP = 1.0;
-if (xP->real() < 0.0) *xP = 0.0;
-xP++;
-  }
-  return true;
-}
-
 static signalVector *rotateBurst(const BitVector ,
  int guardPeriodLength, int sps)
 {
@@ -2020,6 +2006,22 @@
 }
 
 /*
+ * Convert signalVector to SoftVector by taking real part of the signal.
+ */
+static SoftVector *signalToSoftVector(signalVector *dec)
+{
+  SoftVector *bits = new SoftVector(dec->size());
+
+  SoftVector::iterator bit_itr = bits->begin();
+  signalVector::iterator burst_itr = dec->begin();
+
+  for (; burst_itr < dec->end(); burst_itr++)
+*bit_itr++ = burst_itr->real();
+
+  return bits;
+}
+
+/*
  * Shared portion of GMSK and EDGE demodulators consisting of timing
  * recovery and single tap channel correction. For 4 SPS (if activated),
  * the output is downsampled prior to the 1 SPS modulation specific
@@ -2062,18 +2064,12 @@
 
   /* Shift up by a quarter of a frequency */
   GMSKReverseRotate(*dec, 1);
-  vectorSlicer(dec);
-
-  bits = new SoftVector(dec->size());
-
-  SoftVector::iterator bit_itr = bits->begin();
-  signalVector::iterator burst_itr = dec->begin();
-
-  for (; burst_itr < dec->end(); burst_itr++)
-*bit_itr++ = burst_itr->real();
-
+  /* Take real part of the signal */
+  bits = signalToSoftVector(dec);
   delete dec;
 
+  vectorSlicer(bits);
+
   return bits;
 }
 
diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h
index 7dca71f..ed72430 100644
--- a/Transceiver52M/sigProcLib.h
+++ b/Transceiver52M/sigProcLib.h
@@ -101,8 +101,8 @@
unsigned startIx = 0,
unsigned len = 0);
 
-/** Operate soft slicer on real-valued portion of vector */ 
-bool vectorSlicer(signalVector *x);
+/** Operate soft slicer on a soft-bit vector */
+bool vectorSlicer(SoftVector *x);
 
 /** GMSK modulate a GSM burst of bits */
 signalVector *modulateBurst(const BitVector ,

-- 
To view, visit https://gerrit.osmocom.org/2138
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If9ed6f0f80fbe88c994b2f9c3cae91d0d57f4442
Gerrit-PatchSet: 3
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>


[MERGED] osmo-trx[master]: BitVector: Remove convolutional codec - we don't use it in o...

2017-03-22 Thread Alexander Chemeris
Alexander Chemeris has submitted this change and it was merged.

Change subject: BitVector: Remove convolutional codec - we don't use it in 
osmo-trx.
..


BitVector: Remove convolutional codec - we don't use it in osmo-trx.

Now we have more fexibility in how we represent SoftVector, since we
no longer depend on the particular convolutional codec implementation.

Change-Id: I3006b6a26c5eff59dbe9c034f689961802f1d0d0
---
M CommonLibs/BitVector.cpp
M CommonLibs/BitVector.h
M CommonLibs/BitVectorTest.cpp
3 files changed, 1 insertion(+), 411 deletions(-)

Approvals:
  Tom Tsou: Looks good to me, approved
  Max: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/CommonLibs/BitVector.cpp b/CommonLibs/BitVector.cpp
index 8389237..b77a4c4 100644
--- a/CommonLibs/BitVector.cpp
+++ b/CommonLibs/BitVector.cpp
@@ -217,30 +217,6 @@
 }
 
 
-void BitVector::encode(const ViterbiR2O4& coder, BitVector& target)
-{
-   size_t sz = size();
-   assert(sz*coder.iRate() == target.size());
-
-   // Build a "history" array where each element contains the full history.
-   uint32_t history[sz];
-   uint32_t accum = 0;
-   for (size_t i=0; i<sz; i++) {
-   accum = (accum<<1) | bit(i);
-   history[i] = accum;
-   }
-
-   // Look up histories in the pre-generated state table.
-   char *op = target.begin();
-   for (size_t i=0; i<sz; i++) {
-   unsigned index = coder.cMask() & history[i];
-   for (unsigned g=0; g<coder.iRate(); g++) {
-   *op++ = coder.stateTable(g,index);
-   }
-   }
-}
-
-
 
 unsigned BitVector::sum() const
 {
@@ -287,142 +263,6 @@
 
 
 
-ViterbiR2O4::ViterbiR2O4()
-{
-   assert(mDeferral < 32);
-   mCoeffs[0] = 0x019;
-   mCoeffs[1] = 0x01b;
-   computeStateTables(0);
-   computeStateTables(1);
-   computeGeneratorTable();
-}
-
-
-
-
-void ViterbiR2O4::initializeStates()
-{
-   for (unsigned i=0; i<mIStates; i++) clear(mSurvivors[i]);
-   for (unsigned i=0; i<mNumCands; i++) clear(mCandidates[i]);
-}
-
-
-
-void ViterbiR2O4::computeStateTables(unsigned g)
-{
-   assert(g<mIRate);
-   for (unsigned state=0; state<mIStates; state++) {
-   // 0 input
-   uint32_t inputVal = state<<1;
-   mStateTable[g][inputVal] = applyPoly(inputVal, mCoeffs[g], 
mOrder+1);
-   // 1 input
-   inputVal |= 1;
-   mStateTable[g][inputVal] = applyPoly(inputVal, mCoeffs[g], 
mOrder+1);
-   }
-}
-
-void ViterbiR2O4::computeGeneratorTable()
-{
-   for (unsigned index=0; index<mIStates*2; index++) {
-   mGeneratorTable[index] = (mStateTable[0][index]<<1) | 
mStateTable[1][index];
-   }
-}
-
-
-
-
-
-
-void ViterbiR2O4::branchCandidates()
-{
-   // Branch to generate new input states.
-   const vCand *sp = mSurvivors;
-   for (unsigned i=0; i<mNumCands; i+=2) {
-   // extend and suffix
-   const uint32_t iState0 = (sp->iState) << 1; 
// input state for 0
-   const uint32_t iState1 = iState0 | 0x01;
// input state for 1
-   const uint32_t oStateShifted = (sp->oState) << mIRate;  // 
shifted output
-   const float cost = sp->cost;
-   sp++;
-   // 0 input extension
-   mCandidates[i].cost = cost;
-   mCandidates[i].oState = oStateShifted | mGeneratorTable[iState0 
& mCMask];
-   mCandidates[i].iState = iState0;
-   // 1 input extension
-   mCandidates[i+1].cost = cost;
-   mCandidates[i+1].oState = oStateShifted | 
mGeneratorTable[iState1 & mCMask];
-   mCandidates[i+1].iState = iState1;
-   }
-}
-
-
-void ViterbiR2O4::getSoftCostMetrics(const uint32_t inSample, const float 
*matchCost, const float *mismatchCost)
-{
-   const float *cTab[2] = {matchCost,mismatchCost};
-   for (unsigned i=0; i<mNumCands; i++) {
-   vCand& thisCand = mCandidates[i];
-   // We examine input bits 2 at a time for a rate 1/2 coder.
-   const unsigned mismatched = inSample ^ (thisCand.oState);
-   thisCand.cost += cTab[mismatched&0x01][1] + 
cTab[(mismatched>>1)&0x01][0];
-   }
-}
-
-
-void ViterbiR2O4::pruneCandidates()
-{
-   const vCand* c1 = mCandidates;  // 
0-prefix
-   const vCand* c2 = mCandidates + mIStates;   // 1-prefix
-   for (unsigned i=0; i<mIStates; i++) {
-   if (c1[i].cost < c2[i].cost) mSurvivors[i] = c1[i];
-   else mSurvivors[i] = c2[i];
-   }
-}
-
-
-const ViterbiR2O4::vCand& 

[MERGED] osmo-trx[master]: BitVector: Convert SoftVector from 0..1 to -1..+1 soft bits.

2017-03-22 Thread Alexander Chemeris
Alexander Chemeris has submitted this change and it was merged.

Change subject: BitVector: Convert SoftVector from 0..1 to -1..+1 soft bits.
..


BitVector: Convert SoftVector from 0..1 to -1..+1 soft bits.

This makes code simpler and will allow us send -127..127 soft bits towards
osmo-bts instead of 0..255 bits.

Change-Id: I16ecc3d4c829dcf0f619ad995bc9d4a4ed8af0a4
---
M CommonLibs/BitVector.cpp
M CommonLibs/BitVector.h
2 files changed, 13 insertions(+), 13 deletions(-)

Approvals:
  Tom Tsou: Looks good to me, approved
  Max: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/CommonLibs/BitVector.cpp b/CommonLibs/BitVector.cpp
index b77a4c4..3b556b9 100644
--- a/CommonLibs/BitVector.cpp
+++ b/CommonLibs/BitVector.cpp
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace std;
 
@@ -268,7 +269,7 @@
resize(source.size());
for (size_t i=0; i<size(); i++) {
if (source.bit(i)) mStart[i]=1.0F;
-   else mStart[i]=0.0F;
+   else mStart[i]=-1.0F;
}
 }
 
@@ -278,7 +279,7 @@
size_t sz = size();
BitVector newSig(sz);
for (size_t i=0; i<sz; i++) {
-   if (mStart[i]>0.5F) newSig[i]=1;
+   if (mStart[i]>0.0F) newSig[i]=1;
else newSig[i] = 0;
}
return newSig;
@@ -291,8 +292,7 @@
int len = vec.size();
float avg = 0; float low = 1;
for (int i = 0; i < len; i++) {
-   float bit = vec[i];
-   float energy = 2*((bit < 0.5) ? (0.5-bit) : (bit-0.5));
+   float energy = fabsf(vec[i]);
if (energy < low) low = energy;
avg += energy/len;
}
@@ -304,12 +304,12 @@
 ostream& operator<<(ostream& os, const SoftVector& sv)
 {
for (size_t i=0; i<sv.size(); i++) {
-   if (sv[i]<0.25) os << "0";
-   else if (sv[i]<0.4) os << "o";
-   else if (sv[i]<0.5) os << ".";
-   else if (sv[i]>0.75) os << "1";
-   else if (sv[i]>0.6) os << "|";
-   else if (sv[i]>0.5) os << "'";
+   if (sv[i]<-0.5) os << "0";
+   else if (sv[i]<-0.25) os << "o";
+   else if (sv[i]<0.0) os << ".";
+   else if (sv[i]>0.5) os << "1";
+   else if (sv[i]>0.25) os << "|";
+   else if (sv[i]>0.0) os << "'";
else os << "-";
}
return os;
diff --git a/CommonLibs/BitVector.h b/CommonLibs/BitVector.h
index 7473c32..d2acb5f 100644
--- a/CommonLibs/BitVector.h
+++ b/CommonLibs/BitVector.h
@@ -290,19 +290,19 @@
//@}
 
// How good is the SoftVector in the sense of the bits being solid?
-   // Result of 1 is perfect and 0 means all the bits were 0.5
+   // Result of 1 is perfect and 0 means all the bits were 0.0
// If plow is non-NULL, also return the lowest energy bit.
float getEnergy(float *low=0) const;
 
/** Fill with "unknown" values. */
-   void unknown() { fill(0.5F); }
+   void unknown() { fill(0.0F); }
 
/** Return a hard bit value from a given index by slicing. */
bool bit(size_t index) const
{
const float *dp = mStart+index;
assert(dp<mEnd);
-   return (*dp)>0.5F;
+   return (*dp)>0.0F;
}
 
/** Slice the whole signal into bits. */

-- 
To view, visit https://gerrit.osmocom.org/2142
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I16ecc3d4c829dcf0f619ad995bc9d4a4ed8af0a4
Gerrit-PatchSet: 3
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>


[MERGED] osmo-trx[master]: Call vectorSlicer() right before packing bits for transmissi...

2017-03-22 Thread Alexander Chemeris
Alexander Chemeris has submitted this change and it was merged.

Change subject: Call vectorSlicer() right before packing bits for transmission 
to osmo-bts.
..


Call vectorSlicer() right before packing bits for transmission to osmo-bts.

vectorSlicer() converts soft-bits from -1..+1 to 0..1 while we want
to keep SoftVector in -1..+1 mode until the last minute, because at some
point we'll want to transmit -1..+1 to osmo-bts instead of converting it
from 0..1 back to -1..+1 on the osmo-bts side.

Plus it removes code duplication - we call it once instead of twice.

Change-Id: Idd6ddd7ac219afb0df055a692632678b66373764
---
M Transceiver52M/Transceiver.cpp
M Transceiver52M/sigProcLib.cpp
2 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Tom Tsou: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 3f624d0..85dd629 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -962,6 +962,9 @@
   if (!rxBurst)
 return;
 
+  // Convert -1..+1 soft bits to 0..1 soft bits
+  vectorSlicer(rxBurst);
+
   /*
* EDGE demodulator returns 444 (148 * 3) bits
*/
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index 56a1a58..6f50f04 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -2068,8 +2068,6 @@
   bits = signalToSoftVector(dec);
   delete dec;
 
-  vectorSlicer(bits);
-
   return bits;
 }
 
@@ -2099,7 +2097,6 @@
 
   /* Soft slice and normalize */
   bits = softSliceEdgeBurst(*rot);
-  vectorSlicer(bits);
 
   delete dec;
   delete eq;

-- 
To view, visit https://gerrit.osmocom.org/2139
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Idd6ddd7ac219afb0df055a692632678b66373764
Gerrit-PatchSet: 4
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>


[MERGED] osmo-trx[master]: sigProcLib: make energyDetect() simpler by returning actual ...

2017-03-22 Thread Alexander Chemeris
Alexander Chemeris has submitted this change and it was merged.

Change subject: sigProcLib: make energyDetect() simpler by returning actual 
energy.
..


sigProcLib: make energyDetect() simpler by returning actual energy.

Change-Id: I9bf97f2dc03fea9bebcf43198dfb05f6e4694e9c
---
M Transceiver52M/Transceiver.cpp
M Transceiver52M/sigProcLib.cpp
M Transceiver52M/sigProcLib.h
3 files changed, 9 insertions(+), 17 deletions(-)

Approvals:
  Tom Tsou: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index f156ad4..3df482f 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -606,7 +606,7 @@
 {
   int rc;
   complex amp;
-  float toa, pow, max = -1.0, avg = 0.0;
+  float toa, max = -1.0, avg = 0.0;
   int max_i = -1;
   signalVector *burst;
   SoftVector *bits = NULL;
@@ -641,7 +641,7 @@
 
   /* Select the diversity channel with highest energy */
   for (size_t i = 0; i < radio_burst->chans(); i++) {
-energyDetect(*radio_burst->getVector(i), 20 * mSPSRx, 0.0, );
+float pow = energyDetect(*radio_burst->getVector(i), 20 * mSPSRx);
 if (pow > max) {
   max = pow;
   max_i = i;
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index c1cf12e..41b18cf 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -1721,10 +1721,7 @@
   return (amp.abs()) / rms;
 }
 
-bool energyDetect(signalVector ,
- unsigned windowLength,
- float detectThreshold,
-  float *avgPwr)
+float energyDetect(signalVector , unsigned windowLength)
 {
 
   signalVector::const_iterator windowItr = rxBurst.begin(); 
//+rxBurst.size()/2 - 5*windowLength/2;
@@ -1735,8 +1732,7 @@
 energy += windowItr->norm2();
 windowItr+=4;
   }
-  if (avgPwr) *avgPwr = energy/windowLength;
-  return (energy/windowLength > detectThreshold*detectThreshold);
+  return energy/windowLength;
 }
 
 /*
diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h
index 1b646cd..87c0229 100644
--- a/Transceiver52M/sigProcLib.h
+++ b/Transceiver52M/sigProcLib.h
@@ -176,17 +176,13 @@
 complex scale);
 
 /**
-Energy detector, checks to see if received burst energy is above a 
threshold.
-@param rxBurst The received GSM burst of interest.
+Rough energy estimator.
+@param rxBurst A GSM burst.
 @param windowLength The number of burst samples used to compute burst 
energy
-@param detectThreshold The detection threshold, a linear value.
-@param avgPwr The average power of the received burst.
-@return True if burst energy is above threshold.
+@return The average power of the received burst.
 */
-bool energyDetect(signalVector ,
- unsigned windowLength,
-  float detectThreshold,
-  float *avgPwr = NULL);
+float energyDetect(signalVector ,
+   unsigned windowLength);
 
 /**
 RACH aka Access Burst correlator/detector.

-- 
To view, visit https://gerrit.osmocom.org/2136
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9bf97f2dc03fea9bebcf43198dfb05f6e4694e9c
Gerrit-PatchSet: 2
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>


[PATCH] osmo-trx[master]: Move CorrType type from Transceiver to sigProcLib.

2017-03-22 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/2146

Move CorrType type from Transceiver to sigProcLib.

Required to move Transceiver::detectBurst to sigProcLib.

Change-Id: I3e0e74a98bbca4d19657f50a5fb447f078663c9b
---
M Transceiver52M/Transceiver.cpp
M Transceiver52M/Transceiver.h
M Transceiver52M/sigProcLib.h
3 files changed, 12 insertions(+), 12 deletions(-)


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

diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 85dd629..c1a63fd 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -113,7 +113,7 @@
 
 if ((filler == Transceiver::FILLER_NORM_RAND) ||
 (filler == Transceiver::FILLER_EDGE_RAND)) {
-chanType[n] = Transceiver::TSC;
+chanType[n] = TSC;
 }
   }
 
@@ -452,8 +452,8 @@
 }
 
 
-Transceiver::CorrType Transceiver::expectedCorrType(GSM::Time currTime,
-size_t chan)
+CorrType Transceiver::expectedCorrType(GSM::Time currTime,
+   size_t chan)
 {
   static int tchh_subslot[26] = { 
0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,1 };
   static int sdcch4_subslot[102] = { 
3,3,3,3,0,0,2,2,2,2,3,3,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,2,2,2,2,
diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h
index d9a9708..425b004 100644
--- a/Transceiver52M/Transceiver.h
+++ b/Transceiver52M/Transceiver.h
@@ -142,15 +142,6 @@
 LOOPBACK///< similar go VII, used in loopback testing
   } ChannelCombination;
 
-  /** Codes for burst types of received bursts*/
-  typedef enum {
-OFF,   ///< timeslot is off
-TSC,  ///< timeslot should contain a normal burst
-RACH, ///< timeslot should contain an access burst
-EDGE, ///< timeslot should contain an EDGE burst
-IDLE  ///< timeslot is an idle (or dummy) burst
-  } CorrType;
-
   enum FillerType {
 FILLER_DUMMY,
 FILLER_ZERO,
diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h
index ed72430..211e1a9 100644
--- a/Transceiver52M/sigProcLib.h
+++ b/Transceiver52M/sigProcLib.h
@@ -33,6 +33,15 @@
   UNDEFINED,
 };
 
+/** Codes for burst types of received bursts*/
+enum CorrType{
+  OFF, ///< timeslot is off
+  TSC, ///< timeslot should contain a normal burst
+  RACH,///< timeslot should contain an access burst
+  EDGE,///< timeslot should contain an EDGE burst
+  IDLE ///< timeslot is an idle (or dummy) burst
+};
+
 enum signalError {
   SIGERR_NONE,
   SIGERR_BOUNDS,

-- 
To view, visit https://gerrit.osmocom.org/2146
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e0e74a98bbca4d19657f50a5fb447f078663c9b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


[PATCH] osmo-trx[master]: Move Transceiver::demodulate() to sigProcLib to make it reus...

2017-03-22 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/2152

Move Transceiver::demodulate() to sigProcLib to make it reusable.

Change-Id: I2cad47160e53f65612bd1da8998c83a0a22bce9b
---
M Transceiver52M/Transceiver.cpp
M Transceiver52M/Transceiver.h
M Transceiver52M/sigProcLib.cpp
M Transceiver52M/sigProcLib.h
4 files changed, 14 insertions(+), 17 deletions(-)


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

diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 1ae9f93..65e1c61 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -533,18 +533,6 @@
   }
 }
 
-/*
- * Demodulate GMSK by direct rotation and soft slicing.
- */
-SoftVector *Transceiver::demodulate(signalVector , complex amp,
-float toa, CorrType type)
-{
-  if (type == EDGE)
- return demodEdgeBurst(burst, mSPSRx, amp, toa);
-
-  return demodGmskBurst(burst, mSPSRx, amp, toa);
-}
-
 void writeToFile(radioVector *radio_burst, size_t chan)
 {
   GSM::Time time = radio_burst->getTime();
@@ -656,7 +644,7 @@
 
   timingOffset = toa;
 
-  bits = demodulate(*burst, amp, toa, type);
+  bits = demodAnyBurst(*burst, mSPSRx, amp, toa, type);
 
   delete radio_burst;
   return bits;
diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h
index 3c70e5c..6f9cb92 100644
--- a/Transceiver52M/Transceiver.h
+++ b/Transceiver52M/Transceiver.h
@@ -202,10 +202,6 @@
   /** send messages over the clock socket */
   void writeClockInterface(void);
 
-  /** Demodulate burst and output soft bits */
-  SoftVector *demodulate(signalVector ,
- complex amp, float toa, CorrType type);
-
   int mSPSTx;  ///< number of samples per Tx symbol
   int mSPSRx;  ///< number of samples per Rx symbol
   size_t mChans;
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index 5995845..ece6fa0 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -2137,6 +2137,15 @@
   return bits;
 }
 
+SoftVector *demodAnyBurst(signalVector , int sps, complex amp,
+  float toa, CorrType type)
+{
+  if (type == EDGE)
+return demodEdgeBurst(burst, sps, amp, toa);
+  else
+return demodGmskBurst(burst, sps, amp, toa);
+}
+
 bool sigProcLibSetup()
 {
   initTrigTables();
diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h
index 285b977..fe50508 100644
--- a/Transceiver52M/sigProcLib.h
+++ b/Transceiver52M/sigProcLib.h
@@ -327,4 +327,8 @@
 SoftVector *demodEdgeBurst(signalVector , int sps,
complex channel, float TOA);
 
+/** Demodulate burst basde on type and output soft bits */
+SoftVector *demodAnyBurst(signalVector , int sps,
+  complex amp, float toa, CorrType type);
+
 #endif /* SIGPROCLIB_H */

-- 
To view, visit https://gerrit.osmocom.org/2152
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2cad47160e53f65612bd1da8998c83a0a22bce9b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


[PATCH] osmo-trx[master]: Move BURST_THRESH from Transceiver.cpp to sigProcLib.h to ma...

2017-03-22 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/2149

Move BURST_THRESH from Transceiver.cpp to sigProcLib.h to make it reusable.

Change-Id: I5a90e26858c0fbb2ddb7ef23cb0fd66a64b4
---
M Transceiver52M/Transceiver.cpp
M Transceiver52M/sigProcLib.h
2 files changed, 9 insertions(+), 9 deletions(-)


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

diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 6b50981..1ae9f93 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -44,15 +44,6 @@
 /* Number of running values use in noise average */
 #define NOISE_CNT  20
 
-/*
- * Burst detection threshold
- *
- * Decision threshold value for burst gating on peak-to-average value of
- * correlated synchronization sequences. Lower values pass more bursts up
- * to upper layers but will increase the false detection rate.
- */
-#define BURST_THRESH   4.0
-
 TransceiverState::TransceiverState()
   : mRetrans(false), mNoiseLev(0.0), mNoises(NOISE_CNT), mPower(0.0)
 {
diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h
index 8b7f4af..bea9c4a 100644
--- a/Transceiver52M/sigProcLib.h
+++ b/Transceiver52M/sigProcLib.h
@@ -50,6 +50,15 @@
   SIGERR_INTERNAL,
 };
 
+/*
+ * Burst detection threshold
+ *
+ * Decision threshold value for burst gating on peak-to-average value of
+ * correlated synchronization sequences. Lower values pass more bursts up
+ * to upper layers but will increase the false detection rate.
+ */
+#define BURST_THRESH4.0
+
 /** Convert a linear number to a dB value */
 float dB(float x);
 

-- 
To view, visit https://gerrit.osmocom.org/2149
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a90e26858c0fbb2ddb7ef23cb0fd66a64b4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


[PATCH] osmo-trx[master]: sigProcLib: constify signalVector arguments for detectBurst(...

2017-03-22 Thread Alexander Chemeris
ror,
 zero (SIGERR_NONE) if no burst is detected
 */
-int analyzeTrafficBurst(signalVector ,
+int analyzeTrafficBurst(const signalVector ,
 unsigned tsc,
 float threshold,
 int sps,
@@ -257,7 +257,7 @@
 negative value (-SignalError) on error,
 zero (SIGERR_NONE) if no burst is detected
 */
-int detectEdgeBurst(signalVector ,
+int detectEdgeBurst(const signalVector ,
 unsigned tsc,
 float threshold,
 int sps,
@@ -279,7 +279,7 @@
 negative value (-SignalError) on error,
 zero (SIGERR_NONE) if no burst is detected
 */
-int detectAnyBurst(signalVector ,
+int detectAnyBurst(const signalVector ,
unsigned tsc,
float threshold,
int sps,
@@ -294,7 +294,7 @@
 @param burst Input burst of at least 624 symbols
 @return Decimated signal vector of 156 symbols
 */
-signalVector *downsampleBurst(signalVector );
+signalVector *downsampleBurst(const signalVector );
 
 /**
 Decimate a vector.

-- 
To view, visit https://gerrit.osmocom.org/2153
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic033371a387353eb12b1827a0eb16c00c07da88a
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


[PATCH] osmo-trx[master]: signalVector: Implement segment().

2017-03-22 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/2155

signalVector: Implement segment().

Change-Id: I6fe3aae53fb2fa5bb7637e976de6059eabe08202
---
M Transceiver52M/signalVector.cpp
M Transceiver52M/signalVector.h
2 files changed, 8 insertions(+), 0 deletions(-)


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

diff --git a/Transceiver52M/signalVector.cpp b/Transceiver52M/signalVector.cpp
index 798a3c7..55dad92 100644
--- a/Transceiver52M/signalVector.cpp
+++ b/Transceiver52M/signalVector.cpp
@@ -45,6 +45,11 @@
mStart = mData + vector.getStart();
 }
 
+signalVector signalVector::segment(size_t start, size_t span)
+{
+   return signalVector(mData, start, span);
+}
+
 size_t signalVector::getStart() const
 {
return mStart - mData;
diff --git a/Transceiver52M/signalVector.h b/Transceiver52M/signalVector.h
index 38541fe..83f141e 100644
--- a/Transceiver52M/signalVector.h
+++ b/Transceiver52M/signalVector.h
@@ -30,6 +30,9 @@
/** Override base assignment operator to include start offsets */
void operator=(const signalVector& vector);
 
+   /** Return an alias to a segment of this signalVector. */
+   signalVector segment(size_t start, size_t span);
+
/** Return head room */
size_t getStart() const;
size_t updateHistory();

-- 
To view, visit https://gerrit.osmocom.org/2155
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6fe3aae53fb2fa5bb7637e976de6059eabe08202
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


[PATCH] osmo-trx[master]: CommonLibs: Remove unused files.

2017-03-17 Thread Alexander Chemeris
   // for sqrtf
-#include "Logger.h"
-
-
-namespace Utils {
-
-extern double timef(); // high resolution time
-extern const std::string timestr();// A timestamp to print in 
messages.
-extern void sleepf(double howlong);// high resolution sleep
-extern int gcd(int x, int y);
-
-// It is irritating to create a string just to interface to the brain-damaged
-// C++ stream class, but this is only used for debug messages.
-std::string format(const char *fmt, ...) __attribute__((format (printf,1,2)));
-
-int cstrSplit(char *in, char **pargv,int maxargc, const char *splitchars=NULL);
-
-// For classes with a text() function, provide a function to return a String,
-// and also a standard << stream function that takes a pointer to the object.
-// We dont provide the function that takes a reference to the object
-// because it is too highly overloaded and generally doesnt work.
-class Text2Str {
-   public:
-   virtual void text(std::ostream ) const = 0;
-   std::string str() const;
-};
-std::ostream& operator<<(std::ostream& os, const Text2Str *val);
-
-#if 0
-// Generic Activity Timer.  Lots of controls to make everybody happy.
-class ATimer {
-   double mStart;
-   //bool mActive;
-   double mLimitTime;
-   public:
-   ATimer() : mStart(0), mLimitTime(0) { }
-   ATimer(double wLimitTime) : mStart(0), mLimitTime(wLimitTime) { }
-   void start() { mStart=timef(); }
-   void stop() { mStart=0; }
-   bool active() { return !!mStart; }
-   double elapsed() { return timef() - mStart; }
-   bool expired() { return elapsed() > mLimitTime; }
-};
-#endif
-
-
-struct BitSet {
-   unsigned mBits;
-   void setBit(unsigned whichbit) { mBits |= 1<<whichbit; }
-   void clearBit(unsigned whichbit) { mBits &= ~(1<<whichbit); }
-   unsigned getBit(unsigned whichbit) const { return mBits & 
(1<<whichbit); }
-   bool isSet(unsigned whichbit) const { return mBits & (1<<whichbit); }
-   unsigned bits() const { return mBits; }
-   operator int(void) const { return mBits; }
-   BitSet() { mBits = 0; }
-};
-
-// Store current, min, max and compute running average and standard deviation.
-template struct Statistic {
-   Type mCurrent, mMin, mMax;  // min,max optional 
initialization so you can print before adding any values.
-   unsigned mCnt;
-   double mSum;
-   //double mSum2; // sum of squares.
-   // (Type) cast needed in case Type is an enum, stupid language.
-   Statistic() : mCurrent((Type)0), mMin((Type)0), mMax((Type)0), mCnt(0), 
mSum(0) /*,mSum2(0)*/ {}
-   // Set the current value and add a statisical point.
-   void addPoint(Type val) {
-   mCurrent = val;
-   if (mCnt == 0 || val < mMin) {mMin = val;}
-   if (mCnt == 0 || val > mMax) {mMax = val;}
-   mCnt++;
-   mSum += val;
-   //mSum2 += val * val;
-   }
-   Type getCurrent() const {   // Return current value.
-   return mCnt ? mCurrent : 0;
-   }
-   double getAvg() const { // Return average.
-   return mCnt==0 ? 0 : mSum/mCnt; 
-   };
-   //float getSD() const { // Return standard deviation.  Use low 
precision square root function.
-   //  return mCnt==0 ? 0 : sqrtf(mCnt * mSum2 - mSum*mSum) / mCnt;
-   //}
-
-   void text(std::ostream ) const { // Print everything in parens.
-   os << "("<<mCurrent;
-   if (mMin != mMax) { // Not point in printing all this stuff 
if min == max.
-   os 
<<LOGVAR2("min",mMin)<<LOGVAR2("max",mMax)<<LOGVAR2("avg",getAvg());
-   if (mCnt <= 99) {
-   os <<LOGVAR2("N",mCnt);
-   } else { // Shorten this up:
-   char buf[10], *ep;
-   sprintf(buf,"%.3g",round(mCnt));
-   if ((ep = strchr(buf,'e')) && ep[1] == '+') { 
strcpy(ep+1,ep+2); }
-   os << LOGVAR2("N",buf);
-   }
-   // os<<LOGVAR2("sd",getSD())  standard deviation not 
interesting
-   }
-   os << ")";
-   // " min="< );
-std::ostream& operator<<(std::ostream& os, const Statistic );
-std::ostream& operator<<(std::ostream& os, const Statistic );
-std::ostream& operator<<(std::ostream& os, const Statistic );
-
-
-// Yes, they botched and left this out:
-std::ostream& operator<<(std::ostream& os, std::ostringstream& ss);
-
-std::ostream (std::ostream , const char *fmt, ...) 
__attribute__((format (printf,2,3)));
-
-std::string replaceAll(const std::string input, const std::string search, 
const std::string replace);
-
-}; // namespace
-
-using namespace Utils;
-
-#endif

-- 
To view, visit https://gerrit.osmocom.org/2125
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2bfb45a1c7d01785bdb30204dba38c683a4288a9
Gerrit-PatchSet: 2
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>


[PATCH] osmo-trx[master]: radioBuffer: Remove extra ; at the end of inline function de...

2017-03-17 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/2127

radioBuffer: Remove extra ; at the end of inline function definitions.

Change-Id: I8911adf0a0bb1ae828ac9cdf1a76c904639f6c06
---
M Transceiver52M/radioBuffer.h
1 file changed, 4 insertions(+), 4 deletions(-)


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

diff --git a/Transceiver52M/radioBuffer.h b/Transceiver52M/radioBuffer.h
index afb6e63..e5aa315 100644
--- a/Transceiver52M/radioBuffer.h
+++ b/Transceiver52M/radioBuffer.h
@@ -9,10 +9,10 @@
 
~RadioBuffer();
 
-   const size_t getSegmentLen() { return segmentLen; };
-   const size_t getNumSegments() { return numSegments; };
-   const size_t getAvailSamples() { return availSamples; };
-   const size_t getAvailSegments() { return availSamples / segmentLen; };
+   const size_t getSegmentLen() { return segmentLen; }
+   const size_t getNumSegments() { return numSegments; }
+   const size_t getAvailSamples() { return availSamples; }
+   const size_t getAvailSegments() { return availSamples / segmentLen; }
 
const size_t getFreeSamples()
{

-- 
To view, visit https://gerrit.osmocom.org/2127
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8911adf0a0bb1ae828ac9cdf1a76c904639f6c06
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


[PATCH] osmo-trx[master]: sigProcLib: Typo sybols -> symbols

2017-03-17 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/2126

sigProcLib: Typo sybols -> symbols

Change-Id: I8cbef852374d0458c4f4ad4be0df0aa998e3796a
---
M Transceiver52M/sigProcLib.cpp
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index a361eff..2a22e49 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -1124,7 +1124,7 @@
  * Modulate 8-PSK burst. When empty pulse shaping (rotation only)
  * is enabled, the output vector length will be bit sequence length
  * times the SPS value. When pulse shaping is enabled, the output
- * vector length is fixed at 625 samples (156.25 sybols at 4 SPS).
+ * vector length is fixed at 625 samples (156.25 symbols at 4 SPS).
  * Pulse shaped bit sequences that go beyond one burst are truncated.
  * Pulse shaping at anything but 4 SPS is not supported.
  */

-- 
To view, visit https://gerrit.osmocom.org/2126
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8cbef852374d0458c4f4ad4be0df0aa998e3796a
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


[PATCH] osmo-trx[master]: sigProcLib: Rename demodulateBurst() to demodGmskBurst() for...

2017-03-20 Thread Alexander Chemeris
Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/2137

to look at the new patch set (#2).

sigProcLib: Rename demodulateBurst() to demodGmskBurst() for clarity.

Change-Id: Ibcef8d7d4a2c06865bed7e4091ccc8dbbd494d77
---
M Transceiver52M/Transceiver.cpp
M Transceiver52M/sigProcLib.cpp
M Transceiver52M/sigProcLib.h
3 files changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/37/2137/2

diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 3df482f..3f624d0 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -583,7 +583,7 @@
   if (type == EDGE)
  return demodEdgeBurst(burst, mSPSRx, amp, toa);
 
-  return demodulateBurst(burst, mSPSRx, amp, toa);
+  return demodGmskBurst(burst, mSPSRx, amp, toa);
 }
 
 void writeToFile(radioVector *radio_burst, size_t chan)
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index f9e21f0..1653ee9 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -2051,7 +2051,7 @@
  * 4 SPS (if activated) to minimize distortion through the fractional
  * delay filters. Symbol rotation and after always operates at 1 SPS.
  */
-SoftVector *demodulateBurst(signalVector , int sps,
+SoftVector *demodGmskBurst(signalVector , int sps,
 complex channel, float TOA)
 {
   SoftVector *bits;
diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h
index 87c0229..7dca71f 100644
--- a/Transceiver52M/sigProcLib.h
+++ b/Transceiver52M/sigProcLib.h
@@ -261,16 +261,16 @@
 signalVector *decimateVector(signalVector , size_t factor);
 
 /**
-Demodulates a received burst using a soft-slicer.
-   @param rxBurst The burst to be demodulated.
+Demodulates a GMSK burst using a soft-slicer.
+@param rxBurst The burst to be demodulated.
 @param gsmPulse The GSM pulse.
 @param sps The number of samples per GSM symbol.
 @param channel The amplitude estimate of the received burst.
 @param TOA The time-of-arrival of the received burst.
 @return The demodulated bit sequence.
 */
-SoftVector *demodulateBurst(signalVector , int sps,
-complex channel, float TOA);
+SoftVector *demodGmskBurst(signalVector , int sps,
+   complex channel, float TOA);
 
 /**
 Demodulate 8-PSK EDGE burst with soft symbol ooutput

-- 
To view, visit https://gerrit.osmocom.org/2137
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibcef8d7d4a2c06865bed7e4091ccc8dbbd494d77
Gerrit-PatchSet: 2
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmo-trx[master]: CommonLibs: Print soft bits with less confidence to console ...

2017-03-20 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/2140

CommonLibs: Print soft bits with less confidence to console when printing a 
soft vector.

We use other symbols to show that these bits has less confidence:
o and . for 0 with less confidence
| and ' for 1 with less confidence

Change-Id: I747a17568ee48f1f3163e8dfab2e450af85e6435
---
M CommonLibs/BitVector.cpp
1 file changed, 4 insertions(+), 0 deletions(-)


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

diff --git a/CommonLibs/BitVector.cpp b/CommonLibs/BitVector.cpp
index 7487834..8389237 100644
--- a/CommonLibs/BitVector.cpp
+++ b/CommonLibs/BitVector.cpp
@@ -546,7 +546,11 @@
 {
for (size_t i=0; i<sv.size(); i++) {
if (sv[i]<0.25) os << "0";
+   else if (sv[i]<0.4) os << "o";
+   else if (sv[i]<0.5) os << ".";
else if (sv[i]>0.75) os << "1";
+   else if (sv[i]>0.6) os << "|";
+   else if (sv[i]>0.5) os << "'";
else os << "-";
}
return os;

-- 
To view, visit https://gerrit.osmocom.org/2140
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I747a17568ee48f1f3163e8dfab2e450af85e6435
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


[PATCH] osmo-trx[master]: BitVector: Remove convolutional codec - we don't use it in o...

2017-03-20 Thread Alexander Chemeris
) const;
/** Calculate the parity word for the vector with the given Generator. 
*/
uint64_t parity(Generator& gen) const;
-   /** Encode the signal with the GSM rate 1/2 convolutional encoder. */
-   void encode(const ViterbiR2O4& encoder, BitVector& target);
//@}
 
 
@@ -427,10 +289,7 @@
const SoftVector tail(size_t start) const { return 
segment(start,size()-start); }
//@}
 
-   /** Decode soft symbols with the GSM rate-1/2 Viterbi decoder. */
-   void decode(ViterbiR2O4 , BitVector& target) const;
-
-   // (pat) How good is the SoftVector in the sense of the bits being 
solid?
+   // How good is the SoftVector in the sense of the bits being solid?
// Result of 1 is perfect and 0 means all the bits were 0.5
// If plow is non-NULL, also return the lowest energy bit.
float getEnergy(float *low=0) const;
diff --git a/CommonLibs/BitVectorTest.cpp b/CommonLibs/BitVectorTest.cpp
index 5e487ad..063138f 100644
--- a/CommonLibs/BitVectorTest.cpp
+++ b/CommonLibs/BitVectorTest.cpp
@@ -35,27 +35,6 @@
 
 int main(int argc, char *argv[])
 {
-   BitVector v1("00001010");
-   cout << v1 << endl;
-   v1.LSB8MSB();
-   cout << v1 << endl;
-   ViterbiR2O4 vCoder;
-   BitVector v2(v1.size()*2);
-   v1.encode(vCoder,v2);
-   cout << v2 << endl;
-   SoftVector sv2(v2);
-   cout << sv2 << endl;
-   for (unsigned i=0; i<sv2.size()/4; i++) sv2[random()%sv2.size()]=0.5;
-   cout << sv2 << endl;
-   BitVector v3(v1.size());
-   sv2.decode(vCoder,v3);
-   cout << v3 << endl;
-
-   cout << v3.segment(3,4) << endl;
-
-   BitVector v4(v3.segment(0,4),v3.segment(8,4));
-   cout << v4 << endl;
-
BitVector v5("");
int r1 = v5.peekField(0,8);
int r2 = v5.peekField(4,4);
@@ -69,13 +48,6 @@
 
v5.reverse8();
cout << v5 << endl;
-
-   BitVector mC = 
"011101111101110001111001101010101010101010100111100110101010101010101010011101111010110001";
-   SoftVector mCS(mC);
-   BitVector mU(mC.size()/2);
-   mCS.decode(vCoder,mU);
-   cout << "c=" << mCS << endl;
-   cout << "u=" << mU << endl;
 
 
unsigned char ts[9] = "abcdefgh";

-- 
To view, visit https://gerrit.osmocom.org/2141
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3006b6a26c5eff59dbe9c034f689961802f1d0d0
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


[PATCH] osmo-trx[master]: BitVector: Convert SoftVector from 0..1 to -1..+1 soft bits.

2017-03-20 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/2142

BitVector: Convert SoftVector from 0..1 to -1..+1 soft bits.

This makes code simpler and will allow us send -127..127 soft bits towards
osmo-bts instead of 0..255 bits.

Change-Id: I16ecc3d4c829dcf0f619ad995bc9d4a4ed8af0a4
---
M CommonLibs/BitVector.cpp
M CommonLibs/BitVector.h
2 files changed, 13 insertions(+), 13 deletions(-)


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

diff --git a/CommonLibs/BitVector.cpp b/CommonLibs/BitVector.cpp
index b77a4c4..3b556b9 100644
--- a/CommonLibs/BitVector.cpp
+++ b/CommonLibs/BitVector.cpp
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace std;
 
@@ -268,7 +269,7 @@
resize(source.size());
for (size_t i=0; i<size(); i++) {
if (source.bit(i)) mStart[i]=1.0F;
-   else mStart[i]=0.0F;
+   else mStart[i]=-1.0F;
}
 }
 
@@ -278,7 +279,7 @@
size_t sz = size();
BitVector newSig(sz);
for (size_t i=0; i<sz; i++) {
-   if (mStart[i]>0.5F) newSig[i]=1;
+   if (mStart[i]>0.0F) newSig[i]=1;
else newSig[i] = 0;
}
return newSig;
@@ -291,8 +292,7 @@
int len = vec.size();
float avg = 0; float low = 1;
for (int i = 0; i < len; i++) {
-   float bit = vec[i];
-   float energy = 2*((bit < 0.5) ? (0.5-bit) : (bit-0.5));
+   float energy = fabsf(vec[i]);
if (energy < low) low = energy;
avg += energy/len;
}
@@ -304,12 +304,12 @@
 ostream& operator<<(ostream& os, const SoftVector& sv)
 {
for (size_t i=0; i<sv.size(); i++) {
-   if (sv[i]<0.25) os << "0";
-   else if (sv[i]<0.4) os << "o";
-   else if (sv[i]<0.5) os << ".";
-   else if (sv[i]>0.75) os << "1";
-   else if (sv[i]>0.6) os << "|";
-   else if (sv[i]>0.5) os << "'";
+   if (sv[i]<-0.5) os << "0";
+   else if (sv[i]<-0.25) os << "o";
+   else if (sv[i]<0.0) os << ".";
+   else if (sv[i]>0.5) os << "1";
+   else if (sv[i]>0.25) os << "|";
+   else if (sv[i]>0.0) os << "'";
else os << "-";
}
return os;
diff --git a/CommonLibs/BitVector.h b/CommonLibs/BitVector.h
index 7473c32..d2acb5f 100644
--- a/CommonLibs/BitVector.h
+++ b/CommonLibs/BitVector.h
@@ -290,19 +290,19 @@
//@}
 
// How good is the SoftVector in the sense of the bits being solid?
-   // Result of 1 is perfect and 0 means all the bits were 0.5
+   // Result of 1 is perfect and 0 means all the bits were 0.0
// If plow is non-NULL, also return the lowest energy bit.
float getEnergy(float *low=0) const;
 
/** Fill with "unknown" values. */
-   void unknown() { fill(0.5F); }
+   void unknown() { fill(0.0F); }
 
/** Return a hard bit value from a given index by slicing. */
bool bit(size_t index) const
{
const float *dp = mStart+index;
assert(dp<mEnd);
-   return (*dp)>0.5F;
+   return (*dp)>0.0F;
}
 
/** Slice the whole signal into bits. */

-- 
To view, visit https://gerrit.osmocom.org/2142
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I16ecc3d4c829dcf0f619ad995bc9d4a4ed8af0a4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


[PATCH] osmo-trx[master]: sigProcLib: Rename demodulateBurst() to demodGmskBurst() for...

2017-03-20 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/2137

sigProcLib: Rename demodulateBurst() to demodGmskBurst() for clarity.

Change-Id: Ibcef8d7d4a2c06865bed7e4091ccc8dbbd494d77
---
M Transceiver52M/sigProcLib.cpp
M Transceiver52M/sigProcLib.h
2 files changed, 5 insertions(+), 5 deletions(-)


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

diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index f9e21f0..1653ee9 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -2051,7 +2051,7 @@
  * 4 SPS (if activated) to minimize distortion through the fractional
  * delay filters. Symbol rotation and after always operates at 1 SPS.
  */
-SoftVector *demodulateBurst(signalVector , int sps,
+SoftVector *demodGmskBurst(signalVector , int sps,
 complex channel, float TOA)
 {
   SoftVector *bits;
diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h
index 87c0229..7dca71f 100644
--- a/Transceiver52M/sigProcLib.h
+++ b/Transceiver52M/sigProcLib.h
@@ -261,16 +261,16 @@
 signalVector *decimateVector(signalVector , size_t factor);
 
 /**
-Demodulates a received burst using a soft-slicer.
-   @param rxBurst The burst to be demodulated.
+Demodulates a GMSK burst using a soft-slicer.
+@param rxBurst The burst to be demodulated.
 @param gsmPulse The GSM pulse.
 @param sps The number of samples per GSM symbol.
 @param channel The amplitude estimate of the received burst.
 @param TOA The time-of-arrival of the received burst.
 @return The demodulated bit sequence.
 */
-SoftVector *demodulateBurst(signalVector , int sps,
-complex channel, float TOA);
+SoftVector *demodGmskBurst(signalVector , int sps,
+   complex channel, float TOA);
 
 /**
 Demodulate 8-PSK EDGE burst with soft symbol ooutput

-- 
To view, visit https://gerrit.osmocom.org/2137
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibcef8d7d4a2c06865bed7e4091ccc8dbbd494d77
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


[PATCH] osmo-trx[master]: sigProcLib: Slice SoftVector instead of signalVector for GMS...

2017-03-20 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/2138

sigProcLib: Slice SoftVector instead of signalVector for GMSK demod.

This makes it similar to 8-PSK demod and also saves a bit of lines ofcode and
should give us a tiny improvement in performance.

Ideally we need to remove vector slicing at all, because in osmo-bts-trx
we convert back to +-1.0 again (actually to +-127, but it doesn't mater).
So we should rather transmit +-1.0 values to avoid double conversion.

Change-Id: If9ed6f0f80fbe88c994b2f9c3cae91d0d57f4442
---
M Transceiver52M/sigProcLib.cpp
M Transceiver52M/sigProcLib.h
2 files changed, 22 insertions(+), 26 deletions(-)


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

diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index 1653ee9..d82157e 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -737,20 +737,6 @@
   return true;
 }
 
-bool vectorSlicer(signalVector *x)
-{
-
-  signalVector::iterator xP = x->begin();
-  signalVector::iterator xPEnd = x->end();
-  while (xP < xPEnd) {
-*xP = (complex) (0.5*(xP->real()+1.0F));
-if (xP->real() > 1.0) *xP = 1.0;
-if (xP->real() < 0.0) *xP = 0.0;
-xP++;
-  }
-  return true;
-}
-
 static signalVector *rotateBurst(const BitVector ,
  int guardPeriodLength, int sps)
 {
@@ -2021,6 +2007,22 @@
 }
 
 /*
+ * Convert signalVector to SoftVector by taking real part of the signal.
+ */
+static SoftVector *signalToSoftVector(signalVector *dec)
+{
+  SoftVector *bits = new SoftVector(dec->size());
+
+  SoftVector::iterator bit_itr = bits->begin();
+  signalVector::iterator burst_itr = dec->begin();
+
+  for (; burst_itr < dec->end(); burst_itr++)
+*bit_itr++ = burst_itr->real();
+
+  return bits;
+}
+
+/*
  * Shared portion of GMSK and EDGE demodulators consisting of timing
  * recovery and single tap channel correction. For 4 SPS (if activated),
  * the output is downsampled prior to the 1 SPS modulation specific
@@ -2063,18 +2065,12 @@
 
   /* Shift up by a quarter of a frequency */
   GMSKReverseRotate(*dec, 1);
-  vectorSlicer(dec);
-
-  bits = new SoftVector(dec->size());
-
-  SoftVector::iterator bit_itr = bits->begin();
-  signalVector::iterator burst_itr = dec->begin();
-
-  for (; burst_itr < dec->end(); burst_itr++)
-*bit_itr++ = burst_itr->real();
-
+  /* Take real part of the signal */
+  bits = signalToSoftVector(dec);
   delete dec;
 
+  vectorSlicer(bits);
+
   return bits;
 }
 
diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h
index 7dca71f..ed72430 100644
--- a/Transceiver52M/sigProcLib.h
+++ b/Transceiver52M/sigProcLib.h
@@ -101,8 +101,8 @@
unsigned startIx = 0,
unsigned len = 0);
 
-/** Operate soft slicer on real-valued portion of vector */ 
-bool vectorSlicer(signalVector *x);
+/** Operate soft slicer on a soft-bit vector */
+bool vectorSlicer(SoftVector *x);
 
 /** GMSK modulate a GSM burst of bits */
 signalVector *modulateBurst(const BitVector ,

-- 
To view, visit https://gerrit.osmocom.org/2138
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If9ed6f0f80fbe88c994b2f9c3cae91d0d57f4442
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


[PATCH] osmo-trx[master]: sigProcLib: make energyDetect() simpler by returning actual ...

2017-03-20 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/2136

sigProcLib: make energyDetect() simpler by returning actual energy.

Change-Id: I9bf97f2dc03fea9bebcf43198dfb05f6e4694e9c
---
M Transceiver52M/Transceiver.cpp
M Transceiver52M/sigProcLib.cpp
M Transceiver52M/sigProcLib.h
3 files changed, 10 insertions(+), 17 deletions(-)


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

diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index f156ad4..3df482f 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -606,7 +606,7 @@
 {
   int rc;
   complex amp;
-  float toa, pow, max = -1.0, avg = 0.0;
+  float toa, max = -1.0, avg = 0.0;
   int max_i = -1;
   signalVector *burst;
   SoftVector *bits = NULL;
@@ -641,7 +641,7 @@
 
   /* Select the diversity channel with highest energy */
   for (size_t i = 0; i < radio_burst->chans(); i++) {
-energyDetect(*radio_burst->getVector(i), 20 * mSPSRx, 0.0, );
+float pow = energyDetect(*radio_burst->getVector(i), 20 * mSPSRx);
 if (pow > max) {
   max = pow;
   max_i = i;
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index c1cf12e..f9e21f0 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -1721,10 +1721,8 @@
   return (amp.abs()) / rms;
 }
 
-bool energyDetect(signalVector ,
- unsigned windowLength,
- float detectThreshold,
-  float *avgPwr)
+float energyDetect(signalVector ,
+  unsigned windowLength)
 {
 
   signalVector::const_iterator windowItr = rxBurst.begin(); 
//+rxBurst.size()/2 - 5*windowLength/2;
@@ -1735,8 +1733,7 @@
 energy += windowItr->norm2();
 windowItr+=4;
   }
-  if (avgPwr) *avgPwr = energy/windowLength;
-  return (energy/windowLength > detectThreshold*detectThreshold);
+  return energy/windowLength;
 }
 
 /*
diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h
index 1b646cd..87c0229 100644
--- a/Transceiver52M/sigProcLib.h
+++ b/Transceiver52M/sigProcLib.h
@@ -176,17 +176,13 @@
 complex scale);
 
 /**
-Energy detector, checks to see if received burst energy is above a 
threshold.
-@param rxBurst The received GSM burst of interest.
+Rough energy estimator.
+@param rxBurst A GSM burst.
 @param windowLength The number of burst samples used to compute burst 
energy
-@param detectThreshold The detection threshold, a linear value.
-@param avgPwr The average power of the received burst.
-@return True if burst energy is above threshold.
+@return The average power of the received burst.
 */
-bool energyDetect(signalVector ,
- unsigned windowLength,
-  float detectThreshold,
-  float *avgPwr = NULL);
+float energyDetect(signalVector ,
+   unsigned windowLength);
 
 /**
 RACH aka Access Burst correlator/detector.

-- 
To view, visit https://gerrit.osmocom.org/2136
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9bf97f2dc03fea9bebcf43198dfb05f6e4694e9c
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


[PATCH] osmo-trx[master]: osmo-trx: Separate command line switch to enable EDGE filler.

2017-03-20 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/2143

osmo-trx: Separate command line switch to enable EDGE filler.

Now -r comand line switch always enables GMSK filler even when EDGE mode is
enabled with -e switch. If you want to enable EDGE filler, use -E switch.

Change-Id: Ic8808bbe3f06740ef3fec1d1865ecb57fbcfabab
---
M Transceiver52M/osmo-trx.cpp
1 file changed, 11 insertions(+), 4 deletions(-)


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

diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp
index 5e81586..dd80557 100644
--- a/Transceiver52M/osmo-trx.cpp
+++ b/Transceiver52M/osmo-trx.cpp
@@ -339,7 +339,8 @@
"  -cNumber of ARFCN channels (default=1)\n"
"  -fEnable C0 filler table\n"
"  -oSet baseband frequency offset (default=auto)\n"
-   "  -rRandom Normal Burst test mode with TSC\n"
+   "  -rRandom GMSK Normal Burst test mode with given TSC\n"
+   "  -ERandom 8-PSK Normal Burst test mode with given TSC\n"
"  -ARandom Access Burst test mode with delay\n"
"  -RRSSI to dBm offset in dB (default=0)\n"
"  -SSwap channels (UmTRX only)\n",
@@ -366,7 +367,7 @@
config->swap_channels = false;
config->edge = false;
 
-   while ((option = getopt(argc, argv, "ha:l:i:p:c:dmxgfo:s:b:r:A:R:Se")) 
!= -1) {
+   while ((option = getopt(argc, argv, 
"ha:l:i:p:c:dmxgfo:s:b:r:E:A:R:Se")) != -1) {
switch (option) {
case 'h':
print_help();
@@ -414,6 +415,10 @@
case 'r':
config->rtsc = atoi(optarg);
config->filler = Transceiver::FILLER_NORM_RAND;
+   break;
+   case 'E':
+   config->rtsc = atoi(optarg);
+   config->filler = Transceiver::FILLER_EDGE_RAND;
break;
case 'A':
config->rach_delay = atoi(optarg);
@@ -463,8 +468,10 @@
}
}
 
-   if (config->edge && (config->filler == Transceiver::FILLER_NORM_RAND))
-   config->filler = Transceiver::FILLER_EDGE_RAND;
+   if (!config->edge && (config->filler == Transceiver::FILLER_EDGE_RAND)) 
{
+   printf("Can't enable EDGE filler when EDGE mode is 
disabled\n\n");
+   goto bad_config;
+   }
 
if ((config->tx_sps != 1) && (config->tx_sps != 4) &&
(config->rx_sps != 1) && (config->rx_sps != 4)) {

-- 
To view, visit https://gerrit.osmocom.org/2143
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic8808bbe3f06740ef3fec1d1865ecb57fbcfabab
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


[MERGED] osmo-trx[master]: sigProcLib: Typo sybols -> symbols

2017-03-20 Thread Alexander Chemeris
Alexander Chemeris has submitted this change and it was merged.

Change subject: sigProcLib: Typo sybols -> symbols
..


sigProcLib: Typo sybols -> symbols

Change-Id: I8cbef852374d0458c4f4ad4be0df0aa998e3796a
---
M Transceiver52M/sigProcLib.cpp
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Tom Tsou: Looks good to me, approved
  Harald Welte: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index a361eff..2a22e49 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -1124,7 +1124,7 @@
  * Modulate 8-PSK burst. When empty pulse shaping (rotation only)
  * is enabled, the output vector length will be bit sequence length
  * times the SPS value. When pulse shaping is enabled, the output
- * vector length is fixed at 625 samples (156.25 sybols at 4 SPS).
+ * vector length is fixed at 625 samples (156.25 symbols at 4 SPS).
  * Pulse shaped bit sequences that go beyond one burst are truncated.
  * Pulse shaping at anything but 4 SPS is not supported.
  */

-- 
To view, visit https://gerrit.osmocom.org/2126
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8cbef852374d0458c4f4ad4be0df0aa998e3796a
Gerrit-PatchSet: 3
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>


[MERGED] osmo-trx[master]: radioBuffer: Remove extra ; at the end of inline function de...

2017-03-20 Thread Alexander Chemeris
Alexander Chemeris has submitted this change and it was merged.

Change subject: radioBuffer: Remove extra ; at the end of inline function 
definitions.
..


radioBuffer: Remove extra ; at the end of inline function definitions.

Change-Id: I8911adf0a0bb1ae828ac9cdf1a76c904639f6c06
---
M Transceiver52M/radioBuffer.h
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Tom Tsou: Looks good to me, approved
  Harald Welte: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/Transceiver52M/radioBuffer.h b/Transceiver52M/radioBuffer.h
index afb6e63..e5aa315 100644
--- a/Transceiver52M/radioBuffer.h
+++ b/Transceiver52M/radioBuffer.h
@@ -9,10 +9,10 @@
 
~RadioBuffer();
 
-   const size_t getSegmentLen() { return segmentLen; };
-   const size_t getNumSegments() { return numSegments; };
-   const size_t getAvailSamples() { return availSamples; };
-   const size_t getAvailSegments() { return availSamples / segmentLen; };
+   const size_t getSegmentLen() { return segmentLen; }
+   const size_t getNumSegments() { return numSegments; }
+   const size_t getAvailSamples() { return availSamples; }
+   const size_t getAvailSegments() { return availSamples / segmentLen; }
 
const size_t getFreeSamples()
{

-- 
To view, visit https://gerrit.osmocom.org/2127
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8911adf0a0bb1ae828ac9cdf1a76c904639f6c06
Gerrit-PatchSet: 3
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>


osmo-trx[master]: BitVector: Convert SoftVector from 0..1 to -1..+1 soft bits.

2017-03-21 Thread Alexander Chemeris

Patch Set 2:

(1 comment)

> (1 comment)

https://gerrit.osmocom.org/#/c/2142/2/CommonLibs/BitVector.h
File CommonLibs/BitVector.h:

Line 305:   return (*dp)>0.0F;
> Can we just compare "> 0" in here?
Yes, but I want to make it clear it's a floating point value.


-- 
To view, visit https://gerrit.osmocom.org/2142
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I16ecc3d4c829dcf0f619ad995bc9d4a4ed8af0a4
Gerrit-PatchSet: 2
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>
Gerrit-HasComments: Yes


osmo-trx[master]: sigProcLib: make energyDetect() simpler by returning actual ...

2017-03-21 Thread Alexander Chemeris

Patch Set 1:

(1 comment)

> (1 comment)

https://gerrit.osmocom.org/#/c/2136/1/Transceiver52M/Transceiver.cpp
File Transceiver52M/Transceiver.cpp:

Line 609:   float toa, max = -1.0, avg = 0.0;
> Is there good reason not to move it? I prefer the moved declaration.
I follow the rule "declare variable in the least possible namespace". Helps a 
lot with code modularity and clarity. That's different from C where everything 
must be declared in the beginning of a function.


-- 
To view, visit https://gerrit.osmocom.org/2136
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9bf97f2dc03fea9bebcf43198dfb05f6e4694e9c
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>
Gerrit-HasComments: Yes


libosmocore[master]: l1sap.h: Add ber10k and lqual_cb to ph_tch_param

2017-07-31 Thread Alexander Chemeris

Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/3092/1/include/osmocom/gsm/l1sap.h
File include/osmocom/gsm/l1sap.h:

PS1, Line 88:  
a typo


-- 
To view, visit https://gerrit.osmocom.org/3092
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If4ae20c22b881e94585dad710f17b9e37f77bf82
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pes...@sysmocom.de>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: Yes


libosmocore[master]: gsm0480: handle UnstructuredSS request with DSC != 0x0F

2017-07-30 Thread Alexander Chemeris

Patch Set 3: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/3376
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Ivan Kluchnikov <kluchnik...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


libosmocore[master]: gsm0480: modify USSD structures to support external handling

2017-07-30 Thread Alexander Chemeris

Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/3374/2/include/osmocom/gsm/gsm0480.h
File include/osmocom/gsm/gsm0480.h:

Line 10: #define MAX_LEN_USSD_STRING182
Could we add a reference to the standard here to point at where this value is 
coming from?


-- 
To view, visit https://gerrit.osmocom.org/3374
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Ivan Kluchnikov <kluchnik...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: Yes


libosmocore[master]: gsm0480: parse GSM0480_MTYPE_FACILITY separately

2017-07-30 Thread Alexander Chemeris

Patch Set 3: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/3377
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I6e029c436a50fa8c2823ea39c5d123ee701becfa
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Ivan Kluchnikov <kluchnik...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


libosmocore[master]: gsm0480: handle GSM0480_OP_CODE_PROCESS_USS_DATA

2017-07-30 Thread Alexander Chemeris

Patch Set 3: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/3380
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I470290c2b544555e53cedd849b1d6a961db7b5a4
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Ivan Kluchnikov <kluchnik...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


libosmocore[master]: gsm0480: handle USS_NOTIFY and USS_REQUEST with PROCESS_USS_REQ

2017-07-30 Thread Alexander Chemeris

Patch Set 3: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/3379
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If7cc6a966dfc17d37e22338ecc1f239f908a9f2e
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Ivan Kluchnikov <kluchnik...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


libosmocore[master]: gsm0480: refactor the parse_process_uss_req()

2017-07-30 Thread Alexander Chemeris

Patch Set 3: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/3375
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Ivan Kluchnikov <kluchnik...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


libosmocore[master]: gsm0480: modify USSD structures to support external handling

2017-08-01 Thread Alexander Chemeris

Patch Set 2:

> in general, what is your strategy for forward/backward
 > compatibility here? you're changing the API and ABI while keeping
 > the symbol name identical, breaking existing applications

Should we just bump the lib version? Otherwise we'll have to maintain two 
similar structures and similar, but different set of functions to operate them, 
which looks like an overkill here given there is only one user of this code - 
*#100# in osmo-nitb.

As a general comment, these patches are supposed to pave the way to more 
patches to osmo-nitb to allow communicating un-parsed SS/USSD to an external 
application. Thus splitting structures and functions in a way when we can avoid 
parsing the whole SS/USSD request every time.

-- 
To view, visit https://gerrit.osmocom.org/3374
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Ivan Kluchnikov <kluchnik...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] openbsc[master]: libcommon: Fix log output for bts>0.

2017-08-12 Thread Alexander Chemeris
gsm0408/gsm0408_test.c
index 5a8c6ca..63b5c7c 100644
--- a/openbsc/tests/gsm0408/gsm0408_test.c
+++ b/openbsc/tests/gsm0408/gsm0408_test.c
@@ -153,7 +153,7 @@
 
if (!network)
exit(1);
-   bts = gsm_bts_alloc(network);
+   bts = gsm_bts_alloc(network, 0);
 
_bts_uarfcn_add(bts, 10564, 319, 0);
_bts_uarfcn_add(bts, 10612, 319, 0);
@@ -168,7 +168,7 @@
 
if (!network)
exit(1);
-   bts = gsm_bts_alloc(network);
+   bts = gsm_bts_alloc(network, 0);
 
_bts_uarfcn_add(bts, 10564, 318, 0);
_bts_uarfcn_add(bts, 10612, 319, 0);
@@ -188,7 +188,7 @@
if (!network)
exit(1);
 
-   bts = gsm_bts_alloc(network);
+   bts = gsm_bts_alloc(network, 0);
 
/* first generate invalid SI as no UARFCN added */
gen(bts, __func__);
@@ -216,7 +216,7 @@
if (!network)
exit(1);
 
-   bts = gsm_bts_alloc(network);
+   bts = gsm_bts_alloc(network, 0);
 
bts->si_common.si2quater_neigh_list.arfcn = 
bts->si_common.data.earfcn_list;
bts->si_common.si2quater_neigh_list.meas_bw = 
bts->si_common.data.meas_bw_list;
@@ -249,7 +249,7 @@
if (!network)
exit(1);
 
-   bts = gsm_bts_alloc(network);
+   bts = gsm_bts_alloc(network, 0);
 
bts->si_common.si2quater_neigh_list.arfcn = 
bts->si_common.data.earfcn_list;
bts->si_common.si2quater_neigh_list.meas_bw = 
bts->si_common.data.meas_bw_list;

-- 
To view, visit https://gerrit.osmocom.org/3185
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d
Gerrit-PatchSet: 3
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>


openbsc[master]: libcommon: Fix log output for bts>0.

2017-08-12 Thread Alexander Chemeris

Patch Set 3:

Harald - I've added a test. Hope it's enough.

It doesn't look like the build failure is due to my change.. Not sure if I need 
to do anything?

-- 
To view, visit https://gerrit.osmocom.org/3185
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d
Gerrit-PatchSet: 3
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-HasComments: No


openbsc[master]: libcommon: Fix log output for bts>0.

2017-07-11 Thread Alexander Chemeris

Patch Set 1:

Btw, Harald - any reason we're caching lchan log string, but doesn't cache 
pchan log string?

-- 
To view, visit https://gerrit.osmocom.org/3185
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] openbsc[master]: libcommon: Fix log output for bts>0.

2017-07-11 Thread Alexander Chemeris
smocom.org/3185
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder


[PATCH] openbsc[master]: libcommon: Fix log output for bts>0.

2017-07-11 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/3185

libcommon: Fix log output for bts>0.

Fixes regression probably introduced in c696cc28.

For bts>0 logging doesn't show bts number correctly when printing lchan
identification string - it will always show it as "bts=0". The reason for
this is that the identification string is cached before bts->nr value is
set to a proper value.

This patch sets bts->nr as part of the first step of the bts structure
initialization, before caching happens thus making sure the cached
identification string is cached with the correct values.

Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d
---
M openbsc/include/openbsc/gsm_data_shared.h
M openbsc/src/libcommon/gsm_data.c
M openbsc/src/libcommon/gsm_data_shared.c
M openbsc/tests/channel/channel_test.c
M openbsc/tests/gsm0408/gsm0408_test.c
5 files changed, 11 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/85/3185/1

diff --git a/openbsc/include/openbsc/gsm_data_shared.h 
b/openbsc/include/openbsc/gsm_data_shared.h
index 4c71a07..369668d 100644
--- a/openbsc/include/openbsc/gsm_data_shared.h
+++ b/openbsc/include/openbsc/gsm_data_shared.h
@@ -900,7 +900,7 @@
 };
 
 
-struct gsm_bts *gsm_bts_alloc(void *talloc_ctx);
+struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num);
 struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num);
 
 struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts);
diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c
index db7de08..f1049e9 100644
--- a/openbsc/src/libcommon/gsm_data.c
+++ b/openbsc/src/libcommon/gsm_data.c
@@ -286,12 +286,13 @@
if (!model && type != GSM_BTS_TYPE_UNKNOWN)
return NULL;
 
-   bts = gsm_bts_alloc(net);
+   bts = gsm_bts_alloc(net, net->num_bts);
if (!bts)
return NULL;
 
+   net->num_bts++;
+
bts->network = net;
-   bts->nr = net->num_bts++;
bts->type = type;
bts->model = model;
bts->bsic = bsic;
diff --git a/openbsc/src/libcommon/gsm_data_shared.c 
b/openbsc/src/libcommon/gsm_data_shared.c
index 8992636..d792f3b 100644
--- a/openbsc/src/libcommon/gsm_data_shared.c
+++ b/openbsc/src/libcommon/gsm_data_shared.c
@@ -312,7 +312,7 @@
.initial_mcs = 6,
 };
 
-struct gsm_bts *gsm_bts_alloc(void *ctx)
+struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num)
 {
struct gsm_bts *bts = talloc_zero(ctx, struct gsm_bts);
int i;
@@ -320,6 +320,7 @@
if (!bts)
return NULL;
 
+   bts->nr = bts_num;
bts->num_trx = 0;
INIT_LLIST_HEAD(>trx_list);
bts->ms_max_power = 15; /* dBm */
diff --git a/openbsc/tests/channel/channel_test.c 
b/openbsc/tests/channel/channel_test.c
index 88293d0..77a9da1 100644
--- a/openbsc/tests/channel/channel_test.c
+++ b/openbsc/tests/channel/channel_test.c
@@ -70,7 +70,7 @@
network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL);
if (!network)
exit(1);
-   bts = gsm_bts_alloc(network);
+   bts = gsm_bts_alloc(network, 0);
bts->location_area_code = 23;
s_conn.network = network;
 
diff --git a/openbsc/tests/gsm0408/gsm0408_test.c 
b/openbsc/tests/gsm0408/gsm0408_test.c
index 5a8c6ca..17ca5bb 100644
--- a/openbsc/tests/gsm0408/gsm0408_test.c
+++ b/openbsc/tests/gsm0408/gsm0408_test.c
@@ -153,7 +153,7 @@
 
if (!network)
exit(1);
-   bts = gsm_bts_alloc(network);
+   bts = gsm_bts_alloc(network, 0);
 
_bts_uarfcn_add(bts, 10564, 319, 0);
_bts_uarfcn_add(bts, 10612, 319, 0);
@@ -168,7 +168,7 @@
 
if (!network)
exit(1);
-   bts = gsm_bts_alloc(network);
+   bts = gsm_bts_alloc(network, 0);
 
_bts_uarfcn_add(bts, 10564, 318, 0);
_bts_uarfcn_add(bts, 10612, 319, 0);
@@ -188,7 +188,7 @@
if (!network)
exit(1);
 
-   bts = gsm_bts_alloc(network);
+   bts = gsm_bts_alloc(network, 0);
 
/* first generate invalid SI as no UARFCN added */
gen(bts, __func__);
@@ -216,7 +216,7 @@
if (!network)
exit(1);
 
-   bts = gsm_bts_alloc(network);
+   bts = gsm_bts_alloc(network, 0);
 
bts->si_common.si2quater_neigh_list.arfcn = 
bts->si_common.data.earfcn_list;
bts->si_common.si2quater_neigh_list.meas_bw = 
bts->si_common.data.meas_bw_list;

-- 
To view, visit https://gerrit.osmocom.org/3185
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


openbsc[master]: libmsc: Fix VTY output for handover counters.

2017-07-08 Thread Alexander Chemeris

Patch Set 1:

I'm not sure I read Jenkins correctly, but it looks like the build failure is 
not related to my patch?

-- 
To view, visit https://gerrit.osmocom.org/3159
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9512330f2e91d2f526751c5228e6e8e0fe17d579
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofm...@sysmocom.de>
Gerrit-HasComments: No


[PATCH] openbsc[master]: libmsc: Fix VTY output for handover counters.

2017-07-08 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/3159

libmsc: Fix VTY output for handover counters.

Handover countrs belong to BSC, but we mistakenly take values from MSC counters.

Change-Id: I9512330f2e91d2f526751c5228e6e8e0fe17d579
---
M openbsc/src/libmsc/vty_interface_layer3.c
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/59/3159/1

diff --git a/openbsc/src/libmsc/vty_interface_layer3.c 
b/openbsc/src/libmsc/vty_interface_layer3.c
index e503291..042da9c 100644
--- a/openbsc/src/libmsc/vty_interface_layer3.c
+++ b/openbsc/src/libmsc/vty_interface_layer3.c
@@ -833,11 +833,11 @@
VTY_NEWLINE);
vty_out(vty, "Handover: %lu attempted, %lu no_channel, 
%lu timeout, "
"%lu completed, %lu failed%s",
-   net->msc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED].current,
-   net->msc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL].current,
-   net->msc_ctrs->ctr[BSC_CTR_HANDOVER_TIMEOUT].current,
-   net->msc_ctrs->ctr[BSC_CTR_HANDOVER_COMPLETED].current,
-   net->msc_ctrs->ctr[BSC_CTR_HANDOVER_FAILED].current,
+   net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED].current,
+   net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL].current,
+   net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_TIMEOUT].current,
+   net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_COMPLETED].current,
+   net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_FAILED].current,
VTY_NEWLINE);
vty_out(vty, "SMS MO  : %lu submitted, %lu no 
receiver%s",
net->msc_ctrs->ctr[MSC_CTR_SMS_SUBMITTED].current,

-- 
To view, visit https://gerrit.osmocom.org/3159
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9512330f2e91d2f526751c5228e6e8e0fe17d579
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


openbsc[master]: libmsc: Fix VTY output for handover counters.

2017-07-08 Thread Alexander Chemeris

Patch Set 1: Verified+1

-- 
To view, visit https://gerrit.osmocom.org/3159
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9512330f2e91d2f526751c5228e6e8e0fe17d579
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofm...@sysmocom.de>
Gerrit-HasComments: No


osmo-trx[master]: deb: remove unused dependency

2017-06-29 Thread Alexander Chemeris

Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/3079
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id2ab1facad703fa0c1d45084e70d41e73dbad6e7
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Ivan Kluchnikov <kluchnik...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>
Gerrit-HasComments: No


osmo-trx[master]: debian: remove obsolete dependency

2017-04-28 Thread Alexander Chemeris

Patch Set 2:

Max, please could you explain why is this required? What kind of build issues 
are you seeing? Would be nice to have at least a short version of this in the 
commit message with a potentially longer explanation in the comments here.

-- 
To view, visit https://gerrit.osmocom.org/2400
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3ea72b4123a280a846086d083c4f3189d611f8cf
Gerrit-PatchSet: 2
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>
Gerrit-Reviewer: neels <nhofm...@sysmocom.de>
Gerrit-HasComments: No


osmo-trx[master]: ssedetect: Add runtime CPU detection

2017-04-27 Thread Alexander Chemeris

Patch Set 3: Code-Review-1

To recap discussion at the OsmoDevCon, the last remaining request before the 
patch can be merged is to add an AVX target, which is a minor change.

Regarding clang support I also vote for moving this out of this ticket into a 
new one.

-- 
To view, visit https://gerrit.osmocom.org/2100
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iba74f8a6e4e921ff31e4bd9f0c7c881fe547423a
Gerrit-PatchSet: 3
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: dexter <pma...@sysmocom.de>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-HasComments: No


libosmocore[master]: gsm0480: expose the gsm0480_parse_ss_facility_ie()

2017-07-30 Thread Alexander Chemeris

Patch Set 3: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/3381
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I35d3360f36c48eb1295610ab96ff264c45af77eb
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Ivan Kluchnikov <kluchnik...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


openbsc[master]: libcommon: Fix log output for bts>0.

2017-08-09 Thread Alexander Chemeris

Patch Set 2:

Hi Harald, thank you for a reminder. I'll try to find some time to extend the 
patch.

-- 
To view, visit https://gerrit.osmocom.org/3185
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-HasComments: No


[PATCH] osmo-bts[master]: osmo-bts-trx: Fix MS power control loop.

2017-08-18 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/3560

osmo-bts-trx: Fix MS power control loop.

The following two commits from 2014-12-06 introduced a new variable to control
MS power - ms_power_ctrl, but kept the old ms_power variable in place. They
have also changed the meaning of the ms_power variable - it now keeps original
RSL configured value. So when much later osmo-trx-bts code was merged to master
the code was compiling fine and this change in the meaning was overlooked.

In osmo-bts:
579651bf300de002731dfd3bd39985c9fd15616c power/sysmobts: Add a manual ms power 
level control
In OpenBSC:
f6f86b0eec18da165db136b14bf2db87fde4b4ac osmo-bts: Introduce new struct for a 
power loop in the BTS code

Change-Id: I713e39b882db32a0d17aa04790d16fa79afa1fb1
---
M src/osmo-bts-trx/l1_if.c
M src/osmo-bts-trx/loops.c
2 files changed, 12 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/60/3560/1

diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index f69e587..c629a61 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -509,7 +509,7 @@
 
LOGP(DMEAS, LOGL_DEBUG, "RX L1 frame %s fn=%u chan_nr=0x%02x MS 
pwr=%ddBm rssi=%.1f dBFS "
"ber=%.2f%% (%d/%d bits) L1_ta=%d rqd_ta=%d toa=%.2f\n",
-   gsm_lchan_name(lchan), fn, chan_nr, 
ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power),
+   gsm_lchan_name(lchan), fn, chan_nr, 
ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power_ctrl.current),
rssi, ber*100, n_errors, n_bits_total, lchan->meas.l1_info[1], 
lchan->rqd_ta, toa);
 
l1if_fill_meas_res(, chan_nr, lchan->rqd_ta + toa, ber, rssi, fn);
diff --git a/src/osmo-bts-trx/loops.c b/src/osmo-bts-trx/loops.c
index 8070e80..8d6e5d7 100644
--- a/src/osmo-bts-trx/loops.c
+++ b/src/osmo-bts-trx/loops.c
@@ -48,7 +48,7 @@
uint16_t arfcn = trx->arfcn;
int8_t new_power;
 
-   new_power = lchan->ms_power - (diff >> 1);
+   new_power = lchan->ms_power_ctrl.current - (diff >> 1);
 
if (diff == 0)
return 0;
@@ -66,12 +66,12 @@
}
 
/* a higher value means a lower level (and vice versa) */
-   if (new_power > lchan->ms_power + MS_LOWER_MAX)
-   new_power = lchan->ms_power + MS_LOWER_MAX;
-   else if (new_power < lchan->ms_power - MS_RAISE_MAX)
-   new_power = lchan->ms_power - MS_RAISE_MAX;
+   if (new_power > lchan->ms_power_ctrl.current + MS_LOWER_MAX)
+   new_power = lchan->ms_power_ctrl.current + MS_LOWER_MAX;
+   else if (new_power < lchan->ms_power_ctrl.current - MS_RAISE_MAX)
+   new_power = lchan->ms_power_ctrl.current - MS_RAISE_MAX;
 
-   if (lchan->ms_power == new_power) {
+   if (lchan->ms_power_ctrl.current == new_power) {
LOGP(DLOOP, LOGL_INFO, "Keeping MS new_power of trx=%u "
"chan_nr=0x%02x at control level %d (%d dBm)\n",
trx->nr, chan_nr, new_power,
@@ -83,11 +83,11 @@
LOGP(DLOOP, LOGL_INFO, "%s MS new_power of trx=%u chan_nr=0x%02x from "
"control level %d (%d dBm) to %d (%d dBm)\n",
(diff > 0) ? "Raising" : "Lowering",
-   trx->nr, chan_nr, lchan->ms_power,
-   MS_PWR_DBM(arfcn, lchan->ms_power), new_power,
+   trx->nr, chan_nr, lchan->ms_power_ctrl.current,
+   MS_PWR_DBM(arfcn, lchan->ms_power_ctrl.current), new_power,
MS_PWR_DBM(arfcn, new_power));
 
-   lchan->ms_power = new_power;
+   lchan->ms_power_ctrl.current = new_power;
 
return 0;
 }
@@ -159,8 +159,8 @@
/* change RSSI */
LOGP(DLOOP, LOGL_DEBUG, "Lowest RSSI: %d Target RSSI: %d Current "
"MS power: %d (%d dBm) of trx=%u chan_nr=0x%02x\n", rssi,
-   trx_target_rssi, lchan->ms_power,
-   MS_PWR_DBM(trx->arfcn, lchan->ms_power),
+   trx_target_rssi, lchan->ms_power_ctrl.current,
+   MS_PWR_DBM(trx->arfcn, lchan->ms_power_ctrl.current),
trx->nr, chan_nr);
ms_power_diff(lchan, chan_nr, trx_target_rssi - rssi);
 

-- 
To view, visit https://gerrit.osmocom.org/3560
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I713e39b882db32a0d17aa04790d16fa79afa1fb1
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


osmo-trx[master]: Add -j option to bind to specific address

2017-08-18 Thread Alexander Chemeris

Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/3539
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9ba184a1251c823e413a9230943ed263e52142ec
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pes...@sysmocom.de>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] osmo-bts[master]: osmo-bts-trx: Increase a maximum allowed MS power reduction ...

2017-08-18 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/3562

osmo-bts-trx: Increase a maximum allowed MS power reduction step from 2dB to 
4dB.

We tend to start MS with high power to make sure distant phones get good QoS,
but this also means that we need to reduce their power rather quickly. OTOH
we can't make this step too high because this may lead to power output
oscilation. From my (manual, limited) testing 2dB look like a reasonable
compromise.

Change-Id: I58785513e5739474b881ed7f2a312ecc690e7e60
---
M src/osmo-bts-trx/loops.h
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/62/3562/1

diff --git a/src/osmo-bts-trx/loops.h b/src/osmo-bts-trx/loops.h
index 613d2d0..c0458c5 100644
--- a/src/osmo-bts-trx/loops.h
+++ b/src/osmo-bts-trx/loops.h
@@ -7,7 +7,7 @@
 
 /* how much power levels do we raise/lower as maximum (1 level = 2 dB) */
 #define MS_RAISE_MAX 4
-#define MS_LOWER_MAX 1
+#define MS_LOWER_MAX 2
 
 /*
  * loops api

-- 
To view, visit https://gerrit.osmocom.org/3562
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I58785513e5739474b881ed7f2a312ecc690e7e60
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


osmo-bts[master]: Check for suitable lchan type when detecting HO

2017-08-17 Thread Alexander Chemeris

Patch Set 3:

Tom - do you think we can avoid RACH detection for non-SACCH and DCCH in 
osmo-trx, following the same logic as here? Right now we're detecting RACH on 
every burst IIRC.

-- 
To view, visit https://gerrit.osmocom.org/1960
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iacbcc8441d6cfbb8f808948a8baddde1ebca488a
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>
Gerrit-HasComments: No


[PATCH] osmo-bts[master]: Fix static build of osmo-bts-trx and osmo-bts-virtual.

2017-08-17 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/3552

Fix static build of osmo-bts-trx and osmo-bts-virtual.

New libosmocore has some plugin system which requires dlopen(). So we need
to make sure we always link with libdl, even when building statically.

Note that this doesn't fix static build of tests - they are still failing
with some errors.

Change-Id: I8315d6e032e34528def268a49fd88d07bc06ab2e
---
M src/osmo-bts-trx/Makefile.am
M src/osmo-bts-virtual/Makefile.am
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/52/3552/1

diff --git a/src/osmo-bts-trx/Makefile.am b/src/osmo-bts-trx/Makefile.am
index 8676685..0a97251 100644
--- a/src/osmo-bts-trx/Makefile.am
+++ b/src/osmo-bts-trx/Makefile.am
@@ -1,6 +1,6 @@
 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR)
 AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) 
$(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOCODING_CFLAGS) 
$(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) 
$(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS)
-LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) 
$(LIBOSMOCODING_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) 
$(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS)
+LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) 
$(LIBOSMOCODING_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) 
$(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -ldl
 
 EXTRA_DIST = trx_if.h l1_if.h loops.h
 
diff --git a/src/osmo-bts-virtual/Makefile.am b/src/osmo-bts-virtual/Makefile.am
index 30069d4..d1f05af 100644
--- a/src/osmo-bts-virtual/Makefile.am
+++ b/src/osmo-bts-virtual/Makefile.am
@@ -1,6 +1,6 @@
 AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) 
$(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) 
$(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) 
$(LIBGPS_CFLAGS) $(ORTP_CFLAGS)
 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) 
-Iinclude
-COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) 
$(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS)
+COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) 
$(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -ldl
 
 noinst_HEADERS = l1_if.h osmo_mcast_sock.h virtual_um.h
 

-- 
To view, visit https://gerrit.osmocom.org/3552
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8315d6e032e34528def268a49fd88d07bc06ab2e
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


[PATCH] osmo-bts[master]: osmo-bts-trx: Increase a maximum allowed MS power reduction ...

2017-08-19 Thread Alexander Chemeris
Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/3562

to look at the new patch set (#3).

osmo-bts-trx: Increase a maximum allowed MS power reduction step from 2dB to 
4dB.

We tend to start MS with high power to make sure distant phones get good QoS,
but this also means that we need to reduce their power rather quickly. OTOH
we can't make this step too high because this may lead to power output
oscillation. From my (manual, limited) testing 4dB looks like a reasonable
compromise.

Change-Id: I58785513e5739474b881ed7f2a312ecc690e7e60
---
M src/osmo-bts-trx/loops.h
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/62/3562/3

diff --git a/src/osmo-bts-trx/loops.h b/src/osmo-bts-trx/loops.h
index 613d2d0..c0458c5 100644
--- a/src/osmo-bts-trx/loops.h
+++ b/src/osmo-bts-trx/loops.h
@@ -7,7 +7,7 @@
 
 /* how much power levels do we raise/lower as maximum (1 level = 2 dB) */
 #define MS_RAISE_MAX 4
-#define MS_LOWER_MAX 1
+#define MS_LOWER_MAX 2
 
 /*
  * loops api

-- 
To view, visit https://gerrit.osmocom.org/3562
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I58785513e5739474b881ed7f2a312ecc690e7e60
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmo-bts[master]: osmo-bts-trx: Increase a maximum allowed MS power reduction ...

2017-08-19 Thread Alexander Chemeris
Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/3562

to look at the new patch set (#2).

osmo-bts-trx: Increase a maximum allowed MS power reduction step from 2dB to 
4dB.

We tend to start MS with high power to make sure distant phones get good QoS,
but this also means that we need to reduce their power rather quickly. OTOH
we can't make this step too high because this may lead to power output
oscillation. From my (manual, limited) testing 4dB look like a reasonable
compromise.

Change-Id: I58785513e5739474b881ed7f2a312ecc690e7e60
---
M src/osmo-bts-trx/loops.h
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/62/3562/2

diff --git a/src/osmo-bts-trx/loops.h b/src/osmo-bts-trx/loops.h
index 613d2d0..c0458c5 100644
--- a/src/osmo-bts-trx/loops.h
+++ b/src/osmo-bts-trx/loops.h
@@ -7,7 +7,7 @@
 
 /* how much power levels do we raise/lower as maximum (1 level = 2 dB) */
 #define MS_RAISE_MAX 4
-#define MS_LOWER_MAX 1
+#define MS_LOWER_MAX 2
 
 /*
  * loops api

-- 
To view, visit https://gerrit.osmocom.org/3562
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I58785513e5739474b881ed7f2a312ecc690e7e60
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmo-bts[master]: osmo-bts-trx: Remove an unused variable. Resolves a compiler...

2017-08-18 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/3561

osmo-bts-trx: Remove an unused variable. Resolves a compiler warning.

Change-Id: I2464e872f81021cbc3ccbc4e2e32c394d6afcf70
---
M src/osmo-bts-trx/loops.c
1 file changed, 0 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/61/3561/1

diff --git a/src/osmo-bts-trx/loops.c b/src/osmo-bts-trx/loops.c
index 8070e80..5710049 100644
--- a/src/osmo-bts-trx/loops.c
+++ b/src/osmo-bts-trx/loops.c
@@ -251,7 +251,6 @@
struct gsm_bts_trx *trx = l1t->trx;
struct gsm_lchan *lchan = >ts[L1SAP_CHAN2TS(chan_nr)]
.lchan[l1sap_chan2ss(chan_nr)];
-   int c_i;
 
/* check if loop is enabled */
if (!chan_state->amr_loop)
@@ -276,9 +275,6 @@
 
/* calculate average (reuse ber variable) */
ber = chan_state->ber_sum / chan_state->ber_num;
-
-   /* FIXME: calculate C/I from BER */
-   c_i = ber * 100;
 
/* reset bit errors */
chan_state->ber_num = 0;

-- 
To view, visit https://gerrit.osmocom.org/3561
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2464e872f81021cbc3ccbc4e2e32c394d6afcf70
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


[MERGED] osmo-bts[master]: osmo-bts-trx: Fix MS power control loop.

2017-08-19 Thread Alexander Chemeris
Alexander Chemeris has submitted this change and it was merged.

Change subject: osmo-bts-trx: Fix MS power control loop.
..


osmo-bts-trx: Fix MS power control loop.

The following two commits from 2014-12-06 introduced a new variable to control
MS power - ms_power_ctrl, but kept the old ms_power variable in place. They
have also changed the meaning of the ms_power variable - it now keeps original
RSL configured value. So when much later osmo-trx-bts code was merged to master
the code was compiling fine and this change in the meaning was overlooked.

In osmo-bts:
579651bf300de002731dfd3bd39985c9fd15616c power/sysmobts: Add a manual ms power 
level control
In OpenBSC:
f6f86b0eec18da165db136b14bf2db87fde4b4ac osmo-bts: Introduce new struct for a 
power loop in the BTS code

Change-Id: I713e39b882db32a0d17aa04790d16fa79afa1fb1
---
M src/osmo-bts-trx/l1_if.c
M src/osmo-bts-trx/loops.c
2 files changed, 12 insertions(+), 12 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index f69e587..c629a61 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -509,7 +509,7 @@
 
LOGP(DMEAS, LOGL_DEBUG, "RX L1 frame %s fn=%u chan_nr=0x%02x MS 
pwr=%ddBm rssi=%.1f dBFS "
"ber=%.2f%% (%d/%d bits) L1_ta=%d rqd_ta=%d toa=%.2f\n",
-   gsm_lchan_name(lchan), fn, chan_nr, 
ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power),
+   gsm_lchan_name(lchan), fn, chan_nr, 
ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power_ctrl.current),
rssi, ber*100, n_errors, n_bits_total, lchan->meas.l1_info[1], 
lchan->rqd_ta, toa);
 
l1if_fill_meas_res(, chan_nr, lchan->rqd_ta + toa, ber, rssi, fn);
diff --git a/src/osmo-bts-trx/loops.c b/src/osmo-bts-trx/loops.c
index 8070e80..8d6e5d7 100644
--- a/src/osmo-bts-trx/loops.c
+++ b/src/osmo-bts-trx/loops.c
@@ -48,7 +48,7 @@
uint16_t arfcn = trx->arfcn;
int8_t new_power;
 
-   new_power = lchan->ms_power - (diff >> 1);
+   new_power = lchan->ms_power_ctrl.current - (diff >> 1);
 
if (diff == 0)
return 0;
@@ -66,12 +66,12 @@
}
 
/* a higher value means a lower level (and vice versa) */
-   if (new_power > lchan->ms_power + MS_LOWER_MAX)
-   new_power = lchan->ms_power + MS_LOWER_MAX;
-   else if (new_power < lchan->ms_power - MS_RAISE_MAX)
-   new_power = lchan->ms_power - MS_RAISE_MAX;
+   if (new_power > lchan->ms_power_ctrl.current + MS_LOWER_MAX)
+   new_power = lchan->ms_power_ctrl.current + MS_LOWER_MAX;
+   else if (new_power < lchan->ms_power_ctrl.current - MS_RAISE_MAX)
+   new_power = lchan->ms_power_ctrl.current - MS_RAISE_MAX;
 
-   if (lchan->ms_power == new_power) {
+   if (lchan->ms_power_ctrl.current == new_power) {
LOGP(DLOOP, LOGL_INFO, "Keeping MS new_power of trx=%u "
"chan_nr=0x%02x at control level %d (%d dBm)\n",
trx->nr, chan_nr, new_power,
@@ -83,11 +83,11 @@
LOGP(DLOOP, LOGL_INFO, "%s MS new_power of trx=%u chan_nr=0x%02x from "
"control level %d (%d dBm) to %d (%d dBm)\n",
(diff > 0) ? "Raising" : "Lowering",
-   trx->nr, chan_nr, lchan->ms_power,
-   MS_PWR_DBM(arfcn, lchan->ms_power), new_power,
+   trx->nr, chan_nr, lchan->ms_power_ctrl.current,
+   MS_PWR_DBM(arfcn, lchan->ms_power_ctrl.current), new_power,
MS_PWR_DBM(arfcn, new_power));
 
-   lchan->ms_power = new_power;
+   lchan->ms_power_ctrl.current = new_power;
 
return 0;
 }
@@ -159,8 +159,8 @@
/* change RSSI */
LOGP(DLOOP, LOGL_DEBUG, "Lowest RSSI: %d Target RSSI: %d Current "
"MS power: %d (%d dBm) of trx=%u chan_nr=0x%02x\n", rssi,
-   trx_target_rssi, lchan->ms_power,
-   MS_PWR_DBM(trx->arfcn, lchan->ms_power),
+   trx_target_rssi, lchan->ms_power_ctrl.current,
+   MS_PWR_DBM(trx->arfcn, lchan->ms_power_ctrl.current),
trx->nr, chan_nr);
ms_power_diff(lchan, chan_nr, trx_target_rssi - rssi);
 

-- 
To view, visit https://gerrit.osmocom.org/3560
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I713e39b882db32a0d17aa04790d16fa79afa1fb1
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder


osmo-bts[master]: osmo-bts-trx: Fix MS power control loop.

2017-08-19 Thread Alexander Chemeris

Patch Set 2:

> Please also see http://osmocom.org/issues/1851 and
 > http://osmocom.org/issues/1622 in this context

Thanks for pointing! I didn't realize we don't even follow the standard..

-- 
To view, visit https://gerrit.osmocom.org/3560
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I713e39b882db32a0d17aa04790d16fa79afa1fb1
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-bts[master]: osmo-bts-trx: Remove an unused variable. Resolves a compiler...

2017-08-19 Thread Alexander Chemeris
Alexander Chemeris has submitted this change and it was merged.

Change subject: osmo-bts-trx: Remove an unused variable. Resolves a compiler 
warning.
..


osmo-bts-trx: Remove an unused variable. Resolves a compiler warning.

Change-Id: I2464e872f81021cbc3ccbc4e2e32c394d6afcf70
---
M src/osmo-bts-trx/loops.c
1 file changed, 0 insertions(+), 4 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bts-trx/loops.c b/src/osmo-bts-trx/loops.c
index 8d6e5d7..3da805c 100644
--- a/src/osmo-bts-trx/loops.c
+++ b/src/osmo-bts-trx/loops.c
@@ -251,7 +251,6 @@
struct gsm_bts_trx *trx = l1t->trx;
struct gsm_lchan *lchan = >ts[L1SAP_CHAN2TS(chan_nr)]
.lchan[l1sap_chan2ss(chan_nr)];
-   int c_i;
 
/* check if loop is enabled */
if (!chan_state->amr_loop)
@@ -276,9 +275,6 @@
 
/* calculate average (reuse ber variable) */
ber = chan_state->ber_sum / chan_state->ber_num;
-
-   /* FIXME: calculate C/I from BER */
-   c_i = ber * 100;
 
/* reset bit errors */
chan_state->ber_num = 0;

-- 
To view, visit https://gerrit.osmocom.org/3561
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2464e872f81021cbc3ccbc4e2e32c394d6afcf70
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder


osmo-bts[master]: osmo-bts-trx: Increase a maximum allowed MS power reduction ...

2017-08-19 Thread Alexander Chemeris

Patch Set 3:

> you mention 2dB here, but your change seems to change it from 2 to 4dB ?

Thank you! That's clearly a typo. Fixed in the new patch.

-- 
To view, visit https://gerrit.osmocom.org/3562
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I58785513e5739474b881ed7f2a312ecc690e7e60
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-bts[master]: Fix static build of osmo-bts-trx and osmo-bts-virtual.

2017-08-20 Thread Alexander Chemeris

Patch Set 1:

> I'm not sure what's "new" about it? dlopen() has been introduced into 
> libosmocore in 2010:

Not sure. May be somehow it wasn't used previously and was optimized out by the 
linker and now it's used? Frankly I haven't looked at the reasons - I just 
noticed that it was building fine previously and now it requires -ldl.

-- 
To view, visit https://gerrit.osmocom.org/3552
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I8315d6e032e34528def268a49fd88d07bc06ab2e
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-bts[master]: Fix static build of osmo-bts-trx and osmo-bts-virtual.

2017-08-20 Thread Alexander Chemeris
Alexander Chemeris has submitted this change and it was merged.

Change subject: Fix static build of osmo-bts-trx and osmo-bts-virtual.
..


Fix static build of osmo-bts-trx and osmo-bts-virtual.

New libosmocore has some plugin system which requires dlopen(). So we need
to make sure we always link with libdl, even when building statically.

Note that this doesn't fix static build of tests - they are still failing
with some errors.

Change-Id: I8315d6e032e34528def268a49fd88d07bc06ab2e
---
M src/osmo-bts-trx/Makefile.am
M src/osmo-bts-virtual/Makefile.am
2 files changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bts-trx/Makefile.am b/src/osmo-bts-trx/Makefile.am
index 8676685..0a97251 100644
--- a/src/osmo-bts-trx/Makefile.am
+++ b/src/osmo-bts-trx/Makefile.am
@@ -1,6 +1,6 @@
 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR)
 AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) 
$(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOCODING_CFLAGS) 
$(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) 
$(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS)
-LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) 
$(LIBOSMOCODING_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) 
$(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS)
+LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) 
$(LIBOSMOCODING_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) 
$(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -ldl
 
 EXTRA_DIST = trx_if.h l1_if.h loops.h
 
diff --git a/src/osmo-bts-virtual/Makefile.am b/src/osmo-bts-virtual/Makefile.am
index 30069d4..d1f05af 100644
--- a/src/osmo-bts-virtual/Makefile.am
+++ b/src/osmo-bts-virtual/Makefile.am
@@ -1,6 +1,6 @@
 AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) 
$(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) 
$(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) 
$(LIBGPS_CFLAGS) $(ORTP_CFLAGS)
 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) 
-Iinclude
-COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) 
$(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS)
+COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) 
$(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -ldl
 
 noinst_HEADERS = l1_if.h osmo_mcast_sock.h virtual_um.h
 

-- 
To view, visit https://gerrit.osmocom.org/3552
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8315d6e032e34528def268a49fd88d07bc06ab2e
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder


osmo-trx[master]: uhd: Always specify samples-per-symbol for device lookup

2017-06-27 Thread Alexander Chemeris

Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/3062
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I56e939285d585cc38efa6c329e30e3acebb734eb
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Tom Tsou <t...@tsou.cc>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-HasComments: No


libosmocore[master]: core/conv: add x86 SSE support for Viterbi decoder

2017-05-21 Thread Alexander Chemeris

Patch Set 9: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/2454
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I1da6d71ed0564f1d684f3a836e998d09de5f0351
Gerrit-PatchSet: 9
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>
Gerrit-Reviewer: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: dexter <pma...@sysmocom.de>
Gerrit-HasComments: No


openbsc[master]: Enable optional static builds

2017-05-28 Thread Alexander Chemeris

Patch Set 1:

Max, thank you for working on this!

Are you able to build tests when static build is enabled?

Also, do you know have patches to enable static build for all library 
dependencies?

Btw, would it be possible to enable static build in Jenkins after this is 
merged to make sure we don't break it?

-- 
To view, visit https://gerrit.osmocom.org/2748
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibcd1da98302413182c85e25c4cb7d69d9e38c35a
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


libosmocore[master]: core/conv: do not mix up AVX and SSE code

2017-05-28 Thread Alexander Chemeris

Patch Set 1:

Vadim,

Is sse+avx code just a copy of the sse code? In this case we should move it to 
an include file and then include into .c files to avoid code duplication.

-- 
To view, visit https://gerrit.osmocom.org/2760
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I042cc76258df7e4c6c90a73af3d0a6e75999b2b0
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>
Gerrit-Reviewer: tnt <t...@246tnt.com>
Gerrit-HasComments: No


[PATCH] osmo-trx[master]: PRBS: a Pseudo-random binary sequence (PRBS) generator class.

2017-05-28 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/2764

PRBS: a Pseudo-random binary sequence (PRBS) generator class.

Implemeted with a Galois LFSR for speed and flexibility compared to Fibonacci 
version.

Aliases for three popular PRBS' are added for convenience - PRBS9, PRBS15 and 
PRBS64.

Note that we can't test PRBS64 completely, because the sequence is too long to
be generated.

Change-Id: Ib5331ba5d0b5819929541686fdd87905e2177b74
---
M .gitignore
M CommonLibs/Makefile.am
A CommonLibs/PRBS.h
A CommonLibs/PRBSTest.cpp
4 files changed, 157 insertions(+), 0 deletions(-)


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

diff --git a/.gitignore b/.gitignore
index d1a0b33..d560f19 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,6 +15,7 @@
 CommonLibs/TimevalTest
 CommonLibs/URLEncodeTest
 CommonLibs/VectorTest
+CommonLibs/PRBSTest
 
 # automake/autoconf
 *.in
diff --git a/CommonLibs/Makefile.am b/CommonLibs/Makefile.am
index f0f1061..18ec2f7 100644
--- a/CommonLibs/Makefile.am
+++ b/CommonLibs/Makefile.am
@@ -42,6 +42,7 @@
 
 noinst_PROGRAMS = \
BitVectorTest \
+   PRBSTest \
InterthreadTest \
SocketsTest \
TimevalTest \
@@ -53,6 +54,7 @@
 
 noinst_HEADERS = \
BitVector.h \
+   PRBS.h \
Interthread.h \
LinkedLists.h \
Sockets.h \
@@ -66,6 +68,8 @@
 BitVectorTest_SOURCES = BitVectorTest.cpp
 BitVectorTest_LDADD = libcommon.la $(SQLITE3_LIBS)
 
+PRBSTest_SOURCES = PRBSTest.cpp
+
 InterthreadTest_SOURCES = InterthreadTest.cpp
 InterthreadTest_LDADD = libcommon.la
 InterthreadTest_LDFLAGS = -lpthread
diff --git a/CommonLibs/PRBS.h b/CommonLibs/PRBS.h
new file mode 100644
index 000..0b7bbc3
--- /dev/null
+++ b/CommonLibs/PRBS.h
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2017 Alexander Chemeris <alexander.cheme...@fairwaves.co>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef PRBS_H
+#define PRBS_H
+
+#include 
+#include 
+
+/** Pseudo-random binary sequence (PRBS) generator (a Galois LFSR 
implementation). */
+class PRBS {
+public:
+
+  PRBS(unsigned wLen, uint64_t wCoeff, uint64_t wState = 0x01)
+: mCoeff(wCoeff), mStartState(wState), mState(wState), mLen(wLen)
+  { assert(wLen<=64); }
+
+  /**@name Accessors */
+  //@{
+  uint64_t coeff() const { return mCoeff; }
+  uint64_t state() const { return mState; }
+  void state(uint64_t state) { mState = state & mask(); }
+  unsigned size() const { return mLen; }
+  //@}
+
+  /**
+Calculate one bit of a PRBS
+  */
+  unsigned generateBit()
+  {
+const unsigned result = mState & 0x01;
+processBit(result);
+return result;
+  }
+
+  /**
+Update the generator state by one bit.
+If you want to synchronize your PRBS to a known state, call this function
+size() times passing your PRBS to it bit by bit.
+  */
+  void processBit(unsigned inBit)
+  {
+mState >>= 1;
+if (inBit) mState ^= mCoeff;
+  }
+
+  /** Return true when PRBS is wrapping through initial state */
+  bool isFinished() const { return mStartState == mState; }
+
+protected:
+
+  uint64_t mCoeff;  ///< polynomial coefficients. LSB is zero exponent.
+  uint64_t mStartState; ///< initial shift register state.
+  uint64_t mState;  ///< shift register state.
+  unsigned mLen;///< number of bits used in shift register
+
+  /** Return mask for the state register */
+  uint64_t mask() const { return 
(mLen==64)?0xUL:((1<<mLen)-1); }
+
+};
+
+/**
+  A standard 9-bit based pseudorandom binary sequence (PRBS) generator.
+  Polynomial: x^9 + x^5 + 1
+*/
+class PRBS9 : public PRBS {
+  public:
+  PRBS9(uint64_t wState = 0x01)
+  : PRBS(9, 0x0110, wState)
+  {}
+};
+
+/**
+  A standard 15-bit based pseudorandom binary sequence (PRBS) generator.
+  Polynomial: x^15 + x^14 + 1
+*/
+class PRBS15 : public PRBS {
+public:
+  PRBS15(uint64_t wState = 0x01)
+  : PRBS(15, 0x6000, wState)
+  {}
+};
+
+/**
+  A standard 64-bit based pseudorandom binary sequence (PRBS) generator.
+  Polynomial: x^64 + x^63 + x^61 + x^60 + 1
+*/
+class PRBS64 : public PRBS {
+public:
+  PRBS64(uint64_t wState = 0x01)
+  : PRBS(64, 0xD800ULL, wState)
+  {}
+};
+
+#endif // PRBS_H
diff --git a/CommonLibs/PRBSTest.cpp b/CommonLib

[PATCH] osmo-trx[master]: BitVector: Remove Generator class.

2017-05-28 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/2763

BitVector: Remove Generator class.

It is not used in osmo-trx, because we're not doing FEC or CRC checks.

Change-Id: I1509e785c1187ebdafe5b2518bd298fbbd1cd036
---
M CommonLibs/BitVector.cpp
M CommonLibs/BitVector.h
2 files changed, 0 insertions(+), 86 deletions(-)


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

diff --git a/CommonLibs/BitVector.cpp b/CommonLibs/BitVector.cpp
index 3b556b9..cf408cd 100644
--- a/CommonLibs/BitVector.cpp
+++ b/CommonLibs/BitVector.cpp
@@ -200,25 +200,6 @@
 
 
 
-uint64_t BitVector::syndrome(Generator& gen) const
-{
-   gen.clear();
-   const char *dp = mStart;
-   while (dp<mEnd) gen.syndromeShift(*dp++);
-   return gen.state();
-}
-
-
-uint64_t BitVector::parity(Generator& gen) const
-{
-   gen.clear();
-   const char *dp = mStart;
-   while (dp<mEnd) gen.encoderShift(*dp++);
-   return gen.state();
-}
-
-
-
 unsigned BitVector::sum() const
 {
unsigned sum = 0;
diff --git a/CommonLibs/BitVector.h b/CommonLibs/BitVector.h
index d2acb5f..559dd99 100644
--- a/CommonLibs/BitVector.h
+++ b/CommonLibs/BitVector.h
@@ -30,65 +30,6 @@
 #include 
 
 
-class BitVector;
-class SoftVector;
-
-
-
-/** Shift-register (LFSR) generator. */
-class Generator {
-
-   private:
-
-   uint64_t mCoeff;///< polynomial coefficients. LSB is zero 
exponent.
-   uint64_t mState;///< shift register state. LSB is most recent.
-   uint64_t mMask; ///< mask for reading state
-   unsigned mLen;  ///< number of bits used in shift register
-   unsigned mLen_1;///< mLen - 1
-
-   public:
-
-   Generator(uint64_t wCoeff, unsigned wLen)
-   :mCoeff(wCoeff),mState(0),
-   mMask((1ULL<<wLen)-1),
-   mLen(wLen),mLen_1(wLen-1)
-   { assert(wLen<64); }
-
-   void clear() { mState=0; }
-
-   /**@name Accessors */
-   //@{
-   uint64_t state() const { return mState & mMask; }
-   unsigned size() const { return mLen; }
-   //@}
-
-   /**
-   Calculate one bit of a syndrome.
-   This is in the .h for inlining.
-   */
-   void syndromeShift(unsigned inBit)
-   {
-   const unsigned fb = (mState>>(mLen_1)) & 0x01;
-   mState = (mState<<1) ^ (inBit & 0x01);
-   if (fb) mState ^= mCoeff;
-   }
-
-   /**
-   Update the generator state by one cycle.
-   This is in the .h for inlining.
-   */
-   void encoderShift(unsigned inBit)
-   {
-   const unsigned fb = ((mState>>(mLen_1)) ^ inBit) & 0x01;
-   mState <<= 1;
-   if (fb) mState ^= mCoeff;
-   }
-
-
-};
-
-
-
 class BitVector : public Vector {
 
 
@@ -145,14 +86,6 @@
 
 
void zero() { fill(0); }
-
-   /**@name FEC operations. */
-   //@{
-   /** Calculate the syndrome of the vector with the given Generator. */
-   uint64_t syndrome(Generator& gen) const;
-   /** Calculate the parity word for the vector with the given Generator. 
*/
-   uint64_t parity(Generator& gen) const;
-   //@}
 
 
/** Invert 0<->1. */

-- 
To view, visit https://gerrit.osmocom.org/2763
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1509e785c1187ebdafe5b2518bd298fbbd1cd036
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


[PATCH] osmo-trx[master]: WIP:sigProcLib: Reduce burst detection window for NB.

2017-05-28 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/2765

WIP:sigProcLib: Reduce burst detection window for NB.

Otherwise we detect bursts with search window far beyond specified.

Change-Id: If3cb40d2311504a13c03e1fbccad663ac201d9a4
---
M Transceiver52M/sigProcLib.cpp
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index c51d094..e47c985 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -1849,8 +1849,8 @@
 return -SIGERR_UNSUPPORTED;
 
   target = 3 + 58 + 16 + 5;
-  head = 6;
-  tail = 6 + max_toa;
+  head = 3;
+  tail = 3 + max_toa;
   sync = gMidambles[tsc];
 
   rc = detectGeneralBurst(burst, threshold, sps, amplitude, toa,

-- 
To view, visit https://gerrit.osmocom.org/2765
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If3cb40d2311504a13c03e1fbccad663ac201d9a4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


osmo-trx[master]: WIP:sigProcLib: Reduce burst detection window for NB.

2017-05-28 Thread Alexander Chemeris

Patch Set 1:

Tom, could you explain why did you set search window to -/+6 symbols? My 
experiments showed that at least `tail` should be set to 3 in order for 
`max_toa` to actually represent maximum TOA. And same for `head` - from my 
experiments I think it should be 3.

-- 
To view, visit https://gerrit.osmocom.org/2765
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If3cb40d2311504a13c03e1fbccad663ac201d9a4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>
Gerrit-HasComments: No


[PATCH] osmo-trx[master]: sigProcLib: Fix number of tail bits in random Normal Bursts ...

2017-05-29 Thread Alexander Chemeris
Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/2762

to look at the new patch set (#2).

sigProcLib: Fix number of tail bits in random Normal Bursts and zero Stealing 
Bits.

This bug only affects generation of normal bursts filled with random bits which
are used in test mode. It doesn't affect operation of osmo-trx during normal
operation. That's why it has stayed unnoticed for so long.

Each Normal Burst has 3 tail bits, not 4.
Also it's better to set stealing bits to 0 for maximum compatibility. We may 
want to
introduce a selector for each bit whether to set it to 0, to 1 or to a random 
number.

Change-Id: I0377029556c8b681b3ba3b635bf19572b34546ea
---
M Transceiver52M/sigProcLib.cpp
1 file changed, 9 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/62/2762/2

diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index c51d094..9a8c824 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -927,19 +927,25 @@
   signalVector *burst;
 
   /* Tail bits */
-  for (; i < 4; i++)
+  for (; i < 3; i++)
 (*bits)[i] = 0;
 
   /* Random bits */
-  for (; i < 61; i++)
+  for (; i < 60; i++)
 (*bits)[i] = rand() % 2;
+
+  /* Stealing bit */
+  (*bits)[i++] = 0;
 
   /* Training sequence */
   for (int n = 0; i < 87; i++, n++)
 (*bits)[i] = gTrainingSequence[tsc][n];
 
+  /* Stealing bit */
+  (*bits)[i++] = 0;
+
   /* Random bits */
-  for (; i < 144; i++)
+  for (; i < 145; i++)
 (*bits)[i] = rand() % 2;
 
   /* Tail bits */

-- 
To view, visit https://gerrit.osmocom.org/2762
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0377029556c8b681b3ba3b635bf19572b34546ea
Gerrit-PatchSet: 2
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>


osmo-trx[master]: sigProcLib: Fix number of tail bits in random Normal Bursts ...

2017-05-29 Thread Alexander Chemeris

Patch Set 2:

> Yes, I learned this "the hard way". My point is: The commit message
 > should clearly state that this is only for generation of random
 > test bursts and not a general bug in actual TRX code.

Ok, I've updated the commit message to make it more obvious.

-- 
To view, visit https://gerrit.osmocom.org/2762
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0377029556c8b681b3ba3b635bf19572b34546ea
Gerrit-PatchSet: 2
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>
Gerrit-HasComments: No


osmo-trx[master]: PRBS: a Pseudo-random binary sequence (PRBS) generator class.

2017-05-29 Thread Alexander Chemeris

Patch Set 1:

Harald - I agree that in general it would make sense to have PRBS in 
libosmocore. But I'm not very familiar with the libosmocore coding style, so I 
would appreciate to commit this patch as is to osmo-trx and then move the code 
to libosmocore later if someone more familiar with it volunteers to do that. 
Given there are no other users for PRBS right now and it's literally just a 
couple lines of code, i think it's not a big hurdle.

-- 
To view, visit https://gerrit.osmocom.org/2764
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib5331ba5d0b5819929541686fdd87905e2177b74
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>
Gerrit-HasComments: No


osmo-trx[master]: sigProcLib: Fix number of tail bits in random Normal Bursts ...

2017-05-29 Thread Alexander Chemeris

Patch Set 1:

Harald, this function is used only when we generate bursts locally at osmo-trx, 
which is currently only used for generation of test random bursts.

-- 
To view, visit https://gerrit.osmocom.org/2762
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0377029556c8b681b3ba3b635bf19572b34546ea
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>
Gerrit-HasComments: No


osmo-trx[master]: WIP:sigProcLib: Reduce burst detection window for NB.

2017-05-30 Thread Alexander Chemeris

Patch Set 1:

(2 comments)

https://gerrit.osmocom.org/#/c/2765/1//COMMIT_MSG
Commit Message:

PS1, Line 7: W
> I this is still WIP, I am not sure it should be submitted to gerit? If it's
I thought it's better to discuss it here with the code/patch in front of us. I 
can probably move the discussion to the mailing list if you think this is not 
the right place.


Line 9: Otherwise we detect bursts with search window far beyond specified.
> specified by whom / where? Would be good to have a spec reference here.
Specified by the max_toa variable.


-- 
To view, visit https://gerrit.osmocom.org/2765
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If3cb40d2311504a13c03e1fbccad663ac201d9a4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>
Gerrit-HasComments: Yes


osmo-trx[master]: WIP:sigProcLib: Reduce burst detection window for NB.

2017-05-30 Thread Alexander Chemeris

Patch Set 1:

> > Tom, could you explain why did you set search window to -/+6
 > > symbols? My experiments showed that at least `tail` should be set
 > > to 3 in order for `max_toa` to actually represent maximum TOA.
 > And
 > > same for `head` - from my experiments I think it should be 3.
 > 
 > Previous pre-search or 'head' settings on normal have come from
 > experimentation.
 > 
 > In number of symbols:
 > 
 > 5 - Original OpenBTS / Range Networks
 > 4 - Reduced during filter & SSE rewrite
 > 6 - Expanded in e90c24c8 to account for timestamp jitter in certain
 > configurations
 > 
 > With 3 symbols, have you checked TSC timing stability in the 4/1
 > sps mode where jitter is/was most severe?

That's an interesting point. I so far has tested in a receive only application 
where there is no Rx/Tx difference issues - we always do blind detection.

Btw, if I understand correctly what you're talking about - it's not "jitter", 
i.e. it doesn't change in time, there is an error which is static after PLL has 
been locked.

I think we should deal with it by setting max_toa accordingly instead of 
changing these fundamental values.

-- 
To view, visit https://gerrit.osmocom.org/2765
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If3cb40d2311504a13c03e1fbccad663ac201d9a4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou <t...@tsou.cc>
Gerrit-HasComments: No


osmo-bts[master]: osmo-bts-trx: remove global variables from loops

2017-08-24 Thread Alexander Chemeris

Patch Set 2: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/3601
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I01d7c1abad67e51b886a4ecf2de072929d67da27
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-HasComments: No


osmo-msc[master]: libmsc: Fix VTY output for handover counters.

2017-08-24 Thread Alexander Chemeris

Patch Set 1:

I've received a ping about this patch, but I don't think I need to do anything 
here. Please let me know if you need anything

-- 
To view, visit https://gerrit.osmocom.org/3614
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9512330f2e91d2f526751c5228e6e8e0fe17d579
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofm...@sysmocom.de>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofm...@sysmocom.de>
Gerrit-HasComments: No


libosmocore[master]: gsm0480: modify USSD structures to support external handling

2017-08-28 Thread Alexander Chemeris

Patch Set 2:

> Hi Harald,
 > 
 > Sorry for late response. Regarding to the ABI / API breaking
 > problem,
 > we have discussed suggested solution with Alexander: adding an
 > 'osmo'
 > prefix that is currently missed for exposed symbols would be great.

We may want to change the structure again in near future, e.g. to allow partial 
message decoding. So I think there should be a more long term sustainable way 
than adding prefixes. I think incrementing minor library version is a 
recommended way for libraries?

Harald - your input would be greatly appreciated.

-- 
To view, visit https://gerrit.osmocom.org/3374
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Ivan Kluchnikov <kluchnik...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-HasComments: No


libosmocore[master]: gsm0480: modify USSD structures to support external handling

2017-08-28 Thread Alexander Chemeris

Patch Set 2:

> I thought the idea was to use TODO-RELEASE file to track API/ABI
 > breakage until release. I've documented it here 
 > https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release

Looks like a good option to me

-- 
To view, visit https://gerrit.osmocom.org/3374
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Ivan Kluchnikov <kluchnik...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-HasComments: No


osmo-bts[master]: osmo-bts-trx: Fix reported frame number during PRIM_INFO_MEAS

2017-12-03 Thread Alexander Chemeris

Patch Set 3: Code-Review+1

I don't have equipment right now to test this, but the code looks good on the 
first glance.

Just one comment - is this requirement of sending the first frame number 
documented in the parameters of the relevant functions? That would be great to 
have it there to avoid mistakes in future.

-- 
To view, visit https://gerrit.osmocom.org/5136
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I1065ae9c400bb5240a63ab8213aee59aeb9ceeff
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: dexter <pma...@sysmocom.de>
Gerrit-HasComments: No


osmo-trx[master]: UHDDevice.cpp: add USRP B205mini support

2017-12-03 Thread Alexander Chemeris

Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/5150
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iee575121248ea541f7abc49055e49ec2d30904c0
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop

2017-10-30 Thread Alexander Chemeris

Patch Set 5: Code-Review-1

(1 comment)

We hit this issue in one of our installations, so I'm glad to see a work to 
resolve this. In that case though, we just increased the length of the 
automatically generated extensions to make sure they never overflow.

https://gerrit.osmocom.org/#/c/3910/5/openbsc/src/libmsc/db.c
File openbsc/src/libmsc/db.c:

Line 1425:  "WHERE extension IS NOT NULL");
This way of counting will give wrong results when you have a mix of 
automatically assigned extension numbers and manually assigned ones (with a 
different length) like we have in some of our installations. You can probably 
limit the SELECT here to extensions of a given length or between MIN and MAX to 
make this more robust.


-- 
To view, visit https://gerrit.osmocom.org/3910
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42
Gerrit-PatchSet: 5
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Keith Whyte <ke...@rhizomatica.org>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Ivan Kluchnikov <kluchnik...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Keith Whyte <ke...@rhizomatica.org>
Gerrit-Reviewer: Neels Hofmeyr <nhofm...@sysmocom.de>
Gerrit-Reviewer: Pablo Neira Ayuso <pa...@gnumonks.org>
Gerrit-HasComments: Yes


osmo-trx[master]: doc: examples: Add umtrx sample config

2018-05-04 Thread Alexander Chemeris

Patch Set 1:

Yes, Pau is correct.

-- 
To view, visit https://gerrit.osmocom.org/7890
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id38de0bbbe75e5e6bbb0de2eecb7d1984786d528
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pes...@sysmocom.de>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol <pes...@sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: ttsou <t...@tsou.cc>
Gerrit-HasComments: No


Change in libosmocore[master]: GSUP: introduce new messages for SS/USSD payloads

2018-05-30 Thread Alexander Chemeris
Alexander Chemeris has posted comments on this change. ( 
https://gerrit.osmocom.org/7600 )

Change subject: GSUP: introduce new messages for SS/USSD payloads
..


Patch Set 5:

(1 comment)

https://gerrit.osmocom.org/#/c/7600/5/tests/gsup/gsup_test.c
File tests/gsup/gsup_test.c:

https://gerrit.osmocom.org/#/c/7600/5/tests/gsup/gsup_test.c@323
PS5, Line 323: maximal
s/maximal/maximum/



--
To view, visit https://gerrit.osmocom.org/7600
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie17a78043a35fffbdd59e80fd2b2da39cce5e532
Gerrit-Change-Number: 7600
Gerrit-PatchSet: 5
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Wed, 30 May 2018 22:28:57 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-msc[master]: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions

2018-06-22 Thread Alexander Chemeris
Alexander Chemeris has posted comments on this change. ( 
https://gerrit.osmocom.org/9711 )

Change subject: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions
..


Patch Set 1:

Is there a counter which shows a number of currently active SS/USSD 
connections? I.e. active at the moment of querying. That's an important metric.


--
To view, visit https://gerrit.osmocom.org/9711
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I23c9475abc9951d82f3342fdc5aaa367836f7741
Gerrit-Change-Number: 9711
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Fri, 22 Jun 2018 21:57:58 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-msc[master]: libmsc/gsm_09_11.c: properly handle MS-initiated release

2018-06-22 Thread Alexander Chemeris
Alexander Chemeris has posted comments on this change. ( 
https://gerrit.osmocom.org/9703 )

Change subject: libmsc/gsm_09_11.c: properly handle MS-initiated release
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/9703
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I76fc277bf9db614a97824b1541cd5bb75aa3e29d
Gerrit-Change-Number: 9703
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Fri, 22 Jun 2018 21:58:37 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: libmsc/gsm_09_11.c: introduce counter for active sessions

2018-06-26 Thread Alexander Chemeris
Alexander Chemeris has posted comments on this change. ( 
https://gerrit.osmocom.org/9745 )

Change subject: libmsc/gsm_09_11.c: introduce counter for active sessions
..


Patch Set 1: Code-Review+1

Looks great!
I wonder if it's possible to split SS from USSD but that's a minor issue.


--
To view, visit https://gerrit.osmocom.org/9745
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia17e7c747fffb5267d3ca5bc4193c1be4a57ef3a
Gerrit-Change-Number: 9745
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Tue, 26 Jun 2018 12:24:44 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions

2018-06-23 Thread Alexander Chemeris
Alexander Chemeris has posted comments on this change. ( 
https://gerrit.osmocom.org/9711 )

Change subject: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions
..


Patch Set 1:

I don't think something can be deprecated until there is a replacement? So it's 
either not deprecated, or there is another way to do this I assume. Let's wait 
for Harald to clarify.


--
To view, visit https://gerrit.osmocom.org/9711
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I23c9475abc9951d82f3342fdc5aaa367836f7741
Gerrit-Change-Number: 9711
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Sat, 23 Jun 2018 09:51:01 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-msc[master]: libmsc/gsm_09_11.c: introduce counter for active sessions

2018-06-26 Thread Alexander Chemeris
Alexander Chemeris has posted comments on this change. ( 
https://gerrit.osmocom.org/9745 )

Change subject: libmsc/gsm_09_11.c: introduce counter for active sessions
..


Patch Set 1:

> > I wonder if it's possible to split SS from USSD but that's a
 > minor issue.
 >
 > Unfortunately, this is impossible because we don't parse the
 > GSM 04.80 payload of Facility IE in OsmoMSC. Should be possible
 > in OsmoHLR meanwhile ;)

I see. Please add it to OsmoHLR when you get to that point!


--
To view, visit https://gerrit.osmocom.org/9745
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia17e7c747fffb5267d3ca5bc4193c1be4a57ef3a
Gerrit-Change-Number: 9745
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Tue, 26 Jun 2018 13:00:51 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


libosmocore[master]: gsm0480: skip length check for 'RELEASE COMPLETE' message

2018-01-10 Thread Alexander Chemeris

Patch Set 6: Code-Review+1

The code looks proper now.

-- 
To view, visit https://gerrit.osmocom.org/3373
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I63b7f8ce403169a9dbdbdb031db16693de2196d6
Gerrit-PatchSet: 6
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-HasComments: No


libosmocore[master]: gsm0480: parse GSM0480_MTYPE_FACILITY separately

2018-01-10 Thread Alexander Chemeris

Patch Set 6: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/3377
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I6e029c436a50fa8c2823ea39c5d123ee701becfa
Gerrit-PatchSet: 6
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Ivan Kluchnikov <kluchnik...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


libosmocore[master]: gsm0480: increase the MAX_LEN_USSD_STRING to 182

2018-01-10 Thread Alexander Chemeris

Patch Set 3: Code-Review-1

Please move the description of this calculation from the commit message to a 
comment. It should be easily understood when you browse the code.

-- 
To view, visit https://gerrit.osmocom.org/5712
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: Alexander Chemeris <alexander.cheme...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-HasComments: No


[PATCH] pysim[master]: Make derive_milenage_opc and calculate_luhn publicly availab...

2018-01-10 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/5745

Make derive_milenage_opc and calculate_luhn publicly available through utils.py

Change-Id: I2effc85fd55da0981de0ada74dcb28b7e8e56a01
---
M pySim-prog.py
M pySim/utils.py
2 files changed, 22 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/45/5745/1

diff --git a/pySim-prog.py b/pySim-prog.py
index 44ca1fd..c08f43b 100755
--- a/pySim-prog.py
+++ b/pySim-prog.py
@@ -39,7 +39,7 @@
 
 from pySim.commands import SimCardCommands
 from pySim.cards import _cards_classes
-from pySim.utils import h2b, swap_nibbles, rpad
+from pySim.utils import h2b, swap_nibbles, rpad, derive_milenage_opc, 
calculate_luhn
 
 
 def parse_options():
@@ -233,24 +233,6 @@
out.append(chr(x))
 
return ''.join(out)
-
-def calculate_luhn(cc):
-   num = map(int, str(cc))
-   check_digit = 10 - sum(num[-2::-2] + [sum(divmod(d * 2, 10)) for d in 
num[::-2]]) % 10
-   return 0 if check_digit == 10 else check_digit
-
-def derive_milenage_opc(ki_hex, op_hex):
-   """
-   Run the milenage algorithm.
-   """
-   from Crypto.Cipher import AES
-   from Crypto.Util.strxor import strxor
-   from pySim.utils import b2h
-
-   # We pass in hex string and now need to work on bytes
-   aes = AES.new(h2b(ki_hex))
-   opc_bytes = aes.encrypt(h2b(op_hex))
-   return b2h(strxor(opc_bytes, h2b(op_hex)))
 
 def gen_parameters(opts):
"""Generates Name, ICCID, MCC, MNC, IMSI, SMSP, Ki, PIN-ADM from the
diff --git a/pySim/utils.py b/pySim/utils.py
index 43d52dd..17dc693 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -92,3 +92,24 @@
if hplmn_disp: byte1 = byte1|0x01
if oplmn_disp: byte1 = byte1|0x02
return i2h([byte1])+s2h(name)
+
+def derive_milenage_opc(ki_hex, op_hex):
+   """
+   Run the milenage algorithm to calculate OPC from Ki and OP
+   """
+   from Crypto.Cipher import AES
+   from Crypto.Util.strxor import strxor
+   from pySim.utils import b2h
+
+   # We pass in hex string and now need to work on bytes
+   aes = AES.new(h2b(ki_hex))
+   opc_bytes = aes.encrypt(h2b(op_hex))
+   return b2h(strxor(opc_bytes, h2b(op_hex)))
+
+def calculate_luhn(cc):
+   """
+   Calculate Luhn checksum used in e.g. ICCID and IMEI
+   """
+   num = map(int, str(cc))
+   check_digit = 10 - sum(num[-2::-2] + [sum(divmod(d * 2, 10)) for d in 
num[::-2]]) % 10
+   return 0 if check_digit == 10 else check_digit

-- 
To view, visit https://gerrit.osmocom.org/5745
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2effc85fd55da0981de0ada74dcb28b7e8e56a01
Gerrit-PatchSet: 1
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <alexander.cheme...@gmail.com>


  1   2   >