Change in osmocom-bb[master]: trx_toolkit/transceiver.py: add optional transceiver name

2019-01-13 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/12549


Change subject: trx_toolkit/transceiver.py: add optional transceiver name
..

trx_toolkit/transceiver.py: add optional transceiver name

Since fake_trx.py can handle multiple transceivers, it may be useful
to name transceivers. If transceiver has some name, it will appear
in logging messages, for example:

  [INFO] transceiver.py:104 Init transceiver 'BTS@127.0.0.1:5700'
  [INFO] transceiver.py:104 Init transceiver 'MS@127.0.0.1:6700'
  [INFO] transceiver.py:104 Init transceiver '127.0.0.1:5700/1'

This change additionally assigns names to the both default
transceivers, and extends the '--trx' option with ability
to specify some name, for example:

  --trx foo@127.0.0.1:5700 or --trx bar@127.0.0.1:5700/1
  --trx ipv6@[2001:0db8:85a3:::8a2e:0370:7334]:6700

Change-Id: I2f58f02e7819bb008b8aab1a8bf9e0adeb2e44ec
---
M src/target/trx_toolkit/fake_trx.py
M src/target/trx_toolkit/transceiver.py
2 files changed, 26 insertions(+), 13 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/49/12549/1

diff --git a/src/target/trx_toolkit/fake_trx.py 
b/src/target/trx_toolkit/fake_trx.py
index 294a819..928333f 100755
--- a/src/target/trx_toolkit/fake_trx.py
+++ b/src/target/trx_toolkit/fake_trx.py
@@ -288,31 +288,34 @@
self.fake_pm.trx_list = self.trx_list

# Init TRX instance for BTS
-   self.append_trx(self.argv.bts_addr, self.argv.bts_base_port)
+   self.append_trx(self.argv.bts_addr,
+   self.argv.bts_base_port, name = "BTS")

# Init TRX instance for BB
-   self.append_trx(self.argv.bb_addr, self.argv.bb_base_port)
+   self.append_trx(self.argv.bb_addr,
+   self.argv.bb_base_port, name = "MS")

# Additional transceivers (optional)
if self.argv.trx_list is not None:
for trx_def in self.argv.trx_list:
-   (addr, port, idx) = trx_def
-   self.append_child_trx(addr, port, idx)
+   (name, addr, port, idx) = trx_def
+   self.append_child_trx(addr, port, idx, name)

# Burst forwarding between transceivers
self.burst_fwd = BurstForwarder(self.trx_list)

log.info("Init complete")

-   def append_trx(self, remote_addr, base_port):
+   def append_trx(self, remote_addr, base_port, name = None):
trx = FakeTRX(self.argv.trx_bind_addr, remote_addr, base_port,
-   clck_gen = self.clck_gen, pwr_meas = self.fake_pm)
+   clck_gen = self.clck_gen, pwr_meas = self.fake_pm,
+   name = name)
self.trx_list.add_trx(trx)

-   def append_child_trx(self, remote_addr, base_port, child_idx):
+   def append_child_trx(self, remote_addr, base_port, child_idx, name = 
None):
# Index 0 corresponds to the first transceiver
if child_idx is 0:
-   self.append_trx(remote_addr, base_port)
+   self.append_trx(remote_addr, base_port, name)
return

# Find 'parent' transceiver for a new child
@@ -323,7 +326,7 @@

# Allocate a new child
trx_child = FakeTRX(self.argv.trx_bind_addr, remote_addr, 
base_port,
-   child_idx = child_idx, pwr_meas = self.fake_pm)
+   child_idx = child_idx, pwr_meas = self.fake_pm, name = 
name)
self.trx_list.add_trx(trx_child)

# Link a new 'child' with its 'parent'
@@ -363,11 +366,12 @@
# format: REMOTE_ADDR:BIND_PORT[/TRX_NUM]
# e.g. [2001:0db8:85a3:::8a2e:0370:7334]:5700/5
# e.g. 127.0.0.1:5700 or 127.0.0.1:5700/1
+   # e.g. foo@127.0.0.1:5700 or bar@127.0.0.1:5700/1
@staticmethod
def trx_def(val):
try:
-   result = re.match("(.+):([0-9]+)(\/[0-9]+)?", val)
-   (addr, port, idx) = result.groups()
+   result = re.match("(.+@)?(.+):([0-9]+)(\/[0-9]+)?", val)
+   (name, addr, port, idx) = result.groups()
except:
raise argparse.ArgumentTypeError("Invalid TRX 
definition: %s" % val)

@@ -376,7 +380,11 @@
else:
idx = 0

-   return (addr, int(port), idx)
+   # Cut '@' from TRX name
+   if name is not None:
+   name = name[:-1]
+
+   return (name, addr, int(port), idx)

def parse_argv(self):
parser = argparse.ArgumentParser(prog = "fake_trx",
diff --git 

Change in osmocom-bb[master]: trx_toolkit/fake_trx.py: move init code to __init__()

2019-01-13 Thread Vadim Yanitskiy
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/12545

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

Change subject: trx_toolkit/fake_trx.py: move init code to __init__()
..

trx_toolkit/fake_trx.py: move init code to __init__()

Change-Id: I84969630348a189d237cc98354e568421839a37b
---
M src/target/trx_toolkit/fake_trx.py
1 file changed, 30 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/45/12545/2
--
To view, visit https://gerrit.osmocom.org/12545
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I84969630348a189d237cc98354e568421839a37b
Gerrit-Change-Number: 12545
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmocom-bb[master]: trx_toolkit/{ctrl, data}_if.py: add init log message

2019-01-13 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/12547


Change subject: trx_toolkit/{ctrl,data}_if.py: add init log message
..

trx_toolkit/{ctrl,data}_if.py: add init log message

Change-Id: I1a2caf6999ed4f33df76328e48ff5076d166d9fe
---
M src/target/trx_toolkit/ctrl_if.py
M src/target/trx_toolkit/ctrl_if_trx.py
M src/target/trx_toolkit/data_if.py
3 files changed, 8 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/47/12547/1

diff --git a/src/target/trx_toolkit/ctrl_if.py 
b/src/target/trx_toolkit/ctrl_if.py
index 45bfa2b..a1c19f0 100644
--- a/src/target/trx_toolkit/ctrl_if.py
+++ b/src/target/trx_toolkit/ctrl_if.py
@@ -27,6 +27,10 @@
 from udp_link import UDPLink

 class CTRLInterface(UDPLink):
+   def __init__(self, *udp_link_args):
+   UDPLink.__init__(self, *udp_link_args)
+   log.debug("Init CTRL interface (%s)" % self.desc_link())
+
def handle_rx(self):
# Read data from socket
data, remote = self.sock.recvfrom(128)
diff --git a/src/target/trx_toolkit/ctrl_if_trx.py 
b/src/target/trx_toolkit/ctrl_if_trx.py
index 0d4935d..26a844f 100644
--- a/src/target/trx_toolkit/ctrl_if_trx.py
+++ b/src/target/trx_toolkit/ctrl_if_trx.py
@@ -46,7 +46,6 @@

def __init__(self, trx, *udp_link_args):
CTRLInterface.__init__(self, *udp_link_args)
-   log.info("Init CTRL interface (%s)" % self.desc_link())

# Link with Transceiver instance we belong to
self.trx = trx
diff --git a/src/target/trx_toolkit/data_if.py 
b/src/target/trx_toolkit/data_if.py
index a773c04..b1ba1e5 100644
--- a/src/target/trx_toolkit/data_if.py
+++ b/src/target/trx_toolkit/data_if.py
@@ -28,6 +28,10 @@
 from data_msg import *

 class DATAInterface(UDPLink):
+   def __init__(self, *udp_link_args):
+   UDPLink.__init__(self, *udp_link_args)
+   log.debug("Init DATA interface (%s)" % self.desc_link())
+
def recv_raw_data(self):
data, _ = self.sock.recvfrom(512)
return data

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a2caf6999ed4f33df76328e48ff5076d166d9fe
Gerrit-Change-Number: 12547
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 


Change in osmocom-bb[master]: trx_toolkit/transceiver.py: add init logging message

2019-01-13 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/12548


Change subject: trx_toolkit/transceiver.py: add init logging message
..

trx_toolkit/transceiver.py: add init logging message

Change-Id: I9a8b327748fbfcbae438cb531cd0b2767b6ca4dd
---
M src/target/trx_toolkit/transceiver.py
1 file changed, 2 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/48/12548/1

diff --git a/src/target/trx_toolkit/transceiver.py 
b/src/target/trx_toolkit/transceiver.py
index 4eb210b..55e4ebd 100644
--- a/src/target/trx_toolkit/transceiver.py
+++ b/src/target/trx_toolkit/transceiver.py
@@ -98,6 +98,8 @@
self.base_port = base_port
self.child_idx = child_idx

+   log.info("Init transceiver '%s'" % self)
+
# Child transceiver cannot have its own clock
if clck_gen is not None and child_idx > 0:
raise TypeError("Child transceiver cannot have its own 
clock")

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9a8b327748fbfcbae438cb531cd0b2767b6ca4dd
Gerrit-Change-Number: 12548
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 


Change in osmocom-bb[master]: trx_toolkit/fake_trx.py: move init code to __init__()

2019-01-13 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/12545


Change subject: trx_toolkit/fake_trx.py: move init code to __init__()
..

trx_toolkit/fake_trx.py: move init code to __init__()

Change-Id: I84969630348a189d237cc98354e568421839a37b
---
M src/target/trx_toolkit/fake_trx.py
1 file changed, 26 insertions(+), 26 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/45/12545/1

diff --git a/src/target/trx_toolkit/fake_trx.py 
b/src/target/trx_toolkit/fake_trx.py
index 0bf9266..a94f1de 100755
--- a/src/target/trx_toolkit/fake_trx.py
+++ b/src/target/trx_toolkit/fake_trx.py
@@ -275,6 +275,32 @@
# List of all transceivers
self.trx_list = TRXList()

+   # Init shared clock generator
+   self.clck_gen = CLCKGen([])
+
+   # Power measurement emulation
+   # Noise: -120 .. -105
+   # BTS: -75 .. -50
+   self.fake_pm = FakePM(-120, -105, -75, -50)
+   self.fake_pm.trx_list = self.trx_list
+
+   # Init TRX instance for BTS
+   self.append_trx(self.argv.bts_addr, self.argv.bts_base_port)
+
+   # Init TRX instance for BB
+   self.append_trx(self.argv.bb_addr, self.argv.bb_base_port)
+
+   # Additional transceivers (optional)
+   if self.argv.trx_list is not None:
+   for trx_def in self.argv.trx_list:
+   (addr, port, idx) = trx_def
+   self.append_child_trx(addr, port, idx)
+
+   # Burst forwarding between transceivers
+   self.burst_fwd = BurstForwarder(self.trx_list)
+
+   log.info("Init complete")
+
def append_trx(self, remote_addr, base_port):
trx = FakeTRX(self.argv.trx_bind_addr, remote_addr, base_port,
clck_gen = self.clck_gen, pwr_meas = self.fake_pm)
@@ -301,38 +327,12 @@
trx_parent.child_trx_list.add_trx(trx_child)

def run(self):
-   # Init shared clock generator
-   self.clck_gen = CLCKGen([])
-
-   # Power measurement emulation
-   # Noise: -120 .. -105
-   # BTS: -75 .. -50
-   self.fake_pm = FakePM(-120, -105, -75, -50)
-   self.fake_pm.trx_list = self.trx_list
-
-   # Init TRX instance for BTS
-   self.append_trx(self.argv.bts_addr, self.argv.bts_base_port)
-
-   # Init TRX instance for BB
-   self.append_trx(self.argv.bb_addr, self.argv.bb_base_port)
-
-   # Additional transceivers (optional)
-   if self.argv.trx_list is not None:
-   for trx_def in self.argv.trx_list:
-   (addr, port, idx) = trx_def
-   self.append_child_trx(addr, port, idx)
-
-   # Burst forwarding between transceivers
-   self.burst_fwd = BurstForwarder(self.trx_list)
-
# Compose list of to be monitored sockets
self.sock_list = []
for trx in self.trx_list:
self.sock_list.append(trx.ctrl_if.sock)
self.sock_list.append(trx.data_if.sock)

-   log.info("Init complete")
-
# Enter main loop
while True:
# Wait until we get any data on any socket

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I84969630348a189d237cc98354e568421839a37b
Gerrit-Change-Number: 12545
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 


Change in osmocom-bb[master]: trx_toolkit/fake_trx.py: enrich TRX logging messages

2019-01-13 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/12546


Change subject: trx_toolkit/fake_trx.py: enrich TRX logging messages
..

trx_toolkit/fake_trx.py: enrich TRX logging messages

Since fake_trx.py can handle multiple transceivers, it makes sense
to print some info in logging messages about transceivers they
belong to. This acvieved by defining __str__() for Transceiver.

Some examples:

  [DEBUG] ctrl_if_trx.py:83 (127.0.0.1:5700) Recv POWEROFF cmd
  [INFO] ctrl_if_trx.py:85 (127.0.0.1:5700) Stopping transceiver...

  [DEBUG] ctrl_if_trx.py:95 (127.0.0.1:5700/1) Recv RXTUNE cmd
  [DEBUG] ctrl_if_trx.py:102 (127.0.0.1:5700/1) Recv TXTUNE cmd
  [DEBUG] ctrl_if_trx.py:155 (127.0.0.1:5700/1) Ignore CMD SETTSC
  [DEBUG] ctrl_if_trx.py:155 (127.0.0.1:5700/1) Ignore CMD SETPOWER

Change-Id: I1f706790a2da226f1418f89d2cfbb55baa6ea624
---
M src/target/trx_toolkit/ctrl_if_trx.py
M src/target/trx_toolkit/fake_trx.py
M src/target/trx_toolkit/transceiver.py
3 files changed, 41 insertions(+), 30 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/46/12546/1

diff --git a/src/target/trx_toolkit/ctrl_if_trx.py 
b/src/target/trx_toolkit/ctrl_if_trx.py
index 83d55db..0d4935d 100644
--- a/src/target/trx_toolkit/ctrl_if_trx.py
+++ b/src/target/trx_toolkit/ctrl_if_trx.py
@@ -59,19 +59,19 @@

# Power control
if self.verify_cmd(request, "POWERON", 0):
-   log.debug("Recv POWERON CMD")
+   log.debug("(%s) Recv POWERON CMD" % self.trx)

# Ensure transceiver isn't working
if self.trx.running:
-   log.error("Transceiver already started")
+   log.error("(%s) Transceiver already started" % 
self.trx)
return -1

# Ensure RX / TX freq. are set
if (self.trx.rx_freq is None) or (self.trx.tx_freq is 
None):
-   log.error("RX / TX freq. are not set")
+   log.error("(%s) RX / TX freq. are not set" % 
self.trx)
return -1

-   log.info("Starting transceiver...")
+   log.info("(%s) Starting transceiver..." % self.trx)
self.trx.running = True

# Notify transceiver about that
@@ -80,9 +80,9 @@
return 0

elif self.verify_cmd(request, "POWEROFF", 0):
-   log.debug("Recv POWEROFF cmd")
+   log.debug("(%s) Recv POWEROFF cmd" % self.trx)

-   log.info("Stopping transceiver...")
+   log.info("(%s) Stopping transceiver..." % self.trx)
self.trx.running = False
 
# Notify transceiver about that
@@ -92,26 +92,27 @@

# Tuning Control
elif self.verify_cmd(request, "RXTUNE", 1):
-   log.debug("Recv RXTUNE cmd")
+   log.debug("(%s) Recv RXTUNE cmd" % self.trx)

# TODO: check freq range
self.trx.rx_freq = int(request[1]) * 1000
return 0

elif self.verify_cmd(request, "TXTUNE", 1):
-   log.debug("Recv TXTUNE cmd")
+   log.debug("(%s) Recv TXTUNE cmd" % self.trx)

# TODO: check freq range
self.trx.tx_freq = int(request[1]) * 1000
return 0

elif self.verify_cmd(request, "SETSLOT", 2):
-   log.debug("Recv SETSLOT cmd")
+   log.debug("(%s) Recv SETSLOT cmd" % self.trx)

# Obtain TS index
ts = int(request[1])
if ts not in range(0, 8):
-   log.error("TS index should be in range: 0..7")
+   log.error("(%s) TS index should be in "
+   "range: 0..7" % self.trx)
return -1

# Parse TS type
@@ -132,13 +133,13 @@

# Power measurement
if self.verify_cmd(request, "MEASURE", 1):
-   log.debug("Recv MEASURE cmd")
+   log.debug("(%s) Recv MEASURE cmd" % self.trx)

# Power Measurement interface is optional
# for Transceiver, thus may be uninitialized
if self.trx.pwr_meas is None:
-   log.error("Power Measurement interface "
-   "is not initialized => rejecting 
command")
+   

Change in osmocom-bb[master]: trx_toolkit/fake_trx.py: handle multiple transceivers

2019-01-13 Thread Vadim Yanitskiy
Vadim Yanitskiy has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12325 )

Change subject: trx_toolkit/fake_trx.py: handle multiple transceivers
..

trx_toolkit/fake_trx.py: handle multiple transceivers

Since Ice44e2b22566b3652ef6d43896055963b13ab185 is merged, the class
hierarchy has become much more flexible, so it's possible to create
multiple Transceiver / FakeTRX instances and distribute bursts using
a single instance of BurstForwarder.

This change introduces a new command line option, that can be used
to specify additional transceivers. Please note that fake_trx.py
still initializes a pair of BTS and BB transceivers by default.

The new option has the following format:

  --trx REMOTE_ADDR:BASE_PORT[/TRX_NUM]

Some examples for IPv4 and IPv6:

  --trx 127.0.0.1:5703
  --trx [2001:0db8:85a3:::8a2e:0370:7334]:6703

If optional TRX_NUM > 0 is specified, e.g.:

  --trx 127.0.0.1:5700/1

then this transceiver is considered as a child of another one.
See I7e97b7f32dde7ab74779133e9d7504f1d0fce60c for details.

Change-Id: Ibff31fb3a958a714c828d0dea7e87d47f778fd80
---
M src/target/trx_toolkit/fake_trx.py
1 file changed, 81 insertions(+), 31 deletions(-)

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



diff --git a/src/target/trx_toolkit/fake_trx.py 
b/src/target/trx_toolkit/fake_trx.py
index 46b413a..0f473d0 100755
--- a/src/target/trx_toolkit/fake_trx.py
+++ b/src/target/trx_toolkit/fake_trx.py
@@ -30,11 +30,13 @@
 import random
 import select
 import sys
+import re

 from app_common import ApplicationBase
 from burst_fwd import BurstForwarder
 from transceiver import Transceiver
 from clck_gen import CLCKGen
+from trx_list import TRXList
 from fake_pm import FakePM
 
 class FakeTRX(Transceiver):
@@ -270,6 +272,34 @@
# Configure logging
self.app_init_logging(self.argv)

+   # List of all transceivers
+   self.trx_list = TRXList()
+
+   def append_trx(self, remote_addr, base_port):
+   trx = FakeTRX(self.argv.trx_bind_addr, remote_addr, base_port,
+   clck_gen = self.clck_gen, pwr_meas = self.fake_pm)
+   self.trx_list.add_trx(trx)
+
+   def append_child_trx(self, remote_addr, base_port, child_idx):
+   # Index 0 corresponds to the first transceiver
+   if child_idx is 0:
+   self.append_trx(remote_addr, base_port)
+   return
+
+   # Find 'parent' transceiver for a new child
+   trx_parent = self.trx_list.find_trx(remote_addr, base_port)
+   if trx_parent is None:
+   raise IndexError("Couldn't find parent transceiver "
+   "for '%s:%d/%d'" % (remote_addr, base_port, 
child_idx))
+
+   # Allocate a new child
+   trx_child = FakeTRX(self.argv.trx_bind_addr, remote_addr, 
base_port,
+   child_idx = child_idx, pwr_meas = self.fake_pm)
+   self.trx_list.add_trx(trx_child)
+
+   # Link a new 'child' with its 'parent'
+   trx_parent.child_trx_list.add_trx(trx_child)
+
def run(self):
# Init shared clock generator
self.clck_gen = CLCKGen([])
@@ -280,49 +310,44 @@
self.fake_pm = FakePM(-120, -105, -75, -50)

# Init TRX instance for BTS
-   self.bts_trx = FakeTRX(self.argv.trx_bind_addr,
-   self.argv.bts_addr, self.argv.bts_base_port,
-   clck_gen = self.clck_gen)
+   self.append_trx(self.argv.bts_addr, self.argv.bts_base_port)

# Init TRX instance for BB
-   self.bb_trx = FakeTRX(self.argv.trx_bind_addr,
-   self.argv.bb_addr, self.argv.bb_base_port,
-   pwr_meas = self.fake_pm)
+   self.append_trx(self.argv.bb_addr, self.argv.bb_base_port)
+
+   # Additional transceivers (optional)
+   if self.argv.trx_list is not None:
+   for trx_def in self.argv.trx_list:
+   (addr, port, idx) = trx_def
+   self.append_child_trx(addr, port, idx)

# Burst forwarding between transceivers
-   self.burst_fwd = BurstForwarder()
-   self.burst_fwd.add_trx(self.bts_trx)
-   self.burst_fwd.add_trx(self.bb_trx)
+   self.burst_fwd = BurstForwarder(self.trx_list)
+
+   # Compose list of to be monitored sockets
+   self.sock_list = []
+   for trx in self.trx_list:
+   self.sock_list.append(trx.ctrl_if.sock)
+   self.sock_list.append(trx.data_if.sock)

log.info("Init complete")

# Enter main loop

Change in osmocom-bb[master]: trx_toolkit/fake_trx.py: fix: update trx_list of FakePM

2019-01-13 Thread Vadim Yanitskiy
Vadim Yanitskiy has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12543 )

Change subject: trx_toolkit/fake_trx.py: fix: update trx_list of FakePM
..

trx_toolkit/fake_trx.py: fix: update trx_list of FakePM

It seems in Ice44e2b22566b3652ef6d43896055963b13ab185 I forgot
to do this, so all measurements triggered by MEASURE command
were incorrect (always noise). Let's fix this!

Change-Id: I155f118b2d3e3b23eb148fe7e2630790f8fcd18c
---
M src/target/trx_toolkit/fake_trx.py
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/src/target/trx_toolkit/fake_trx.py 
b/src/target/trx_toolkit/fake_trx.py
index 0f473d0..0bf9266 100755
--- a/src/target/trx_toolkit/fake_trx.py
+++ b/src/target/trx_toolkit/fake_trx.py
@@ -308,6 +308,7 @@
# Noise: -120 .. -105
# BTS: -75 .. -50
self.fake_pm = FakePM(-120, -105, -75, -50)
+   self.fake_pm.trx_list = self.trx_list

# Init TRX instance for BTS
self.append_trx(self.argv.bts_addr, self.argv.bts_base_port)

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I155f118b2d3e3b23eb148fe7e2630790f8fcd18c
Gerrit-Change-Number: 12543
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmocom-bb[master]: trx_toolkit/transceiver.py: add support for child transceivers

2019-01-13 Thread Vadim Yanitskiy
Vadim Yanitskiy has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12541 )

Change subject: trx_toolkit/transceiver.py: add support for child transceivers
..

trx_toolkit/transceiver.py: add support for child transceivers

A BTS can (optionally) have more than one transceiver. In this case
additional (let's say child) transceivers basically share the same
clock source of the first transceiver, and being powered on / off
as soon as the first transceiver is powered on / off.

Change-Id: I7e97b7f32dde7ab74779133e9d7504f1d0fce60c
---
M src/target/trx_toolkit/transceiver.py
A src/target/trx_toolkit/trx_list.py
2 files changed, 100 insertions(+), 6 deletions(-)

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



diff --git a/src/target/trx_toolkit/transceiver.py 
b/src/target/trx_toolkit/transceiver.py
index edd4d31..57ca531 100644
--- a/src/target/trx_toolkit/transceiver.py
+++ b/src/target/trx_toolkit/transceiver.py
@@ -4,7 +4,7 @@
 # TRX Toolkit
 # Transceiver implementation
 #
-# (C) 2018 by Vadim Yanitskiy 
+# (C) 2018-2019 by Vadim Yanitskiy 
 #
 # All Rights Reserved
 #
@@ -27,6 +27,7 @@
 from ctrl_if_trx import CTRLInterfaceTRX
 from data_if import DATAInterface
 from udp_link import UDPLink
+from trx_list import TRXList

 class Transceiver:
""" Base transceiver implementation.
@@ -54,6 +55,21 @@
NOTE: we don't store the associated channel combinations,
  as they are only useful for burst detection and demodulation.
 
+   == Child transceivers
+
+   A BTS can (optionally) have more than one transceiver. In this case
+   additional (let's say child) transceivers basically share the same
+   clock source of the first transceiver, so UDP port mapping is a bit
+   different, for example:
+
+ (trx_0) clck=5700, ctrl=5701, data=5702,
+ (trx_1)ctrl=5703, data=5704,
+ (trx_2)ctrl=5705, data=5706.
+ ...
+
+   As soon as the first transceiver is powered on / off,
+   all child transceivers are also powered on / off.
+
== Clock distribution (optional)

The clock indications are not expected by L1 when transceiver
@@ -75,21 +91,26 @@
"""

def __init__(self, bind_addr, remote_addr, base_port,
-   clck_gen = None, pwr_meas = None):
+   child_idx = 0, clck_gen = None, pwr_meas = None):
# Connection info
self.remote_addr = remote_addr
self.bind_addr = bind_addr
self.base_port = base_port
+   self.child_idx = child_idx
+
+   # Child transceiver cannot have its own clock
+   if clck_gen is not None and child_idx > 0:
+   raise TypeError("Child transceiver cannot have its own 
clock")

# Init DATA interface
self.data_if = DATAInterface(
-   remote_addr, base_port + 102,
-   bind_addr, base_port + 2)
+   remote_addr, base_port + child_idx * 2 + 102,
+   bind_addr, base_port + child_idx * 2 + 2)

# Init CTRL interface
self.ctrl_if = CTRLInterfaceTRX(self,
-   remote_addr, base_port + 101,
-   bind_addr, base_port + 1)
+   remote_addr, base_port + child_idx * 2 + 101,
+   bind_addr, base_port + child_idx * 2 + 1)

# Init optional CLCK interface
self.clck_gen = clck_gen
@@ -111,12 +132,22 @@
# List of active (configured) timeslots
self.ts_list = []

+   # List of child transceivers
+   self.child_trx_list = TRXList()
+
# To be overwritten if required,
# no custom command handlers by default
def ctrl_cmd_handler(self, request):
return None

def power_event_handler(self, event):
+   # Update child transceivers
+   for trx in self.child_trx_list.trx_list:
+   if event == "POWERON":
+   trx.running = True
+   else:
+   trx.running = False
+
# Trigger clock generator if required
if self.clck_gen is not None:
clck_links = self.clck_gen.clck_links
diff --git a/src/target/trx_toolkit/trx_list.py 
b/src/target/trx_toolkit/trx_list.py
new file mode 100644
index 000..7bea560
--- /dev/null
+++ b/src/target/trx_toolkit/trx_list.py
@@ -0,0 +1,63 @@
+#!/usr/bin/env python2
+# -*- coding: utf-8 -*-
+
+# TRX Toolkit
+# Transceiver list implementation
+#
+# (C) 2019 by Vadim Yanitskiy 
+#
+# All Rights Reserved
+#
+# This program is free software; you can redistribute it and/or modify
+# it 

Build failed in Jenkins: master-asn1c ยป a1=default,a2=default,a3=default,a4=default,osmocom-master-debian9 #369

2019-01-13 Thread jenkins
See 


--
[...truncated 3.83 KB...]
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking for autoconf... /usr/bin/autoconf
checking for autoheader... /usr/bin/autoheader
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking how to run the C preprocessor... gcc -E
checking for a 

Change in osmo-ci[master]: add osmo-asf4-dfu master and gerrit jobs

2019-01-13 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/12544


Change subject: add osmo-asf4-dfu master and gerrit jobs
..

add osmo-asf4-dfu master and gerrit jobs

Change-Id: I5bc5ca30809af8d8b472a75a9e02c4964761de38
---
M jobs/gerrit-verifications.yml
M jobs/master-builds.yml
2 files changed, 2 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/44/12544/1

diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml
index 20eceef..c4737ff 100644
--- a/jobs/gerrit-verifications.yml
+++ b/jobs/gerrit-verifications.yml
@@ -254,6 +254,7 @@
   - osmo-sysmon
   - osmo-remsim
   - simtrace2
+  - osmo-asf4-dfu
   - gapk

   - pysim:
diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml
index 2fa40d9..52e3ca7 100644
--- a/jobs/master-builds.yml
+++ b/jobs/master-builds.yml
@@ -360,6 +360,7 @@

   - osmo-sysmon
   - osmo-remsim
+  - osmo-asf4-dfu
   - simtrace2:
   cmd: >
# keep first line with less indent to preserve newlines

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

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5bc5ca30809af8d8b472a75a9e02c4964761de38
Gerrit-Change-Number: 12544
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in openbsc[master]: Don't send SMS STATUS REPORT locally if the ESME accepted it.

2019-01-13 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12538 )

Change subject: Don't send SMS STATUS REPORT locally if the ESME accepted it.
..

Don't send SMS STATUS REPORT locally if the ESME accepted it.

Backport of https://gerrit.osmocom.org/11792/

When using smpp-first, after the ESME accepts our STATUS REPORT,
we were sending it locally into gsm340_rx_sms_submit() anyway.
In the case of the ESME mirroring the report back to us, this
would result in two copies of the status report in the SMS
database, which were also both then delivered to the MS.
Some MS then display the REPORT to the user as if it were
a normal SMS.

With this patch, we check if it is the sms_report that has had
receiver set in sms_route_mt_sms() and not the original SMS we
are reporting on, which of course already has receiver set.

Change-Id: I2136489bd21c4755463278a4048a446e5bc4a9d2
---
M openbsc/src/libmsc/gsm_04_11.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved



diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c
index 25ef487..d5619b2 100644
--- a/openbsc/src/libmsc/gsm_04_11.c
+++ b/openbsc/src/libmsc/gsm_04_11.c
@@ -697,7 +697,7 @@
}

/* No route via SMPP, send the GSM 03.40 status-report now. */
-   if (gsms->receiver)
+   if (sms_report->receiver)
gsm340_rx_sms_submit(sms_report);

LOGP(DLSMS, LOGL_NOTICE, "Status report has been sent\n");

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

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2136489bd21c4755463278a4048a446e5bc4a9d2
Gerrit-Change-Number: 12538
Gerrit-PatchSet: 1
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 


Change in openbsc[master]: Don't send SMS STATUS REPORT locally if the ESME accepted it.

2019-01-13 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12538 )

Change subject: Don't send SMS STATUS REPORT locally if the ESME accepted it.
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2136489bd21c4755463278a4048a446e5bc4a9d2
Gerrit-Change-Number: 12538
Gerrit-PatchSet: 1
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Sun, 13 Jan 2019 12:31:44 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmocom-bb[master]: trx_toolkit/fake_trx.py: handle multiple transceivers

2019-01-13 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12325 )

Change subject: trx_toolkit/fake_trx.py: handle multiple transceivers
..


Patch Set 3: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibff31fb3a958a714c828d0dea7e87d47f778fd80
Gerrit-Change-Number: 12325
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Sun, 13 Jan 2019 12:30:44 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmocom-bb[master]: trx_toolkit/fake_trx.py: fix: update trx_list of FakePM

2019-01-13 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12543 )

Change subject: trx_toolkit/fake_trx.py: fix: update trx_list of FakePM
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I155f118b2d3e3b23eb148fe7e2630790f8fcd18c
Gerrit-Change-Number: 12543
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Sun, 13 Jan 2019 12:30:27 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmocom-bb[master]: trx_toolkit/transceiver.py: add support for child transceivers

2019-01-13 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12541 )

Change subject: trx_toolkit/transceiver.py: add support for child transceivers
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7e97b7f32dde7ab74779133e9d7504f1d0fce60c
Gerrit-Change-Number: 12541
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 13 Jan 2019 12:30:04 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libusrp[master]: debian: Add 'sdcc' package to BuildDepends

2019-01-13 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12539 )

Change subject: debian: Add 'sdcc' package to BuildDepends
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: libusrp
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I23ca8d7ad26437f2c971608cd881a6f40e26a887
Gerrit-Change-Number: 12539
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 13 Jan 2019 12:29:04 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libusrp[master]: debian: Add 'sdcc' package to BuildDepends

2019-01-13 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12539 )

Change subject: debian: Add 'sdcc' package to BuildDepends
..

debian: Add 'sdcc' package to BuildDepends

We recently re-introduced building the USRP1 FX2 firmware
using SDCC.  This needs to be listed as requirement for building
the package, otherwise build are failing.

Change-Id: I23ca8d7ad26437f2c971608cd881a6f40e26a887
---
M debian/control
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/debian/control b/debian/control
index 7982c27..54bc7af 100644
--- a/debian/control
+++ b/debian/control
@@ -9,6 +9,7 @@
doxygen,
libtool,
pkg-config,
+   sdcc,
libusb-1.0-0-dev,
libboost-all-dev
 Standards-Version: 3.9.8

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

Gerrit-Project: libusrp
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I23ca8d7ad26437f2c971608cd881a6f40e26a887
Gerrit-Change-Number: 12539
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmocom-bb[master]: trx_toolkit/fake_trx.py: fix: update trx_list of FakePM

2019-01-13 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/12543 )

Change subject: trx_toolkit/fake_trx.py: fix: update trx_list of FakePM
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I155f118b2d3e3b23eb148fe7e2630790f8fcd18c
Gerrit-Change-Number: 12543
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Sun, 13 Jan 2019 09:44:23 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmocom-bb[master]: trx_toolkit/fake_trx.py: handle multiple transceivers

2019-01-13 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/12325 )

Change subject: trx_toolkit/fake_trx.py: handle multiple transceivers
..


Set Ready For Review


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibff31fb3a958a714c828d0dea7e87d47f778fd80
Gerrit-Change-Number: 12325
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Sun, 13 Jan 2019 09:39:03 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmocom-bb[master]: trx_toolkit/fake_trx.py: handle multiple transceivers

2019-01-13 Thread Vadim Yanitskiy
Vadim Yanitskiy has abandoned this change. ( https://gerrit.osmocom.org/12542 )

Change subject: trx_toolkit/fake_trx.py: handle multiple transceivers
..


Abandoned

Duplicate of Ibff31fb3a958a714c828d0dea7e87d47f778fd80.
My bad, I forgot to update Change-Id after 'git reset'...
--
To view, visit https://gerrit.osmocom.org/12542
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: I504e7fb7d9058f8333aeab7fb9fd77c9d9f70570
Gerrit-Change-Number: 12542
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmocom-bb[master]: trx_toolkit/burst_fwd.py: fix trx_list cross-reference

2019-01-13 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/12540 )

Change subject: trx_toolkit/burst_fwd.py: fix trx_list cross-reference
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id71185de05b0ebc5adb105b10fad2cbde5f800b1
Gerrit-Change-Number: 12540
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Sun, 13 Jan 2019 09:31:50 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmocom-bb[master]: trx_toolkit/burst_fwd.py: fix trx_list cross-reference

2019-01-13 Thread Vadim Yanitskiy
Vadim Yanitskiy has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12540 )

Change subject: trx_toolkit/burst_fwd.py: fix trx_list cross-reference
..

trx_toolkit/burst_fwd.py: fix trx_list cross-reference

It was discovered that using an empty list as default argument
value does result into the cross-reference, i.e. all instances
of BurstForwarder would reference the same trx_list object.

This is not an expected behaviour, let's fix this.

Change-Id: Id71185de05b0ebc5adb105b10fad2cbde5f800b1
---
M src/target/trx_toolkit/burst_fwd.py
1 file changed, 5 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Vadim Yanitskiy: Looks good to me, approved



diff --git a/src/target/trx_toolkit/burst_fwd.py 
b/src/target/trx_toolkit/burst_fwd.py
index 38ce18f..164271f 100644
--- a/src/target/trx_toolkit/burst_fwd.py
+++ b/src/target/trx_toolkit/burst_fwd.py
@@ -43,9 +43,12 @@

"""

-   def __init__(self, trx_list = []):
+   def __init__(self, trx_list = None):
# List of Transceiver instances
-   self.trx_list = trx_list
+   if trx_list is not None:
+   self.trx_list = trx_list
+   else:
+   self.trx_list = []

def add_trx(self, trx):
if trx in self.trx_list:

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id71185de05b0ebc5adb105b10fad2cbde5f800b1
Gerrit-Change-Number: 12540
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmocom-bb[master]: trx_toolkit/fake_trx.py: handle multiple transceivers

2019-01-13 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/12542


Change subject: trx_toolkit/fake_trx.py: handle multiple transceivers
..

trx_toolkit/fake_trx.py: handle multiple transceivers

Since Ice44e2b22566b3652ef6d43896055963b13ab185 is merged, the class
hierarchy has become much more flexible, so it's possible to create
multiple Transceiver / FakeTRX instances and distribute bursts using
a single instance of BurstForwarder.

This change introduces a new command line option, that can be used
to specify additional transceivers. Please note that fake_trx.py
still initializes a pair of BTS and BB transceivers by default.

The new option has the following format:

  --trx REMOTE_ADDR:BASE_PORT[/TRX_NUM]

Some examples for IPv4 and IPv6:

  --trx 127.0.0.1:5703
  --trx [2001:0db8:85a3:::8a2e:0370:7334]:6703

If optional TRX_NUM > 0 is specified, e.g.:

  --trx 127.0.0.1:5700/1

then this transceiver is considered as a child of another one.
See I7e97b7f32dde7ab74779133e9d7504f1d0fce60c for details.

Change-Id: I504e7fb7d9058f8333aeab7fb9fd77c9d9f70570
---
M src/target/trx_toolkit/fake_trx.py
1 file changed, 81 insertions(+), 31 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/42/12542/1

diff --git a/src/target/trx_toolkit/fake_trx.py 
b/src/target/trx_toolkit/fake_trx.py
index 46b413a..0f473d0 100755
--- a/src/target/trx_toolkit/fake_trx.py
+++ b/src/target/trx_toolkit/fake_trx.py
@@ -30,11 +30,13 @@
 import random
 import select
 import sys
+import re

 from app_common import ApplicationBase
 from burst_fwd import BurstForwarder
 from transceiver import Transceiver
 from clck_gen import CLCKGen
+from trx_list import TRXList
 from fake_pm import FakePM

 class FakeTRX(Transceiver):
@@ -270,6 +272,34 @@
# Configure logging
self.app_init_logging(self.argv)

+   # List of all transceivers
+   self.trx_list = TRXList()
+
+   def append_trx(self, remote_addr, base_port):
+   trx = FakeTRX(self.argv.trx_bind_addr, remote_addr, base_port,
+   clck_gen = self.clck_gen, pwr_meas = self.fake_pm)
+   self.trx_list.add_trx(trx)
+
+   def append_child_trx(self, remote_addr, base_port, child_idx):
+   # Index 0 corresponds to the first transceiver
+   if child_idx is 0:
+   self.append_trx(remote_addr, base_port)
+   return
+
+   # Find 'parent' transceiver for a new child
+   trx_parent = self.trx_list.find_trx(remote_addr, base_port)
+   if trx_parent is None:
+   raise IndexError("Couldn't find parent transceiver "
+   "for '%s:%d/%d'" % (remote_addr, base_port, 
child_idx))
+
+   # Allocate a new child
+   trx_child = FakeTRX(self.argv.trx_bind_addr, remote_addr, 
base_port,
+   child_idx = child_idx, pwr_meas = self.fake_pm)
+   self.trx_list.add_trx(trx_child)
+
+   # Link a new 'child' with its 'parent'
+   trx_parent.child_trx_list.add_trx(trx_child)
+
def run(self):
# Init shared clock generator
self.clck_gen = CLCKGen([])
@@ -280,49 +310,44 @@
self.fake_pm = FakePM(-120, -105, -75, -50)

# Init TRX instance for BTS
-   self.bts_trx = FakeTRX(self.argv.trx_bind_addr,
-   self.argv.bts_addr, self.argv.bts_base_port,
-   clck_gen = self.clck_gen)
+   self.append_trx(self.argv.bts_addr, self.argv.bts_base_port)

# Init TRX instance for BB
-   self.bb_trx = FakeTRX(self.argv.trx_bind_addr,
-   self.argv.bb_addr, self.argv.bb_base_port,
-   pwr_meas = self.fake_pm)
+   self.append_trx(self.argv.bb_addr, self.argv.bb_base_port)
+
+   # Additional transceivers (optional)
+   if self.argv.trx_list is not None:
+   for trx_def in self.argv.trx_list:
+   (addr, port, idx) = trx_def
+   self.append_child_trx(addr, port, idx)

# Burst forwarding between transceivers
-   self.burst_fwd = BurstForwarder()
-   self.burst_fwd.add_trx(self.bts_trx)
-   self.burst_fwd.add_trx(self.bb_trx)
+   self.burst_fwd = BurstForwarder(self.trx_list)
+
+   # Compose list of to be monitored sockets
+   self.sock_list = []
+   for trx in self.trx_list:
+   self.sock_list.append(trx.ctrl_if.sock)
+   self.sock_list.append(trx.data_if.sock)

log.info("Init complete")

# Enter main loop
   

Change in osmocom-bb[master]: trx_toolkit/fake_trx.py: fix: update trx_list of FakePM

2019-01-13 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/12543


Change subject: trx_toolkit/fake_trx.py: fix: update trx_list of FakePM
..

trx_toolkit/fake_trx.py: fix: update trx_list of FakePM

It seems in Ice44e2b22566b3652ef6d43896055963b13ab185 I forgot
to do this, so all measurements triggered by MEASURE command
were incorrect (always noise). Let's fix this!

Change-Id: I155f118b2d3e3b23eb148fe7e2630790f8fcd18c
---
M src/target/trx_toolkit/fake_trx.py
1 file changed, 1 insertion(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/43/12543/1

diff --git a/src/target/trx_toolkit/fake_trx.py 
b/src/target/trx_toolkit/fake_trx.py
index 0f473d0..0bf9266 100755
--- a/src/target/trx_toolkit/fake_trx.py
+++ b/src/target/trx_toolkit/fake_trx.py
@@ -308,6 +308,7 @@
# Noise: -120 .. -105
# BTS: -75 .. -50
self.fake_pm = FakePM(-120, -105, -75, -50)
+   self.fake_pm.trx_list = self.trx_list

# Init TRX instance for BTS
self.append_trx(self.argv.bts_addr, self.argv.bts_base_port)

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I155f118b2d3e3b23eb148fe7e2630790f8fcd18c
Gerrit-Change-Number: 12543
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 


Change in osmocom-bb[master]: trx_toolkit/transceiver.py: add support for child transceivers

2019-01-13 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/12541


Change subject: trx_toolkit/transceiver.py: add support for child transceivers
..

trx_toolkit/transceiver.py: add support for child transceivers

A BTS can (optionally) have more than one transceiver. In this case
additional (let's say child) transceivers basically share the same
clock source of the first transceiver, and being powered on / off
as soon as the first transceiver is powered on / off.

Change-Id: I7e97b7f32dde7ab74779133e9d7504f1d0fce60c
---
M src/target/trx_toolkit/transceiver.py
A src/target/trx_toolkit/trx_list.py
2 files changed, 100 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/41/12541/1

diff --git a/src/target/trx_toolkit/transceiver.py 
b/src/target/trx_toolkit/transceiver.py
index edd4d31..57ca531 100644
--- a/src/target/trx_toolkit/transceiver.py
+++ b/src/target/trx_toolkit/transceiver.py
@@ -4,7 +4,7 @@
 # TRX Toolkit
 # Transceiver implementation
 #
-# (C) 2018 by Vadim Yanitskiy 
+# (C) 2018-2019 by Vadim Yanitskiy 
 #
 # All Rights Reserved
 #
@@ -27,6 +27,7 @@
 from ctrl_if_trx import CTRLInterfaceTRX
 from data_if import DATAInterface
 from udp_link import UDPLink
+from trx_list import TRXList

 class Transceiver:
""" Base transceiver implementation.
@@ -54,6 +55,21 @@
NOTE: we don't store the associated channel combinations,
  as they are only useful for burst detection and demodulation.

+   == Child transceivers
+
+   A BTS can (optionally) have more than one transceiver. In this case
+   additional (let's say child) transceivers basically share the same
+   clock source of the first transceiver, so UDP port mapping is a bit
+   different, for example:
+
+ (trx_0) clck=5700, ctrl=5701, data=5702,
+ (trx_1)ctrl=5703, data=5704,
+ (trx_2)ctrl=5705, data=5706.
+ ...
+
+   As soon as the first transceiver is powered on / off,
+   all child transceivers are also powered on / off.
+
== Clock distribution (optional)

The clock indications are not expected by L1 when transceiver
@@ -75,21 +91,26 @@
"""

def __init__(self, bind_addr, remote_addr, base_port,
-   clck_gen = None, pwr_meas = None):
+   child_idx = 0, clck_gen = None, pwr_meas = None):
# Connection info
self.remote_addr = remote_addr
self.bind_addr = bind_addr
self.base_port = base_port
+   self.child_idx = child_idx
+
+   # Child transceiver cannot have its own clock
+   if clck_gen is not None and child_idx > 0:
+   raise TypeError("Child transceiver cannot have its own 
clock")

# Init DATA interface
self.data_if = DATAInterface(
-   remote_addr, base_port + 102,
-   bind_addr, base_port + 2)
+   remote_addr, base_port + child_idx * 2 + 102,
+   bind_addr, base_port + child_idx * 2 + 2)

# Init CTRL interface
self.ctrl_if = CTRLInterfaceTRX(self,
-   remote_addr, base_port + 101,
-   bind_addr, base_port + 1)
+   remote_addr, base_port + child_idx * 2 + 101,
+   bind_addr, base_port + child_idx * 2 + 1)

# Init optional CLCK interface
self.clck_gen = clck_gen
@@ -111,12 +132,22 @@
# List of active (configured) timeslots
self.ts_list = []

+   # List of child transceivers
+   self.child_trx_list = TRXList()
+
# To be overwritten if required,
# no custom command handlers by default
def ctrl_cmd_handler(self, request):
return None

def power_event_handler(self, event):
+   # Update child transceivers
+   for trx in self.child_trx_list.trx_list:
+   if event == "POWERON":
+   trx.running = True
+   else:
+   trx.running = False
+
# Trigger clock generator if required
if self.clck_gen is not None:
clck_links = self.clck_gen.clck_links
diff --git a/src/target/trx_toolkit/trx_list.py 
b/src/target/trx_toolkit/trx_list.py
new file mode 100644
index 000..7bea560
--- /dev/null
+++ b/src/target/trx_toolkit/trx_list.py
@@ -0,0 +1,63 @@
+#!/usr/bin/env python2
+# -*- coding: utf-8 -*-
+
+# TRX Toolkit
+# Transceiver list implementation
+#
+# (C) 2019 by Vadim Yanitskiy 
+#
+# All Rights Reserved
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms 

Change in osmocom-bb[master]: trx_toolkit/burst_fwd.py: fix trx_list cross-reference

2019-01-13 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/12540


Change subject: trx_toolkit/burst_fwd.py: fix trx_list cross-reference
..

trx_toolkit/burst_fwd.py: fix trx_list cross-reference

It was discovered that using an empty list as default argument
value does result into the cross-reference, i.e. all instances
of BurstForwarder would reference the same trx_list object.

This is not an expected behaviour, let's fix this.

Change-Id: Id71185de05b0ebc5adb105b10fad2cbde5f800b1
---
M src/target/trx_toolkit/burst_fwd.py
1 file changed, 5 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/40/12540/1

diff --git a/src/target/trx_toolkit/burst_fwd.py 
b/src/target/trx_toolkit/burst_fwd.py
index 38ce18f..164271f 100644
--- a/src/target/trx_toolkit/burst_fwd.py
+++ b/src/target/trx_toolkit/burst_fwd.py
@@ -43,9 +43,12 @@

"""

-   def __init__(self, trx_list = []):
+   def __init__(self, trx_list = None):
# List of Transceiver instances
-   self.trx_list = trx_list
+   if trx_list is not None:
+   self.trx_list = trx_list
+   else:
+   self.trx_list = []

def add_trx(self, trx):
if trx in self.trx_list:

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id71185de05b0ebc5adb105b10fad2cbde5f800b1
Gerrit-Change-Number: 12540
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 


Change in libusrp[master]: debian: Add 'sdcc' package to BuildDepends

2019-01-13 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/12539


Change subject: debian: Add 'sdcc' package to BuildDepends
..

debian: Add 'sdcc' package to BuildDepends

We recently re-introduced building the USRP1 FX2 firmware
using SDCC.  This needs to be listed as requirement for building
the package, otherwise build are failing.

Change-Id: I23ca8d7ad26437f2c971608cd881a6f40e26a887
---
M debian/control
1 file changed, 1 insertion(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libusrp refs/changes/39/12539/1

diff --git a/debian/control b/debian/control
index 7982c27..54bc7af 100644
--- a/debian/control
+++ b/debian/control
@@ -9,6 +9,7 @@
doxygen,
libtool,
pkg-config,
+   sdcc,
libusb-1.0-0-dev,
libboost-all-dev
 Standards-Version: 3.9.8

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

Gerrit-Project: libusrp
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I23ca8d7ad26437f2c971608cd881a6f40e26a887
Gerrit-Change-Number: 12539
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte