[PATCH] osmo-ci[master]: jobs: rename normal-builds.yml to master-builds.yml

2017-12-02 Thread Neels Hofmeyr

jobs: rename normal-builds.yml to master-builds.yml

Also apply the rename in the job names

Change-Id: If623e573e49d4f1a409139c112afbc34e4cc450e
---
R jobs/master-builds.yml
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/40/5140/2

diff --git a/jobs/normal-builds.yml b/jobs/master-builds.yml
similarity index 99%
rename from jobs/normal-builds.yml
rename to jobs/master-builds.yml
index f61715a..aa4edb3 100644
--- a/jobs/normal-builds.yml
+++ b/jobs/master-builds.yml
@@ -2,7 +2,7 @@
 # One cane simply add a gerrit job by adding project's repository to repos 
list.
 
 - project:
-name: normal_build
+name: master_build
 # following default values can be overridden by each repo
 disabled: false
 concurrent: false
@@ -261,10 +261,10 @@
   - osmocom-bb
 
 jobs:
-  - '{repos}'
+  - 'master-{repos}'
 
 - job-template:
-name: '{repos}'
+name: 'master-{repos}'
 project-type: matrix
 node: '{node}'
 concurrent: '{obj:concurrent}'

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If623e573e49d4f1a409139c112afbc34e4cc450e
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Neels Hofmeyr 


[PATCH] osmo-ci[master]: jobs: master-builds: libosmo-sigtran should trigger bsc and iuh

2017-12-02 Thread Neels Hofmeyr

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

jobs: master-builds: libosmo-sigtran should trigger bsc and iuh

osmo-iuh in turn triggers osmo-msc and osmo-sgsn, no explicit triggers needed
here.

Change-Id: Ifd950660cdc3417e82b0a8f4ce2b1efde880cb7a
---
M jobs/master-builds.yml
1 file changed, 2 insertions(+), 0 deletions(-)


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

diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml
index 55e8458..b127069 100644
--- a/jobs/master-builds.yml
+++ b/jobs/master-builds.yml
@@ -66,6 +66,8 @@
 downstream-ext:
   projects:
 - openbsc
+- osmo-iuh
+- osmo-bsc
 
   - libosmocore:
   a1_name: arch

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd950660cdc3417e82b0a8f4ce2b1efde880cb7a
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] osmo-ci[master]: jobs: master-branches: trigger sgsn from iuh

2017-12-02 Thread Neels Hofmeyr

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

jobs: master-branches: trigger sgsn from iuh

osmo-sgsn uses libosmo-ranap and hence should be triggered from osmo-iuh. This
naturally "includes" a trigger for libosmo-sigtran.

Change-Id: Ia356dc2a8d5120f9d6262bf8eb25c32fe71e76c9
---
M jobs/master-builds.yml
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml
index f862770..55e8458 100644
--- a/jobs/master-builds.yml
+++ b/jobs/master-builds.yml
@@ -185,6 +185,7 @@
 downstream-ext:
   projects:
 - osmo-msc
+- osmo-sgsn
 
   - osmo-mgw:
   a1_name: MGCP

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia356dc2a8d5120f9d6262bf8eb25c32fe71e76c9
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] osmo-ci[master]: jobs: master-builds: osmo-bsc is now also a downstream of os...

2017-12-02 Thread Neels Hofmeyr

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

jobs: master-builds: osmo-bsc is now also a downstream of osmo-mgw

Change-Id: I03c63108bd845ee723d565c34e930bb68bef
---
M jobs/master-builds.yml
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml
index 782b150..797b4bc 100644
--- a/jobs/master-builds.yml
+++ b/jobs/master-builds.yml
@@ -200,6 +200,7 @@
 downstream-ext:
   projects:
 - osmo-msc
+- osmo-bsc
 
   - osmo-msc:
   a1_name: IU

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I03c63108bd845ee723d565c34e930bb68bef
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


osmo-ci[master]: jobs: rename normal-builds.yml to master-builds.yml

2017-12-02 Thread Neels Hofmeyr

Patch Set 1: Verified+1

not verified yet, but it doesn't matter either

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

Gerrit-MessageType: comment
Gerrit-Change-Id: If623e573e49d4f1a409139c112afbc34e4cc450e
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


osmo-ci[master]: jobs: master-builds: apply various initial fixes

2017-12-02 Thread Neels Hofmeyr

Patch Set 1: Verified+1

not verified yet, but it doesn't matter either

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

Gerrit-MessageType: comment
Gerrit-Change-Id: If2ad9c90a0986d1304cd53383d3df5b375f23ac8
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


osmo-ci[master]: Describe our normal (non-gerrit) build jobs in jenkins-job-b...

2017-12-02 Thread Neels Hofmeyr

Patch Set 3: Verified+1

not verified yet, but it doesn't matter either

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib04707393264a845876659d7bee0cdc9f8b897b6
Gerrit-PatchSet: 3
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


[PATCH] osmo-ci[master]: jobs: rename normal-builds.yml to master-builds.yml

2017-12-02 Thread Neels Hofmeyr

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

jobs: rename normal-builds.yml to master-builds.yml

Change-Id: If623e573e49d4f1a409139c112afbc34e4cc450e
---
R jobs/master-builds.yml
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/jobs/normal-builds.yml b/jobs/master-builds.yml
similarity index 99%
rename from jobs/normal-builds.yml
rename to jobs/master-builds.yml
index f61715a..f058b42 100644
--- a/jobs/normal-builds.yml
+++ b/jobs/master-builds.yml
@@ -2,7 +2,7 @@
 # One cane simply add a gerrit job by adding project's repository to repos 
list.
 
 - project:
-name: normal_build
+name: master_build
 # following default values can be overridden by each repo
 disabled: false
 concurrent: false
@@ -261,7 +261,7 @@
   - osmocom-bb
 
 jobs:
-  - '{repos}'
+  - 'master-{repos}'
 
 - job-template:
 name: '{repos}'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If623e573e49d4f1a409139c112afbc34e4cc450e
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] osmo-ci[master]: jobs: master-builds: apply various initial fixes

2017-12-02 Thread Neels Hofmeyr

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

jobs: master-builds: apply various initial fixes

libosmo-sccp, osmo-ggsn: The osmo-gsm-tester builds are downstream builds, yes,
but we configured that with the osmo-gsm-tester builds: instead of telling
libosmo-sccp to build osmo-gsm-tester_build-osmo-stp when done, we configure
the osmo-gsm-tester_osmo-stp to build after libosmo-sccp. So that the master
branch builds don't need to have any knowledge of osmo-gsm-tester.

osmo-msc build triggers should rather be post-build triggers of osmo-iuh and
osmo-mgw, like the others. Then we can also drop the pollscm here, and use the
pollscm that is common to all other builds.

Call these jobs 'master-*'. It more accurately says what they build, and also
we can install the jobs from this file next to the current, old ones, without
overwriting them and thus we'll have an easy rollback path. The new ones can
co-exist with the old ones until the new ones are verified to work, at which
point we can drop the old ones.  Line 313:

IIUC the safest git branch is 'refs/remotes/origin/master'.

This is still untested!

Change-Id: If2ad9c90a0986d1304cd53383d3df5b375f23ac8
---
M jobs/master-builds.yml
1 file changed, 11 insertions(+), 14 deletions(-)


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

diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml
index f058b42..782b150 100644
--- a/jobs/master-builds.yml
+++ b/jobs/master-builds.yml
@@ -1,5 +1,4 @@
-# This file holds all gerrit verifications 
https://jenkins.osmocom.org/jenkins/view/Jenkins-Gerrit/.
-# One cane simply add a gerrit job by adding project's repository to repos 
list.
+# All master branch verification builds, 
https://jenkins.osmocom.org/jenkins/view/master/
 
 - project:
 name: master_build
@@ -67,7 +66,6 @@
 downstream-ext:
   projects:
 - openbsc
-- osmo-gsm-tester_build-osmo-stp
 
   - libosmocore:
   a1_name: arch
@@ -160,7 +158,6 @@
   publishers:
 downstream-ext:
   projects:
-- osmo-gsm-tester_build-osmo-ggsn
 - osmo-sgsn
 
   - osmo-gmr
@@ -183,7 +180,11 @@
   - osmo-hlr:
   slave_axis: !!python/tuple [linux_amd64_debian8, linux_amd64_debian9]
 
-  - osmo-iuh
+  - osmo-iuh:
+  publishers:
+downstream-ext:
+  projects:
+- osmo-msc
 
   - osmo-mgw:
   a1_name: MGCP
@@ -195,18 +196,14 @@
   -e MGCP="$MGCP" -e PATH="$PATH:/build_bin" -e 
OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build \
   -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" \
   osmocom:amd64 /build/contrib/jenkins.sh
+  publishers:
+downstream-ext:
+  projects:
+- osmo-msc
 
   - osmo-msc:
   a1_name: IU
   a1: !!python/tuple [--enable-iu, --disable-iu]
-  triggers:
-- pollscm:
-cron: "H/5 * * * *"
-ignore-post-commit-hooks: false
-- reverse:
-jobs:
-  - osmo-iuh
-  - osmo-mgw
   concurrent: true
   cmd: >
# keep first line with less indent to preserve newlines
@@ -310,7 +307,7 @@
   - git:
  url: git://git.osmocom.org/{repos}
  branches:
-   - '*/master'
+   - 'refs/remotes/origin/master'
  refspec:
  name:
  wipe-workspace: false

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If2ad9c90a0986d1304cd53383d3df5b375f23ac8
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


osmo-msc[master]: Remove utils imported from openbsc, fix building remaining u...

2017-12-02 Thread Pau Espin Pedrol

Patch Set 1:

Related task: https://osmocom.org/issues/2522

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

Gerrit-MessageType: comment
Gerrit-Change-Id: If7e1af11cdac8587bb4d66fb4eacee4b79945359
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Alexander Huemer 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


osmo-ci[master]: Describe our normal (non-gerrit) build jobs in jenkins-job-b...

2017-12-02 Thread Neels Hofmeyr

Patch Set 2: Code-Review+2

(6 comments)

Looks good except for these ideas, but don't bother to edit, I have the tweaks 
ready in an additional patch. Let's then just merge and fix the jobs in 
subsequent commits?

https://gerrit.osmocom.org/#/c/4827/2/jobs/normal-builds.yml
File jobs/normal-builds.yml:

Line 2: # One cane simply add a gerrit job by adding project's repository to 
repos list.
comment still says "gerrit builds"


Line 12: a1_name: a1
I wish there was a better way than these static numbered axes. Because even if 
a job doesn't use them, the workspace is cluttered by 
a1-default/a2-default/a3-default/a4-default subdirs. Need to try out 
alternatives...


Line 70: - osmo-gsm-tester_build-osmo-stp
technical detail: the osmo-gsm-tester builds are downstream builds, yes, but we 
configured that with the osmo-gsm-tester builds: instead of telling 
libosmo-sccp to build osmo-gsm-tester_build-osmo-stp when done, we configure 
the osmo-gsm-tester_osmo-stp to build after libosmo-sccp. So that the master 
branch builds don't need to have any knowledge of osmo-gsm-tester. (same with 
osmo-ggsn below)


Line 209:   - osmo-mgw
should rather be post-build triggers of osmo-iuh and osmo-mgw, like the others. 
Then we can also drop the pollscm here, and use the pollscm that is common to 
all other builds.


Line 264:   - '{repos}'
I'd humbly propose that we call these jobs 'master-*'. It more accurately says 
what they build, and also we can install the jobs from this file next to the 
current, old ones, without overwriting them and thus we'll have an easy 
rollback path. The new ones can co-exist with the old ones until the new ones 
are verified to work, at which point we can drop the old ones.


Line 313:- '*/master'
IIUC the safest setting here is 'refs/remotes/origin/master', I'll give it a try


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib04707393264a845876659d7bee0cdc9f8b897b6
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: Yes


osmo-ci[master]: Use stow for dependency management

2017-12-02 Thread Alexander Huemer

Patch Set 3:

> stow is now installed on all build slaves, wiki also lists stow
 > now.

Is there anything I can do to move forward with change?

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8f5012419495a656912b7b71e4f76ce102c6b63a
Gerrit-PatchSet: 3
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Alexander Huemer 
Gerrit-Reviewer: Alexander Huemer 
Gerrit-Reviewer: André Boddenberg 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: blobb 
Gerrit-Reviewer: neels 
Gerrit-HasComments: No


[PATCH] osmo-msc[master]: Add missing CFLAGS

2017-12-02 Thread Alexander Huemer

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

Add missing CFLAGS

Change-Id: I67b5d797a80b55e01dcdbb8c782748b049cf9199
---
M src/libcommon-cs/Makefile.am
M src/libcommon/Makefile.am
M src/libmsc/Makefile.am
M src/libvlr/Makefile.am
M src/utils/Makefile.am
5 files changed, 18 insertions(+), 2 deletions(-)


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

diff --git a/src/libcommon-cs/Makefile.am b/src/libcommon-cs/Makefile.am
index 21c2745..eada698 100644
--- a/src/libcommon-cs/Makefile.am
+++ b/src/libcommon-cs/Makefile.am
@@ -10,6 +10,8 @@
$(LIBOSMOGSM_CFLAGS) \
$(LIBOSMOVTY_CFLAGS) \
$(LIBOSMOABIS_CFLAGS) \
+   $(LIBOSMOSCCP_CFLAGS) \
+   $(LIBOSMOMGCPCLIENT_CFLAGS) \
$(COVERAGE_CFLAGS) \
$(NULL)
 
diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am
index 0b258c0..18272c5 100644
--- a/src/libcommon/Makefile.am
+++ b/src/libcommon/Makefile.am
@@ -10,6 +10,8 @@
$(LIBOSMOGSM_CFLAGS) \
$(LIBOSMOVTY_CFLAGS) \
$(LIBOSMOABIS_CFLAGS) \
+   $(LIBOSMOSCCP_CFLAGS) \
+   $(LIBOSMOMGCPCLIENT_CFLAGS) \
$(COVERAGE_CFLAGS) \
$(NULL)
 
diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am
index fee9f44..998df26 100644
--- a/src/libmsc/Makefile.am
+++ b/src/libmsc/Makefile.am
@@ -15,6 +15,7 @@
$(LIBASN1C_CFLAGS) \
$(LIBOSMOSIGTRAN_CFLAGS) \
$(LIBOSMOSCCP_CFLAGS) \
+   $(LIBOSMOMGCPCLIENT_CFLAGS) \
$(NULL)
 
 noinst_HEADERS = \
diff --git a/src/libvlr/Makefile.am b/src/libvlr/Makefile.am
index 17ad411..511dfc0 100644
--- a/src/libvlr/Makefile.am
+++ b/src/libvlr/Makefile.am
@@ -1,6 +1,14 @@
 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)
-AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) \
-   $(COVERAGE_CFLAGS) $(LIBCRYPTO_CFLAGS)
+AM_CFLAGS= \
+  -Wall \
+  $(LIBOSMOCORE_CFLAGS) \
+  $(LIBOSMOVTY_CFLAGS) \
+  $(LIBOSMOSCCP_CFLAGS) \
+  $(LIBOSMOMGCPCLIENT_CFLAGS) \
+  $(LIBOSMOABIS_CFLAGS) \
+  $(COVERAGE_CFLAGS) \
+  $(LIBCRYPTO_CFLAGS) \
+  $(NULL)
 
 noinst_HEADERS = \
vlr_access_req_fsm.h \
diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am
index 07b30d9..56b9356 100644
--- a/src/utils/Makefile.am
+++ b/src/utils/Makefile.am
@@ -9,6 +9,7 @@
$(LIBOSMOCORE_CFLAGS) \
$(LIBOSMOGSM_CFLAGS) \
$(LIBOSMOABIS_CFLAGS) \
+   $(LIBOSMOSCCP_CFLAGS) \
$(COVERAGE_CFLAGS) \
$(SQLITE3_CFLAGS) \
$(LIBSMPP34_CFLAGS) \
@@ -123,5 +124,7 @@
$(LIBOSMOCORE_CFLAGS) \
$(LIBOSMOGSM_CFLAGS) \
$(LIBOSMOABIS_CFLAGS) \
+   $(LIBOSMOSCCP_CFLAGS) \
+   $(LIBOSMOMGCPCLIENT_CFLAGS) \
$(NULL)
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I67b5d797a80b55e01dcdbb8c782748b049cf9199
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Alexander Huemer 


[PATCH] osmo-msc[master]: Remove utils imported from openbsc, fix building remaining u...

2017-12-02 Thread Alexander Huemer

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

Remove utils imported from openbsc, fix building remaining util smpp_mirror

Change-Id: If7e1af11cdac8587bb4d66fb4eacee4b79945359
---
M configure.ac
M src/utils/Makefile.am
D src/utils/meas_db.c
D src/utils/meas_db.h
D src/utils/meas_json.c
D src/utils/meas_pcap2db.c
D src/utils/meas_udp2db.c
D src/utils/meas_vis.c
8 files changed, 6 insertions(+), 1,197 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/39/5139/1

diff --git a/configure.ac b/configure.ac
index 5766fd0..6b6e9c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,6 +49,7 @@
 PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp)
 PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5)
 PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.1.0)
+PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.12.0)
 
 AC_ARG_ENABLE(sanitize,
[AS_HELP_STRING(
diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am
index 56b9356..14adcca 100644
--- a/src/utils/Makefile.am
+++ b/src/utils/Makefile.am
@@ -20,27 +20,10 @@
$(NULL)
 
 noinst_HEADERS = \
-   meas_db.h \
$(NULL)
 
 bin_PROGRAMS = \
-   meas_json \
$(NULL)
-if HAVE_SQLITE3
-bin_PROGRAMS += \
-   osmo-meas-udp2db \
-   $(NULL)
-if HAVE_PCAP
-bin_PROGRAMS += \
-   osmo-meas-pcap2db \
-   $(NULL)
-endif
-endif
-if HAVE_LIBCDK
-bin_PROGRAMS += \
-   meas_vis \
-   $(NULL)
-endif
 
 if BUILD_SMPP
 noinst_PROGRAMS = \
@@ -52,79 +35,15 @@
smpp_mirror.c \
$(NULL)
 
+smpp_mirror_CFLAGS = \
+   $(LIBOSMOCORE_CFLAGS) \
+   $(LIBSMPP34_CFLAGS) \
+   $(NULL)
+
 smpp_mirror_LDADD = \
$(top_builddir)/src/libcommon/libcommon.a \
$(LIBOSMOCORE_LIBS) \
$(LIBOSMOGSM_LIBS) \
$(LIBSMPP34_LIBS) \
-   $(NULL)
-
-meas_vis_SOURCES = \
-   meas_vis.c \
-   $(NULL)
-
-meas_vis_LDADD = \
-   $(LIBOSMOCORE_LIBS) \
-   $(LIBOSMOGSM_LIBS) \
-   -lcdk \
-   -lncurses \
-   $(NULL)
-
-meas_vis_CFLAGS = \
-   $(LIBOSMOCORE_CFLAGS) \
-   $(LIBOSMOGSM_CFLAGS) \
-   $(NULL)
-
-osmo_meas_pcap2db_SOURCES = \
-   meas_pcap2db.c \
-   meas_db.c \
-   $(NULL)
-
-osmo_meas_pcap2db_LDADD = \
-   $(LIBOSMOCORE_LIBS) \
-   $(LIBOSMOGSM_LIBS) \
-   $(SQLITE3_LIBS) \
-   -lpcap \
-   $(NULL)
-
-osmo_meas_pcap2db_CFLAGS = \
-   $(LIBOSMOCORE_CFLAGS) \
-   $(LIBOSMOGSM_CFLAGS) \
-   $(LIBOSMOABIS_CFLAGS) \
-   $(NULL)
-
-osmo_meas_udp2db_SOURCES = \
-   meas_udp2db.c \
-   meas_db.c \
-   $(NULL)
-
-osmo_meas_udp2db_LDADD = \
-   $(LIBOSMOCORE_LIBS) \
-   $(LIBOSMOGSM_LIBS) \
-   $(SQLITE3_LIBS) \
-   $(NULL)
-
-osmo_meas_udp2db_CFLAGS = \
-   $(LIBOSMOCORE_CFLAGS) \
-   $(LIBOSMOGSM_CFLAGS) \
-   $(LIBOSMOABIS_CFLAGS) \
-   $(NULL)
-
-meas_json_SOURCES = \
-   meas_json.c \
-   $(NULL)
-
-meas_json_LDADD = \
-   $(top_builddir)/src/libcommon/libcommon.a \
-   $(LIBOSMOCORE_LIBS) \
-   $(LIBOSMOGSM_LIBS) \
-   $(NULL)
-
-meas_json_CFLAGS = \
-   $(LIBOSMOCORE_CFLAGS) \
-   $(LIBOSMOGSM_CFLAGS) \
-   $(LIBOSMOABIS_CFLAGS) \
-   $(LIBOSMOSCCP_CFLAGS) \
-   $(LIBOSMOMGCPCLIENT_CFLAGS) \
$(NULL)
 
diff --git a/src/utils/meas_db.c b/src/utils/meas_db.c
deleted file mode 100644
index 8cf27df..000
--- a/src/utils/meas_db.c
+++ /dev/null
@@ -1,330 +0,0 @@
-/* Routines for storing measurement reports in SQLite3 database */
-
-/* (C) 2012 by Harald Welte 
- *
- * All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see .
- *
- */
-
-#include 
-#include 
-#include 
-
-#include 
-
-#include 
-#include 
-#include 
-#include 
-
-#include "meas_db.h"
-
-#define INS_MR "INSERT INTO meas_rep (time, imsi, name, scenario, nr, 
bs_power, ms_timing_offset, fpc, ms_l1_pwr, ms_l1_ta) VALUES 
(?,?,?,?,?,?,?,?,?,?)"
-#define INS_UD "INSERT INTO meas_rep_unidir (meas_id, rx_lev_full, rx_lev_sub, 
rx_qual_full, rx_qual_sub, dtx, uplink) VALUES (?,?,?,?,?,?,?)"
-#define UPD_MR "UPDATE meas_rep SET ul_unidir=?, dl_unidir=? WHERE id=?"
-
-struct meas_db_state {
-   sqlite3 *db;
-   sqlite3_stmt *stmt_ins_ud;
-   sqlite3_stmt *stmt_ins_mr;
-   sqlite3_stmt *stmt_upd_mr;
-};
-
-/* macros to check for SQLite3 result codes */
-#define 

osmo-pcu[master]: TBF: fix compiler warning in test

2017-12-02 Thread Harald Welte

Patch Set 1: Code-Review+1

I'm surprised the old code actually worked if it needs bit-or instead of 
logical-or.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Idf9e5f15faa7810411ed9d68ed43cf907eea2545
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


osmo-pcu[master]: Fix compiler warning

2017-12-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic34c72c8bff6d7c775f56bb6026fec5425f7dcb4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


osmo-pcu[master]: TBF: log timer override

2017-12-02 Thread Harald Welte

Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I462464a1e6df937b72cad65d19cd48e95dc4db45
Gerrit-PatchSet: 2
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


libosmocore[master]: embedded: fix tests

2017-12-02 Thread Harald Welte

Patch Set 1:

what I'm wondering is: Why are we not catching this on jenkinks?  Aren't we 
building an embedded libosmocore as part of build testing?

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Icedad5ba3ed311ccdb97fa3ccd3002f5fda8be68
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


libosmocore[master]: Fix embedded build

2017-12-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie92d2eea21e19e499b3f3bb4d5a82e31fbbea3f0
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


libosmocore[master]: embedded: fix tests

2017-12-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Icedad5ba3ed311ccdb97fa3ccd3002f5fda8be68
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


osmo-mgw[master]: MGCP endpoints: parse as decimal, not hex

2017-12-02 Thread Harald Welte

Patch Set 2:

endpoints are *strings*. We should not treat them as numbers.  So whatever this 
patch (or related patches do), it is only a very small incremental (and 
insignificant) step towards endpoints as names, which is what the MGCP spec has 
always stated.

Sure, the endpoints within one given "class" can be numbered - but thta's an 
implementation detail of the MGW, and all code dealing with the MGCP protocol 
should not make any assumption about the endpoint names being something that's 
not a string.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic18608ff23303c1564548a86d5f6bfa539fe555e
Gerrit-PatchSet: 2
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


[MERGED] osmo-bts[master]: measurement.c: Fix various typos in comments

2017-12-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: measurement.c: Fix various typos in comments
..


measurement.c: Fix various typos in comments

Change-Id: Ief208045664769406cd60a92a12c4b44988a98b4
---
M src/common/measurement.c
1 file changed, 8 insertions(+), 8 deletions(-)

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



diff --git a/src/common/measurement.c b/src/common/measurement.c
index 3b32bf2..36120c0 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -8,8 +8,8 @@
 #include 
 #include 
 
-/* Measurment reporting period and mapping of SACCH message block for TCHF
- * and TCHH chan As per in 3GPP TS 45.008, secton 8.4.1.
+/* Measurement reporting period and mapping of SACCH message block for TCHF
+ * and TCHH chan As per in 3GPP TS 45.008, section 8.4.1.
  *
  * Timeslot number (TN)TDMA frame number (FN) modulo 104
  * Half rate,Half rate, ReportingSACCH
@@ -54,7 +54,7 @@
[7] =   77,
 };
 
-/* Measurment reporting period for SDCCH8 and SDCCH4 chan
+/* Measurement reporting period for SDCCH8 and SDCCH4 chan
  * As per in 3GPP TS 45.008, section 8.4.2.
  *
  * Logical ChanTDMA frame number
@@ -64,7 +64,7 @@
  * SDCCH/4 37 to 36
  */
 
-/* Added interleve offset to Meas period end Fn which
+/* Added interleave offset to Meas period end Fn which
  * would reduce the Meas Res msg load at Abis */
 
 static const uint8_t sdcch8_meas_rep_fn102[] = {
@@ -86,14 +86,14 @@
 };
 
 /* Note: The reporting of the measurement results is done via the SACCH 
channel.
- * The measurement interval is not alligned with the interval in which the
- * SACCH is tranmitted. When we receive the measurement indication with the
- * SACCH block, the coresponding measurement interval will already have ended
+ * The measurement interval is not aligned with the interval in which the
+ * SACCH is transmitted. When we receive the measurement indication with the
+ * SACCH block, the corresponding measurement interval will already have ended
  * and we will get the results late, but on spot with the beginning of the
  * next measurement interval.
  *
  * For example: We get a measurement indication on FN%104=38 in TS=2. Then we
- * will have to look at 3GPP TS 45.008, secton 8.4.1 (or 3GPP TS 05.02 Clause 7
+ * will have to look at 3GPP TS 45.008, section 8.4.1 (or 3GPP TS 05.02 Clause 
7
  * Table 1 of 9) what value we need to feed into the lookup tables in order to
  * detect the measurement period ending. In this example the "real" ending
  * was on FN%104=12. This is the value we have to look for in

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ief208045664769406cd60a92a12c4b44988a98b4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmo-bts[master]: measurment.c: Introduce INFO category for DMEAS logging

2017-12-02 Thread Harald Welte

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

measurment.c: Introduce INFO category for DMEAS logging

There's no point in either having full verbosity in DEBUG level
and not logging any measurement related information in INFO.  Let's
at least print the results at the end of each measurement period in INFO
level.

Change-Id: I2c870531478c05ce31cc1015597a068a4a76cf99
---
M src/common/measurement.c
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/src/common/measurement.c b/src/common/measurement.c
index 36120c0..e4b8720 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -333,7 +333,7 @@
irssi_sub_sum = irssi_full_sum;
}
 
-   DEBUGP(DMEAS, "%s Computed TA(% 4dqb) BER-FULL(%2u.%02u%%), 
RSSI-FULL(-%3udBm), "
+   LOGP(DMEAS, LOGL_INFO, "%s Computed TA(% 4dqb) BER-FULL(%2u.%02u%%), 
RSSI-FULL(-%3udBm), "
"BER-SUB(%2u.%02u%%), RSSI-SUB(-%3udBm)\n", 
gsm_lchan_name(lchan),
taqb_sum, ber_full_sum/100,
ber_full_sum%100, irssi_full_sum, ber_sub_sum/100, 
ber_sub_sum%100,
@@ -349,7 +349,7 @@
mru->full.rx_qual = ber10k_to_rxqual(ber_full_sum);
mru->sub.rx_qual = ber10k_to_rxqual(ber_sub_sum);
 
-   DEBUGP(DMEAS, "%s UL MEAS RXLEV_FULL(%u), RXLEV_SUB(%u),"
+   LOGP(DMEAS, LOGL_INFO, "%s UL MEAS RXLEV_FULL(%u), RXLEV_SUB(%u),"
   "RXQUAL_FULL(%u), RXQUAL_SUB(%u), num_meas_sub(%u), 
num_ul_meas(%u) \n",
   gsm_lchan_name(lchan),
   mru->full.rx_lev,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2c870531478c05ce31cc1015597a068a4a76cf99
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


osmo-bts[master]: measurment.c: Introduce INFO category for DMEAS logging

2017-12-02 Thread Harald Welte

Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I2c870531478c05ce31cc1015597a068a4a76cf99
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-bts[master]: Comments on individual members of struct gsm_abis_mo

2017-12-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Comments on individual members of struct gsm_abis_mo
..


Comments on individual members of struct gsm_abis_mo

Change-Id: I8e005410080201746906b8a60e9f7957031d2e58
---
M include/osmo-bts/gsm_data_shared.h
1 file changed, 7 insertions(+), 0 deletions(-)

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



diff --git a/include/osmo-bts/gsm_data_shared.h 
b/include/osmo-bts/gsm_data_shared.h
index c19b125..4c0fe5c 100644
--- a/include/osmo-bts/gsm_data_shared.h
+++ b/include/osmo-bts/gsm_data_shared.h
@@ -107,12 +107,19 @@
 };
 
 struct gsm_abis_mo {
+   /* A-bis OML Object Class */
uint8_t obj_class;
+   /* is there still some procedure pending? */
uint8_t procedure_pending;
+   /* A-bis OML Object Instance */
struct abis_om_obj_inst obj_inst;
+   /* human-readable name */
const char *name;
+   /* NM State */
struct gsm_nm_state nm_state;
+   /* Attributes configured in this MO */
struct tlv_parsed *nm_attr;
+   /* BTS to which this MO belongs */
struct gsm_bts *bts;
 };
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8e005410080201746906b8a60e9f7957031d2e58
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[MERGED] osmo-bts[master]: l1sap: Fix log subsystem: Use DRTP for RTP related bits, L1C...

2017-12-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: l1sap: Fix log subsystem: Use DRTP for RTP related bits, L1C 
for MPH
..


l1sap: Fix log subsystem: Use DRTP for RTP related bits, L1C for MPH

Change-Id: Icc0325f41a1d80535d33e123083e220ee47df129
---
M src/common/l1sap.c
1 file changed, 11 insertions(+), 11 deletions(-)

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



diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index c388c82..d294110 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -91,7 +91,7 @@
r -= r % GSM_RTP_DURATION;
 
if (r != GSM_RTP_DURATION)
-   LOGP(DL1P, LOGL_ERROR, "RTP clock out of sync with 
lower layer:"
+   LOGP(DRTP, LOGL_ERROR, "RTP clock out of sync with 
lower layer:"
" %"PRIu32" vs %d (%"PRIu32"->%"PRIu32")\n",
r, GSM_RTP_DURATION, lchan->tch.last_fn, fn);
}
@@ -573,7 +573,7 @@
 {
struct gsm_lchan *lchan;
 
-   LOGP(DL1P, LOGL_INFO, "activate confirm chan_nr=0x%02x trx=%d\n",
+   LOGP(DL1C, LOGL_INFO, "activate confirm chan_nr=0x%02x trx=%d\n",
info_act_cnf->chan_nr, trx->nr);
 
lchan = get_lchan_by_chan_nr(trx, info_act_cnf->chan_nr);
@@ -598,7 +598,7 @@
 {
struct gsm_lchan *lchan;
 
-   LOGP(DL1P, LOGL_INFO, "deactivate confirm chan_nr=0x%02x trx=%d\n",
+   LOGP(DL1C, LOGL_INFO, "deactivate confirm chan_nr=0x%02x trx=%d\n",
info_act_cnf->chan_nr, trx->nr);
 
lchan = get_lchan_by_chan_nr(trx, info_act_cnf->chan_nr);
@@ -629,7 +629,7 @@
rc = l1sap_info_rel_cnf(trx, l1sap, >u.act_cnf);
break;
default:
-   LOGP(DL1P, LOGL_NOTICE, "unknown MPH_INFO cnf type %d\n",
+   LOGP(DL1C, LOGL_NOTICE, "unknown MPH_INFO cnf type %d\n",
info->type);
break;
}
@@ -1101,7 +1101,7 @@
 
gsm_fn2gsmtime(_time, fn);
 
-   DEBUGP(DL1P, "Rx TCH.ind %s chan_nr=0x%02x\n", 
osmo_dump_gsmtime(_time), chan_nr);
+   LOGP(DL1P, LOGL_INFO, "Rx TCH.ind %s chan_nr=0x%02x\n", 
osmo_dump_gsmtime(_time), chan_nr);
 
lchan = get_active_lchan_by_chan_nr(trx, chan_nr);
if (!lchan) {
@@ -1132,7 +1132,7 @@
/* Only clear the marker bit once we have sent a RTP packet 
with it */
lchan->rtp_tx_marker = false;
} else {
-   DEBUGP(DL1P, "Skipping RTP frame with lost payload\n");
+   DEBUGP(DRTP, "Skipping RTP frame with lost payload\n");
if (lchan->abis_ip.rtp_socket)
osmo_rtp_skipped_frame(lchan->abis_ip.rtp_socket, 
fn_ms_adj(fn, lchan));
lchan->rtp_tx_marker = true;
@@ -1326,7 +1326,7 @@
struct gsm48_chan_desc *cd;
int rc;
 
-   LOGP(DL1P, LOGL_INFO, "activating channel chan_nr=0x%02x trx=%d\n",
+   LOGP(DL1C, LOGL_INFO, "activating channel chan_nr=0x%02x trx=%d\n",
chan_nr, trx->nr);
 
/* osmo-pcu calls this without a valid 'tp' parameter, so we
@@ -1340,7 +1340,7 @@
 * one one TRX, so we need to make sure not to activate
 * channels with a different TSC!! */
if (cd->h0.tsc != (lchan->ts->trx->bts->bsic & 7)) {
-   LOGP(DRSL, LOGL_ERROR, "lchan TSC %u != BSIC-TSC %u\n",
+   LOGP(DL1C, LOGL_ERROR, "lchan TSC %u != BSIC-TSC %u\n",
cd->h0.tsc, lchan->ts->trx->bts->bsic & 7);
return -RSL_ERR_SERV_OPT_UNIMPL;
}
@@ -1366,7 +1366,7 @@
 int l1sap_chan_rel(struct gsm_bts_trx *trx, uint8_t chan_nr)
 {
struct gsm_lchan *lchan = get_lchan_by_chan_nr(trx, chan_nr);
-   LOGP(DL1P, LOGL_INFO, "deactivating channel chan_nr=0x%02x trx=%d\n",
+   LOGP(DL1C, LOGL_INFO, "deactivating channel chan_nr=0x%02x trx=%d\n",
chan_nr, trx->nr);
 
if (lchan->tch.dtx.dl_amr_fsm) {
@@ -1382,7 +1382,7 @@
 {
struct gsm_lchan *lchan = get_lchan_by_chan_nr(trx, chan_nr);
 
-   LOGP(DL1P, LOGL_INFO, "deactivating sacch chan_nr=0x%02x trx=%d\n",
+   LOGP(DL1C, LOGL_INFO, "deactivating sacch chan_nr=0x%02x trx=%d\n",
chan_nr, trx->nr);
 
lchan->sacch_deact = 1;
@@ -1393,7 +1393,7 @@
 
 int l1sap_chan_modify(struct gsm_bts_trx *trx, uint8_t chan_nr)
 {
-   LOGP(DL1P, LOGL_INFO, "modifying channel chan_nr=0x%02x trx=%d\n",
+   LOGP(DL1C, LOGL_INFO, "modifying channel chan_nr=0x%02x trx=%d\n",
chan_nr, trx->nr);
 
return l1sap_chan_act_dact_modify(trx, chan_nr, PRIM_INFO_MODIFY, 0);

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

Gerrit-MessageType: merged

[MERGED] osmo-bts[master]: scheduler_trx: L1P is for PH (data), L1M for MPH (control)

2017-12-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: scheduler_trx: L1P is for PH (data), L1M for MPH (control)
..


scheduler_trx: L1P is for PH (data), L1M for MPH (control)

Almost all log statements in scheduler_trx.c were using the wrong
logging subsystem.  Let's fix this.  Also, make it more obvious from
the log subsystem help text

Change-Id: I4312f8ab0414eb38db0d62f05c95ab961f500c14
---
M src/common/logging.c
M src/osmo-bts-trx/scheduler_trx.c
M src/osmo-bts-virtual/scheduler_virtbts.c
3 files changed, 50 insertions(+), 50 deletions(-)

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



diff --git a/src/common/logging.c b/src/common/logging.c
index 2911692..a4d30e6 100644
--- a/src/common/logging.c
+++ b/src/common/logging.c
@@ -68,13 +68,13 @@
},
[DL1C] = {
.name = "DL1C",
-   .description = "Layer 1",
+   .description = "Layer 1 Control (MPH)",
.loglevel = LOGL_INFO,
.enabled = 1,
},
[DL1P] = {
.name = "DL1P",
-   .description = "Layer 1 Primitives",
+   .description = "Layer 1 Primitives (PH)",
.loglevel = LOGL_INFO,
.enabled = 0,
},
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 81984c2..0549156 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -75,7 +75,7 @@
 ubit_t *tx_idle_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, uint16_t *nbits)
 {
-   LOGL1S(DL1C, LOGL_DEBUG, l1t, tn, chan, fn, "Transmitting IDLE\n");
+   LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Transmitting IDLE\n");
 
if (nbits)
*nbits = GSM_BURST_LEN;
@@ -87,7 +87,7 @@
 ubit_t *tx_fcch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, uint16_t *nbits)
 {
-   LOGL1S(DL1C, LOGL_DEBUG, l1t, tn, chan, fn, "Transmitting FCCH\n");
+   LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Transmitting FCCH\n");
 
if (nbits)
*nbits = GSM_BURST_LEN;
@@ -106,7 +106,7 @@
struct  gsm_time t;
uint8_t t3p, bsic;
 
-   LOGL1S(DL1C, LOGL_DEBUG, l1t, tn, chan, fn, "Transmitting SCH\n");
+   LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Transmitting SCH\n");
 
/* BURST BYPASS */
 
@@ -170,7 +170,7 @@
if (msg)
goto got_msg;
 
-   LOGL1S(DL1C, LOGL_INFO, l1t, tn, chan, fn, "No prim for transmit.\n");
+   LOGL1S(DL1P, LOGL_INFO, l1t, tn, chan, fn, "No prim for transmit.\n");
 
 no_msg:
/* free burst memory */
@@ -183,7 +183,7 @@
 got_msg:
/* check validity of message */
if (msgb_l2len(msg) != GSM_MACBLOCK_LEN) {
-   LOGL1S(DL1C, LOGL_FATAL, l1t, tn, chan, fn, "Prim not 23 bytes, 
please FIX! "
+   LOGL1S(DL1P, LOGL_FATAL, l1t, tn, chan, fn, "Prim not 23 bytes, 
please FIX! "
"(len=%d)\n", msgb_l2len(msg));
/* free message */
msgb_free(msg);
@@ -234,7 +234,7 @@
if (nbits)
*nbits = GSM_BURST_LEN;
 
-   LOGL1S(DL1C, LOGL_DEBUG, l1t, tn, chan, fn, "Transmitting burst=%u.\n", 
bid);
+   LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Transmitting burst=%u.\n", 
bid);
 
return bits;
 }
@@ -263,7 +263,7 @@
if (msg)
goto got_msg;
 
-   LOGL1S(DL1C, LOGL_INFO, l1t, tn, chan, fn, "No prim for transmit.\n");
+   LOGL1S(DL1P, LOGL_INFO, l1t, tn, chan, fn, "No prim for transmit.\n");
 
 no_msg:
/* free burst memory */
@@ -291,7 +291,7 @@
 
/* check validity of message */
if (rc < 0) {
-   LOGL1S(DL1C, LOGL_FATAL, l1t, tn, chan, fn, "Prim invalid 
length, please FIX! "
+   LOGL1S(DL1P, LOGL_FATAL, l1t, tn, chan, fn, "Prim invalid 
length, please FIX! "
"(len=%ld)\n", msg->tail - msg->l2h);
/* free message */
msgb_free(msg);
@@ -329,7 +329,7 @@
*nbits = GSM_BURST_LEN;
}
 
-   LOGL1S(DL1C, LOGL_DEBUG, l1t, tn, chan, fn, "Transmitting burst=%u.\n", 
bid);
+   LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Transmitting burst=%u.\n", 
bid);
 
return bits;
 }
@@ -358,7 +358,7 @@
uint8_t tch_data[GSM_FR_BYTES];
int len;
 
-   LOGL1S(DL1C, LOGL_NOTICE, l1t, tn, chan, fn,
+   LOGL1S(DL1P, LOGL_NOTICE, l1t, tn, chan, fn,
"Missing TCH bursts detected, sending BFI\n");
 
/* indicate bad frame */
@@ -390,7 +390,7 @@
break;
default:
 inval_mode1:
-   LOGL1S(DL1C, LOGL_ERROR, l1t, tn, chan, fn, "TCH mode 

[MERGED] osmo-bts[master]: scheduler: Harmonize log line format; Always print TS name +...

2017-12-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: scheduler: Harmonize log line format; Always print TS name + 
decoded FN
..


scheduler: Harmonize log line format; Always print TS name + decoded FN

Change-Id: I5703b46c8a59fe00a3cdc063bcf72872980ec5e5
---
M include/osmo-bts/scheduler_backend.h
M src/common/scheduler.c
M src/osmo-bts-trx/scheduler_trx.c
3 files changed, 93 insertions(+), 144 deletions(-)

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



diff --git a/include/osmo-bts/scheduler_backend.h 
b/include/osmo-bts/scheduler_backend.h
index af1cfbf..5e077ef 100644
--- a/include/osmo-bts/scheduler_backend.h
+++ b/include/osmo-bts/scheduler_backend.h
@@ -1,5 +1,11 @@
 #pragma once
 
+#define LOGL1S(subsys, level, l1t, tn, chan, fn, fmt, args ...)\
+   LOGP(subsys, level, "%s %s %s: " fmt,   \
+   gsm_fn_as_gsmtime_str(fn),  \
+   gsm_ts_name(&(l1t)->trx->ts[tn]),   \
+   chan >=0 ? trx_chan_desc[chan].name : "", ## args)
+
 typedef int trx_sched_rts_func(struct l1sched_trx *l1t, uint8_t tn,
   uint32_t fn, enum trx_chan_type chan);
 
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index f6cb07e..efd7666 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -282,8 +282,7 @@
l1sap = msgb_l1sap_prim(msg);
if (l1sap->oph.operation != PRIM_OP_REQUEST) {
 wrong_type:
-   LOGP(DL1P, LOGL_ERROR, "Prim for ts=%u at fn=%u has "
-   "wrong type.\n", tn, fn);
+   LOGL1S(DL1P, LOGL_ERROR, l1t, tn, chan, fn, "Prim has 
wrong type.\n");
 free_msg:
/* unlink and free message */
llist_del(>list);
@@ -305,14 +304,12 @@
goto wrong_type;
}
if (prim_fn > 100) {
-   LOGP(DL1P, LOGL_NOTICE, "Prim %u for trx=%u ts=%u at "
-"fn=%u is out of range (100), or channel %s with "
+   LOGL1S(DL1P, LOGL_NOTICE, l1t, tn, chan, fn,
+"Prim %u is out of range (100), or channel %s with 
"
 "type %s is already disabled. If this happens in "
-"conjunction with PCU, increase 'rts-advance' by 
5."
-" (current fn=%u)\n", prim_fn, l1t->trx->nr, tn,
-l1sap->u.data.fn,
-get_lchan_by_chan_nr(l1t->trx, chan_nr)->name,
-get_value_string(trx_chan_type_names, chan), fn);
+"conjunction with PCU, increase 'rts-advance' by 
5.",
+prim_fn, get_lchan_by_chan_nr(l1t->trx, 
chan_nr)->name,
+get_value_string(trx_chan_type_names, chan));
/* unlink and free message */
llist_del(>list);
msgb_free(msg);
@@ -329,11 +326,9 @@
 found_msg:
if ((chan_nr ^ (trx_chan_desc[chan].chan_nr | tn))
 || ((link_id & 0xc0) ^ trx_chan_desc[chan].link_id)) {
-   LOGP(DL1P, LOGL_ERROR, "Prim for ts=%u at fn=%u has wrong "
-   "chan_nr=%02x link_id=%02x, expecting chan_nr=%02x "
-   "link_id=%02x.\n", tn, fn, chan_nr, link_id,
-   trx_chan_desc[chan].chan_nr | tn,
-   trx_chan_desc[chan].link_id);
+   LOGL1S(DL1P, LOGL_ERROR, l1t, tn, chan, fn, "Prim has wrong 
chan_nr=%02x link_id=%02x, "
+   "expecting chan_nr=%02x link_id=%02x.\n", chan_nr, 
link_id,
+   trx_chan_desc[chan].chan_nr | tn, 
trx_chan_desc[chan].link_id);
goto free_msg;
}
 
@@ -418,9 +413,9 @@
uint8_t tn = l1sap->u.data.chan_nr & 7;
struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn);
 
-   LOGP(DL1P, LOGL_INFO, "PH-DATA.req: chan_nr=0x%02x link_id=0x%02x "
-   "fn=%u ts=%u trx=%u\n", l1sap->u.data.chan_nr,
-   l1sap->u.data.link_id, l1sap->u.data.fn, tn, l1t->trx->nr);
+   LOGL1S(DL1P, LOGL_INFO, l1t, tn, -1, l1sap->u.data.fn,
+   "PH-DATA.req: chan_nr=0x%02x link_id=0x%02x\n",
+   l1sap->u.data.chan_nr, l1sap->u.data.link_id);
 
if (!l1sap->oph.msg)
abort();
@@ -441,9 +436,8 @@
uint8_t tn = l1sap->u.tch.chan_nr & 7;
struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn);
 
-   LOGP(DL1P, LOGL_INFO, "TCH.req: chan_nr=0x%02x "
-   "fn=%u ts=%u trx=%u\n", l1sap->u.tch.chan_nr,
-   l1sap->u.tch.fn, tn, l1t->trx->nr);
+   LOGL1S(DL1P, LOGL_INFO, l1t, tn, -1, l1sap->u.tch.fn, "TCH.req: 

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

2017-12-02 Thread Harald Welte

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

osmo-bts-trx: Fix reported frame number during PRIM_INFO_MEAS

The upper layers (L1SAP, the common part of L1) *always* require frame
numbers in the uplink direction to be reported as the frame number of
the *first* burst, not the last burst of a given block.

This is particularly important in the case of passing up measurement
information, as we use this frame number to detect if the measurement
interval for that specific timeslot has just ended (and hence we must
process the measurements and send an uplink measurement report to the
BSC.

Before this patch, the measurement results were reported with the *last*
frame number, which caused the common/measurement.c code never detect
the end of a measurement window.

On TS2, tons of the following log messages were observed:
<0004> measurement.c:199 (bts=0,trx=0,ts=2,ss=0) no space for uplink 
measurement, num_ul_meas=104

With this patch, it behves as expected:  the measurements of 25 blocks
(= 100 bursts) are aggregated, after which point the report is computed
and sent.  Subsequently, num_ul_meas is reset to 0 and the cycle
restarts.

Change-Id: I1065ae9c400bb5240a63ab8213aee59aeb9ceeff
---
M src/osmo-bts-trx/scheduler_trx.c
1 file changed, 10 insertions(+), 4 deletions(-)


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

diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 0549156..d3928f1 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -843,7 +843,7 @@
l2_len = GSM_MACBLOCK_LEN;
 
/* Send uplink measurement information to L2 */
-   l1if_process_meas_res(l1t->trx, tn, fn, trx_chan_desc[chan].chan_nr | 
tn,
+   l1if_process_meas_res(l1t->trx, tn, *first_fn, 
trx_chan_desc[chan].chan_nr | tn,
n_errors, n_bits_total, *rssi_sum / *rssi_num, *toa_sum / 
*toa_num);
ber10k = compute_ber10k(n_bits_total, n_errors);
return _sched_compose_ph_data_ind(l1t, tn, *first_fn, chan, l2, l2_len,
@@ -860,6 +860,7 @@
struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn);
struct l1sched_chan_state *chan_state = >chan_state[chan];
sbit_t *burst, **bursts_p = _state->ul_bursts;
+   uint32_t *first_fn = _state->ul_first_fn;
uint8_t *mask = _state->ul_mask;
float *rssi_sum = _state->rssi_sum;
uint8_t *rssi_num = _state->rssi_num;
@@ -884,6 +885,7 @@
if (bid == 0) {
memset(*bursts_p, 0, GSM0503_EGPRS_BURSTS_NBITS);
*mask = 0x0;
+   *first_fn = fn;
*rssi_sum = 0;
*rssi_num = 0;
*toa_sum = 0;
@@ -937,7 +939,7 @@
 
 
/* Send uplink measurement information to L2 */
-   l1if_process_meas_res(l1t->trx, tn, fn, trx_chan_desc[chan].chan_nr | 
tn,
+   l1if_process_meas_res(l1t->trx, tn, *first_fn, 
trx_chan_desc[chan].chan_nr | tn,
n_errors, n_bits_total, *rssi_sum / *rssi_num, *toa_sum / 
*toa_num);
 
if (rc <= 0) {
@@ -959,6 +961,7 @@
struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn);
struct l1sched_chan_state *chan_state = >chan_state[chan];
sbit_t *burst, **bursts_p = _state->ul_bursts;
+   uint32_t *first_fn = _state->ul_first_fn;
uint8_t *mask = _state->ul_mask;
uint8_t rsl_cmode = chan_state->rsl_cmode;
uint8_t tch_mode = chan_state->tch_mode;
@@ -985,6 +988,7 @@
if (bid == 0) {
memset(*bursts_p + 464, 0, 464);
*mask = 0x0;
+   *first_fn = fn;
}
 
/* update mask */
@@ -1047,7 +1051,7 @@
memcpy(*bursts_p, *bursts_p + 464, 464);
 
/* Send uplink measurement information to L2 */
-   l1if_process_meas_res(l1t->trx, tn, fn, trx_chan_desc[chan].chan_nr|tn,
+   l1if_process_meas_res(l1t->trx, tn, *first_fn, 
trx_chan_desc[chan].chan_nr|tn,
n_errors, n_bits_total, rssi, toa);
 
/* Check if the frame is bad */
@@ -1117,6 +1121,7 @@
struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn);
struct l1sched_chan_state *chan_state = >chan_state[chan];
sbit_t *burst, **bursts_p = _state->ul_bursts;
+   uint32_t *first_fn = _state->ul_first_fn;
uint8_t *mask = _state->ul_mask;
uint8_t rsl_cmode = chan_state->rsl_cmode;
uint8_t tch_mode = chan_state->tch_mode;
@@ -1148,6 +1153,7 @@
if (bid == 0) {
memset(*bursts_p + 464, 0, 232);
*mask = 0x0;
+   *first_fn = fn;
}
 
/* update mask */
@@ -1221,7 +1227,7 @@
memcpy(*bursts_p + 232, *bursts_p + 464, 232);
 
/* Send uplink measurement information to L2 */
-   l1if_process_meas_res(l1t->trx, tn, fn, trx_chan_desc[chan].chan_nr|tn,
+   l1if_process_meas_res(l1t->trx, tn, *first_fn, 
trx_chan_desc[chan].chan_nr|tn,
n_errors, n_bits_total, 

osmo-bts[master]: Comments on individual members of struct gsm_abis_mo

2017-12-02 Thread Harald Welte

Patch Set 3: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8e005410080201746906b8a60e9f7957031d2e58
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


osmo-bts[master]: measurement.c: Fix various typos in comments

2017-12-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ief208045664769406cd60a92a12c4b44988a98b4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


[PATCH] osmo-bts[master]: measurement.c: Fix various typos in comments

2017-12-02 Thread Harald Welte

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

measurement.c: Fix various typos in comments

Change-Id: Ief208045664769406cd60a92a12c4b44988a98b4
---
M src/common/measurement.c
1 file changed, 8 insertions(+), 8 deletions(-)


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

diff --git a/src/common/measurement.c b/src/common/measurement.c
index 3b32bf2..36120c0 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -8,8 +8,8 @@
 #include 
 #include 
 
-/* Measurment reporting period and mapping of SACCH message block for TCHF
- * and TCHH chan As per in 3GPP TS 45.008, secton 8.4.1.
+/* Measurement reporting period and mapping of SACCH message block for TCHF
+ * and TCHH chan As per in 3GPP TS 45.008, section 8.4.1.
  *
  * Timeslot number (TN)TDMA frame number (FN) modulo 104
  * Half rate,Half rate, ReportingSACCH
@@ -54,7 +54,7 @@
[7] =   77,
 };
 
-/* Measurment reporting period for SDCCH8 and SDCCH4 chan
+/* Measurement reporting period for SDCCH8 and SDCCH4 chan
  * As per in 3GPP TS 45.008, section 8.4.2.
  *
  * Logical ChanTDMA frame number
@@ -64,7 +64,7 @@
  * SDCCH/4 37 to 36
  */
 
-/* Added interleve offset to Meas period end Fn which
+/* Added interleave offset to Meas period end Fn which
  * would reduce the Meas Res msg load at Abis */
 
 static const uint8_t sdcch8_meas_rep_fn102[] = {
@@ -86,14 +86,14 @@
 };
 
 /* Note: The reporting of the measurement results is done via the SACCH 
channel.
- * The measurement interval is not alligned with the interval in which the
- * SACCH is tranmitted. When we receive the measurement indication with the
- * SACCH block, the coresponding measurement interval will already have ended
+ * The measurement interval is not aligned with the interval in which the
+ * SACCH is transmitted. When we receive the measurement indication with the
+ * SACCH block, the corresponding measurement interval will already have ended
  * and we will get the results late, but on spot with the beginning of the
  * next measurement interval.
  *
  * For example: We get a measurement indication on FN%104=38 in TS=2. Then we
- * will have to look at 3GPP TS 45.008, secton 8.4.1 (or 3GPP TS 05.02 Clause 7
+ * will have to look at 3GPP TS 45.008, section 8.4.1 (or 3GPP TS 05.02 Clause 
7
  * Table 1 of 9) what value we need to feed into the lookup tables in order to
  * detect the measurement period ending. In this example the "real" ending
  * was on FN%104=12. This is the value we have to look for in

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ief208045664769406cd60a92a12c4b44988a98b4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


osmo-bts[master]: scheduler: Harmonize log line format; Always print TS name +...

2017-12-02 Thread Harald Welte

Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I5703b46c8a59fe00a3cdc063bcf72872980ec5e5
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


[PATCH] osmo-bts[master]: l1sap: Fix log subsystem: Use DRTP for RTP related bits, L1C...

2017-12-02 Thread Harald Welte

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

l1sap: Fix log subsystem: Use DRTP for RTP related bits, L1C for MPH

Change-Id: Icc0325f41a1d80535d33e123083e220ee47df129
---
M src/common/l1sap.c
1 file changed, 11 insertions(+), 11 deletions(-)


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

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index c388c82..d294110 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -91,7 +91,7 @@
r -= r % GSM_RTP_DURATION;
 
if (r != GSM_RTP_DURATION)
-   LOGP(DL1P, LOGL_ERROR, "RTP clock out of sync with 
lower layer:"
+   LOGP(DRTP, LOGL_ERROR, "RTP clock out of sync with 
lower layer:"
" %"PRIu32" vs %d (%"PRIu32"->%"PRIu32")\n",
r, GSM_RTP_DURATION, lchan->tch.last_fn, fn);
}
@@ -573,7 +573,7 @@
 {
struct gsm_lchan *lchan;
 
-   LOGP(DL1P, LOGL_INFO, "activate confirm chan_nr=0x%02x trx=%d\n",
+   LOGP(DL1C, LOGL_INFO, "activate confirm chan_nr=0x%02x trx=%d\n",
info_act_cnf->chan_nr, trx->nr);
 
lchan = get_lchan_by_chan_nr(trx, info_act_cnf->chan_nr);
@@ -598,7 +598,7 @@
 {
struct gsm_lchan *lchan;
 
-   LOGP(DL1P, LOGL_INFO, "deactivate confirm chan_nr=0x%02x trx=%d\n",
+   LOGP(DL1C, LOGL_INFO, "deactivate confirm chan_nr=0x%02x trx=%d\n",
info_act_cnf->chan_nr, trx->nr);
 
lchan = get_lchan_by_chan_nr(trx, info_act_cnf->chan_nr);
@@ -629,7 +629,7 @@
rc = l1sap_info_rel_cnf(trx, l1sap, >u.act_cnf);
break;
default:
-   LOGP(DL1P, LOGL_NOTICE, "unknown MPH_INFO cnf type %d\n",
+   LOGP(DL1C, LOGL_NOTICE, "unknown MPH_INFO cnf type %d\n",
info->type);
break;
}
@@ -1101,7 +1101,7 @@
 
gsm_fn2gsmtime(_time, fn);
 
-   DEBUGP(DL1P, "Rx TCH.ind %s chan_nr=0x%02x\n", 
osmo_dump_gsmtime(_time), chan_nr);
+   LOGP(DL1P, LOGL_INFO, "Rx TCH.ind %s chan_nr=0x%02x\n", 
osmo_dump_gsmtime(_time), chan_nr);
 
lchan = get_active_lchan_by_chan_nr(trx, chan_nr);
if (!lchan) {
@@ -1132,7 +1132,7 @@
/* Only clear the marker bit once we have sent a RTP packet 
with it */
lchan->rtp_tx_marker = false;
} else {
-   DEBUGP(DL1P, "Skipping RTP frame with lost payload\n");
+   DEBUGP(DRTP, "Skipping RTP frame with lost payload\n");
if (lchan->abis_ip.rtp_socket)
osmo_rtp_skipped_frame(lchan->abis_ip.rtp_socket, 
fn_ms_adj(fn, lchan));
lchan->rtp_tx_marker = true;
@@ -1326,7 +1326,7 @@
struct gsm48_chan_desc *cd;
int rc;
 
-   LOGP(DL1P, LOGL_INFO, "activating channel chan_nr=0x%02x trx=%d\n",
+   LOGP(DL1C, LOGL_INFO, "activating channel chan_nr=0x%02x trx=%d\n",
chan_nr, trx->nr);
 
/* osmo-pcu calls this without a valid 'tp' parameter, so we
@@ -1340,7 +1340,7 @@
 * one one TRX, so we need to make sure not to activate
 * channels with a different TSC!! */
if (cd->h0.tsc != (lchan->ts->trx->bts->bsic & 7)) {
-   LOGP(DRSL, LOGL_ERROR, "lchan TSC %u != BSIC-TSC %u\n",
+   LOGP(DL1C, LOGL_ERROR, "lchan TSC %u != BSIC-TSC %u\n",
cd->h0.tsc, lchan->ts->trx->bts->bsic & 7);
return -RSL_ERR_SERV_OPT_UNIMPL;
}
@@ -1366,7 +1366,7 @@
 int l1sap_chan_rel(struct gsm_bts_trx *trx, uint8_t chan_nr)
 {
struct gsm_lchan *lchan = get_lchan_by_chan_nr(trx, chan_nr);
-   LOGP(DL1P, LOGL_INFO, "deactivating channel chan_nr=0x%02x trx=%d\n",
+   LOGP(DL1C, LOGL_INFO, "deactivating channel chan_nr=0x%02x trx=%d\n",
chan_nr, trx->nr);
 
if (lchan->tch.dtx.dl_amr_fsm) {
@@ -1382,7 +1382,7 @@
 {
struct gsm_lchan *lchan = get_lchan_by_chan_nr(trx, chan_nr);
 
-   LOGP(DL1P, LOGL_INFO, "deactivating sacch chan_nr=0x%02x trx=%d\n",
+   LOGP(DL1C, LOGL_INFO, "deactivating sacch chan_nr=0x%02x trx=%d\n",
chan_nr, trx->nr);
 
lchan->sacch_deact = 1;
@@ -1393,7 +1393,7 @@
 
 int l1sap_chan_modify(struct gsm_bts_trx *trx, uint8_t chan_nr)
 {
-   LOGP(DL1P, LOGL_INFO, "modifying channel chan_nr=0x%02x trx=%d\n",
+   LOGP(DL1C, LOGL_INFO, "modifying channel chan_nr=0x%02x trx=%d\n",
chan_nr, trx->nr);
 
return l1sap_chan_act_dact_modify(trx, chan_nr, PRIM_INFO_MODIFY, 0);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc0325f41a1d80535d33e123083e220ee47df129
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


osmo-bts[master]: scheduler_trx: L1P is for PH (data), L1M for MPH (control)

2017-12-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I4312f8ab0414eb38db0d62f05c95ab961f500c14
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


[PATCH] osmo-bts[master]: scheduler: Harmonize log line format; Always print TS name +...

2017-12-02 Thread Harald Welte
Hello Neels Hofmeyr, Jenkins Builder,

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

https://gerrit.osmocom.org/5125

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

scheduler: Harmonize log line format; Always print TS name + decoded FN

Change-Id: I5703b46c8a59fe00a3cdc063bcf72872980ec5e5
---
M include/osmo-bts/scheduler_backend.h
M src/common/scheduler.c
M src/osmo-bts-trx/scheduler_trx.c
3 files changed, 93 insertions(+), 144 deletions(-)


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

diff --git a/include/osmo-bts/scheduler_backend.h 
b/include/osmo-bts/scheduler_backend.h
index af1cfbf..5e077ef 100644
--- a/include/osmo-bts/scheduler_backend.h
+++ b/include/osmo-bts/scheduler_backend.h
@@ -1,5 +1,11 @@
 #pragma once
 
+#define LOGL1S(subsys, level, l1t, tn, chan, fn, fmt, args ...)\
+   LOGP(subsys, level, "%s %s %s: " fmt,   \
+   gsm_fn_as_gsmtime_str(fn),  \
+   gsm_ts_name(&(l1t)->trx->ts[tn]),   \
+   chan >=0 ? trx_chan_desc[chan].name : "", ## args)
+
 typedef int trx_sched_rts_func(struct l1sched_trx *l1t, uint8_t tn,
   uint32_t fn, enum trx_chan_type chan);
 
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index f6cb07e..efd7666 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -282,8 +282,7 @@
l1sap = msgb_l1sap_prim(msg);
if (l1sap->oph.operation != PRIM_OP_REQUEST) {
 wrong_type:
-   LOGP(DL1P, LOGL_ERROR, "Prim for ts=%u at fn=%u has "
-   "wrong type.\n", tn, fn);
+   LOGL1S(DL1P, LOGL_ERROR, l1t, tn, chan, fn, "Prim has 
wrong type.\n");
 free_msg:
/* unlink and free message */
llist_del(>list);
@@ -305,14 +304,12 @@
goto wrong_type;
}
if (prim_fn > 100) {
-   LOGP(DL1P, LOGL_NOTICE, "Prim %u for trx=%u ts=%u at "
-"fn=%u is out of range (100), or channel %s with "
+   LOGL1S(DL1P, LOGL_NOTICE, l1t, tn, chan, fn,
+"Prim %u is out of range (100), or channel %s with 
"
 "type %s is already disabled. If this happens in "
-"conjunction with PCU, increase 'rts-advance' by 
5."
-" (current fn=%u)\n", prim_fn, l1t->trx->nr, tn,
-l1sap->u.data.fn,
-get_lchan_by_chan_nr(l1t->trx, chan_nr)->name,
-get_value_string(trx_chan_type_names, chan), fn);
+"conjunction with PCU, increase 'rts-advance' by 
5.",
+prim_fn, get_lchan_by_chan_nr(l1t->trx, 
chan_nr)->name,
+get_value_string(trx_chan_type_names, chan));
/* unlink and free message */
llist_del(>list);
msgb_free(msg);
@@ -329,11 +326,9 @@
 found_msg:
if ((chan_nr ^ (trx_chan_desc[chan].chan_nr | tn))
 || ((link_id & 0xc0) ^ trx_chan_desc[chan].link_id)) {
-   LOGP(DL1P, LOGL_ERROR, "Prim for ts=%u at fn=%u has wrong "
-   "chan_nr=%02x link_id=%02x, expecting chan_nr=%02x "
-   "link_id=%02x.\n", tn, fn, chan_nr, link_id,
-   trx_chan_desc[chan].chan_nr | tn,
-   trx_chan_desc[chan].link_id);
+   LOGL1S(DL1P, LOGL_ERROR, l1t, tn, chan, fn, "Prim has wrong 
chan_nr=%02x link_id=%02x, "
+   "expecting chan_nr=%02x link_id=%02x.\n", chan_nr, 
link_id,
+   trx_chan_desc[chan].chan_nr | tn, 
trx_chan_desc[chan].link_id);
goto free_msg;
}
 
@@ -418,9 +413,9 @@
uint8_t tn = l1sap->u.data.chan_nr & 7;
struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn);
 
-   LOGP(DL1P, LOGL_INFO, "PH-DATA.req: chan_nr=0x%02x link_id=0x%02x "
-   "fn=%u ts=%u trx=%u\n", l1sap->u.data.chan_nr,
-   l1sap->u.data.link_id, l1sap->u.data.fn, tn, l1t->trx->nr);
+   LOGL1S(DL1P, LOGL_INFO, l1t, tn, -1, l1sap->u.data.fn,
+   "PH-DATA.req: chan_nr=0x%02x link_id=0x%02x\n",
+   l1sap->u.data.chan_nr, l1sap->u.data.link_id);
 
if (!l1sap->oph.msg)
abort();
@@ -441,9 +436,8 @@
uint8_t tn = l1sap->u.tch.chan_nr & 7;
struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn);
 
-   LOGP(DL1P, LOGL_INFO, "TCH.req: chan_nr=0x%02x "
-   "fn=%u ts=%u trx=%u\n", l1sap->u.tch.chan_nr,
-   l1sap->u.tch.fn, tn, l1t->trx->nr);
+   LOGL1S(DL1P, LOGL_INFO, l1t, tn, -1, l1sap->u.tch.fn, "TCH.req: 
chan_nr=0x%02x\n",
+   l1sap->u.tch.chan_nr);
 
if 

osmo-bts[master]: l1sap: Fix log subsystem: Use DRTP for RTP related bits, L1C...

2017-12-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Icc0325f41a1d80535d33e123083e220ee47df129
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


[PATCH] osmo-bts[master]: scheduler_trx: L1P is for PH (data), L1M for MPH (control)

2017-12-02 Thread Harald Welte

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

scheduler_trx: L1P is for PH (data), L1M for MPH (control)

Almost all log statements in scheduler_trx.c were using the wrong
logging subsystem.  Let's fix this.  Also, make it more obvious from
the log subsystem help text

Change-Id: I4312f8ab0414eb38db0d62f05c95ab961f500c14
---
M src/common/logging.c
M src/osmo-bts-trx/scheduler_trx.c
M src/osmo-bts-virtual/scheduler_virtbts.c
3 files changed, 50 insertions(+), 50 deletions(-)


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

diff --git a/src/common/logging.c b/src/common/logging.c
index 2911692..a4d30e6 100644
--- a/src/common/logging.c
+++ b/src/common/logging.c
@@ -68,13 +68,13 @@
},
[DL1C] = {
.name = "DL1C",
-   .description = "Layer 1",
+   .description = "Layer 1 Control (MPH)",
.loglevel = LOGL_INFO,
.enabled = 1,
},
[DL1P] = {
.name = "DL1P",
-   .description = "Layer 1 Primitives",
+   .description = "Layer 1 Primitives (PH)",
.loglevel = LOGL_INFO,
.enabled = 0,
},
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 81984c2..0549156 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -75,7 +75,7 @@
 ubit_t *tx_idle_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, uint16_t *nbits)
 {
-   LOGL1S(DL1C, LOGL_DEBUG, l1t, tn, chan, fn, "Transmitting IDLE\n");
+   LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Transmitting IDLE\n");
 
if (nbits)
*nbits = GSM_BURST_LEN;
@@ -87,7 +87,7 @@
 ubit_t *tx_fcch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, uint16_t *nbits)
 {
-   LOGL1S(DL1C, LOGL_DEBUG, l1t, tn, chan, fn, "Transmitting FCCH\n");
+   LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Transmitting FCCH\n");
 
if (nbits)
*nbits = GSM_BURST_LEN;
@@ -106,7 +106,7 @@
struct  gsm_time t;
uint8_t t3p, bsic;
 
-   LOGL1S(DL1C, LOGL_DEBUG, l1t, tn, chan, fn, "Transmitting SCH\n");
+   LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Transmitting SCH\n");
 
/* BURST BYPASS */
 
@@ -170,7 +170,7 @@
if (msg)
goto got_msg;
 
-   LOGL1S(DL1C, LOGL_INFO, l1t, tn, chan, fn, "No prim for transmit.\n");
+   LOGL1S(DL1P, LOGL_INFO, l1t, tn, chan, fn, "No prim for transmit.\n");
 
 no_msg:
/* free burst memory */
@@ -183,7 +183,7 @@
 got_msg:
/* check validity of message */
if (msgb_l2len(msg) != GSM_MACBLOCK_LEN) {
-   LOGL1S(DL1C, LOGL_FATAL, l1t, tn, chan, fn, "Prim not 23 bytes, 
please FIX! "
+   LOGL1S(DL1P, LOGL_FATAL, l1t, tn, chan, fn, "Prim not 23 bytes, 
please FIX! "
"(len=%d)\n", msgb_l2len(msg));
/* free message */
msgb_free(msg);
@@ -234,7 +234,7 @@
if (nbits)
*nbits = GSM_BURST_LEN;
 
-   LOGL1S(DL1C, LOGL_DEBUG, l1t, tn, chan, fn, "Transmitting burst=%u.\n", 
bid);
+   LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Transmitting burst=%u.\n", 
bid);
 
return bits;
 }
@@ -263,7 +263,7 @@
if (msg)
goto got_msg;
 
-   LOGL1S(DL1C, LOGL_INFO, l1t, tn, chan, fn, "No prim for transmit.\n");
+   LOGL1S(DL1P, LOGL_INFO, l1t, tn, chan, fn, "No prim for transmit.\n");
 
 no_msg:
/* free burst memory */
@@ -291,7 +291,7 @@
 
/* check validity of message */
if (rc < 0) {
-   LOGL1S(DL1C, LOGL_FATAL, l1t, tn, chan, fn, "Prim invalid 
length, please FIX! "
+   LOGL1S(DL1P, LOGL_FATAL, l1t, tn, chan, fn, "Prim invalid 
length, please FIX! "
"(len=%ld)\n", msg->tail - msg->l2h);
/* free message */
msgb_free(msg);
@@ -329,7 +329,7 @@
*nbits = GSM_BURST_LEN;
}
 
-   LOGL1S(DL1C, LOGL_DEBUG, l1t, tn, chan, fn, "Transmitting burst=%u.\n", 
bid);
+   LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Transmitting burst=%u.\n", 
bid);
 
return bits;
 }
@@ -358,7 +358,7 @@
uint8_t tch_data[GSM_FR_BYTES];
int len;
 
-   LOGL1S(DL1C, LOGL_NOTICE, l1t, tn, chan, fn,
+   LOGL1S(DL1P, LOGL_NOTICE, l1t, tn, chan, fn,
"Missing TCH bursts detected, sending BFI\n");
 
/* indicate bad frame */
@@ -390,7 +390,7 @@
break;
default:
 inval_mode1:
-   LOGL1S(DL1C, LOGL_ERROR, l1t, tn, chan, fn, "TCH mode 
invalid, please fix!\n");
+   LOGL1S(DL1P, LOGL_ERROR, l1t, tn, chan, fn, "TCH mode 
invalid, please fix!\n");
len = 0;
  

osmo-bts[master]: scheduler: Harmonize log line format; Always print TS name +...

2017-12-02 Thread Neels Hofmeyr

Patch Set 1: Code-Review-1

(8 comments)

just -1ing to indicate that there are comments... nothing critical.

https://gerrit.osmocom.org/#/c/5125/1/src/common/scheduler.c
File src/common/scheduler.c:

Line 308:"Prim %u for is out of range (100), or 
channel %s with "
I guess drop 'for'


Line 329:   LOGL1S(DL1P, LOGL_ERROR, l1t, tn, chan, fn, "Prim has 
wrong chan_nr=%02x link_id=%02x, "
maybe log prim_fn like above? I might be mistaken, am confused by prim_fn vs. 
fn...


https://gerrit.osmocom.org/#/c/5125/1/src/osmo-bts-trx/scheduler_trx.c
File src/osmo-bts-trx/scheduler_trx.c:

Line 173:   LOGL1S(DL1C, LOGL_INFO, l1t, tn, chan, fn, "No prim for 
transmit.\n");
"to transmit"?


Line 266:   LOGL1S(DL1C, LOGL_INFO, l1t, tn, chan, fn, "No prim for 
transmit.\n");
"to transmit"


Line 294:   LOGL1S(DL1C, LOGL_FATAL, l1t, tn, chan, fn, "Prim 
invalid length, please FIX! "
("has invalid length"?)


Line 393:   LOGL1S(DL1C, LOGL_ERROR, l1t, tn, chan, fn,"TCH 
mode invalid, please fix!\n");
(space after comma)


Line 571:   LOGL1S(DL1C, LOGL_INFO, l1t, tn, chan, fn, "No TCH or 
FACCH prim for transmit.\n");
to


Line 664:   LOGL1S(DL1C, LOGL_INFO, l1t, tn, chan, fn, "No TCH or 
FACCH prim for transmit.\n");
hmm there seems to be a scheme here. It is "for transmission" or "to transmit" 
... admittedly not that awfully important either.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I5703b46c8a59fe00a3cdc063bcf72872980ec5e5
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: Yes


osmo-bts[master]: Comments on individual members of struct gsm_abis_mo

2017-12-02 Thread Neels Hofmeyr

Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8e005410080201746906b8a60e9f7957031d2e58
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


osmo-bts[master]: Comments on individual members of struct gsm_abis_mo

2017-12-02 Thread Neels Hofmeyr

Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/5124/1/include/osmo-bts/gsm_data_shared.h
File include/osmo-bts/gsm_data_shared.h:

Line 114:   /* A-bist OML Object Instance */
'bis'


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8e005410080201746906b8a60e9f7957031d2e58
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: Yes


[PATCH] osmo-bts[master]: Comments on individual members of struct gsm_abis_mo

2017-12-02 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5124

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

Comments on individual members of struct gsm_abis_mo

Change-Id: I8e005410080201746906b8a60e9f7957031d2e58
---
M include/osmo-bts/gsm_data_shared.h
1 file changed, 7 insertions(+), 0 deletions(-)


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

diff --git a/include/osmo-bts/gsm_data_shared.h 
b/include/osmo-bts/gsm_data_shared.h
index c19b125..4c0fe5c 100644
--- a/include/osmo-bts/gsm_data_shared.h
+++ b/include/osmo-bts/gsm_data_shared.h
@@ -107,12 +107,19 @@
 };
 
 struct gsm_abis_mo {
+   /* A-bis OML Object Class */
uint8_t obj_class;
+   /* is there still some procedure pending? */
uint8_t procedure_pending;
+   /* A-bis OML Object Instance */
struct abis_om_obj_inst obj_inst;
+   /* human-readable name */
const char *name;
+   /* NM State */
struct gsm_nm_state nm_state;
+   /* Attributes configured in this MO */
struct tlv_parsed *nm_attr;
+   /* BTS to which this MO belongs */
struct gsm_bts *bts;
 };
 

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I8e005410080201746906b8a60e9f7957031d2e58
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


osmo-mgw[master]: MGCP endpoints: parse as decimal, not hex

2017-12-02 Thread Neels Hofmeyr

Patch Set 2:

elsewhere it seems we are confirming the hex nature of endpoint IDs (or was 
that a connection identifier?) ... Possibly this needs to be fixed the other 
way, by libosmo-mgcp-client translating the number-of-endpoints to a hex 
representation?

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic18608ff23303c1564548a86d5f6bfa539fe555e
Gerrit-PatchSet: 2
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


[MERGED] osmo-mgw[master]: Revert "mgcp_client: don't configure "bts base"" until osmo-...

2017-12-02 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: Revert "mgcp_client: don't configure "bts base"" until osmo-msc 
is ready
..


Revert "mgcp_client: don't configure "bts base"" until osmo-msc is ready

OsmoMSC is in the odd situation that it is already using the new 
libosmo-mgcp-client, which is targeted at osmo-mgw, to configure talking to the
old osmo-bsc_mgcp. By removing the bts_base, we break current OsmoMSC.

Removing bts_base makes sense, but let's revert this until OsmoMSC is ready
after merging Ieea9630358b3963261fa1993cf1f3b563ff23538 (which moves the 
osmo-msc over to osmo-mgw).

This reverts commit 0be3ce66c058f39e07f7a1c93a9bf632fb936edf.

Change-Id: Ibce214c2bfc35623097abbb647619426ef3dcc94
---
M include/osmocom/mgcp_client/mgcp_client.h
M src/libosmo-mgcp-client/mgcp_client.c
M src/libosmo-mgcp-client/mgcp_client_vty.c
3 files changed, 31 insertions(+), 0 deletions(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/mgcp_client/mgcp_client.h 
b/include/osmocom/mgcp_client/mgcp_client.h
index 19abaf3..cf5e8c4 100644
--- a/include/osmocom/mgcp_client/mgcp_client.h
+++ b/include/osmocom/mgcp_client/mgcp_client.h
@@ -21,6 +21,7 @@
int remote_port;
uint16_t first_endpoint;
uint16_t last_endpoint;
+   uint16_t bts_base;
 };
 
 typedef unsigned int mgcp_trans_id_t;
diff --git a/src/libosmo-mgcp-client/mgcp_client.c 
b/src/libosmo-mgcp-client/mgcp_client.c
index 5cd14f7..ee8d267 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -45,6 +45,7 @@
.remote_port = -1,
.first_endpoint = 0,
.last_endpoint = 0,
+   .bts_base = 0,
};
 }
 
@@ -439,6 +440,7 @@
 
mgcp->actual.first_endpoint = conf->first_endpoint > 0 ? 
(uint16_t)conf->first_endpoint : 0;
mgcp->actual.last_endpoint = conf->last_endpoint > 0 ? 
(uint16_t)conf->last_endpoint : 0;
+   mgcp->actual.bts_base = conf->bts_base > 0 ? (uint16_t)conf->bts_base : 
4000;
 
return mgcp;
 }
diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c 
b/src/libosmo-mgcp-client/mgcp_client_vty.c
index 1d58bb5..f8129c0 100644
--- a/src/libosmo-mgcp-client/mgcp_client_vty.c
+++ b/src/libosmo-mgcp-client/mgcp_client_vty.c
@@ -123,12 +123,32 @@
   "set first useable endpoint identifier\n"
   "set the last useable endpoint identifier\n")
 
+#define BTS_START_STR "First UDP port allocated for the BTS side\n"
+#define UDP_PORT_STR "UDP Port number\n"
+DEFUN(cfg_mgw_rtp_bts_base_port,
+  cfg_mgw_rtp_bts_base_port_cmd,
+  "mgw bts-base <0-65534>",
+  MGW_STR
+  BTS_START_STR
+  UDP_PORT_STR)
+{
+   global_mgcp_client_conf->bts_base = atoi(argv[0]);
+   return CMD_SUCCESS;
+}
+ALIAS_DEPRECATED(cfg_mgw_rtp_bts_base_port,
+  cfg_mgcpgw_rtp_bts_base_port_cmd,
+  "mgcpgw bts-base <0-65534>",
+  MGW_STR
+  BTS_START_STR
+  UDP_PORT_STR)
+
 int mgcp_client_config_write(struct vty *vty, const char *indent)
 {
const char *addr;
int port;
uint16_t first_endpoint;
uint16_t last_endpoint;
+   uint16_t bts_base;
 
addr = global_mgcp_client_conf->local_addr;
if (addr)
@@ -155,6 +175,12 @@
first_endpoint, last_endpoint, VTY_NEWLINE);
}
 
+   bts_base = global_mgcp_client_conf->bts_base;
+   if (bts_base) {
+   vty_out(vty, "%smgw bts-base %u%s", indent,
+   bts_base, VTY_NEWLINE);
+   }
+
return CMD_SUCCESS;
 }
 
@@ -168,6 +194,7 @@
install_element(node, _mgw_remote_ip_cmd);
install_element(node, _mgw_remote_port_cmd);
install_element(node, _mgw_endpoint_range_cmd);
+   install_element(node, _mgw_rtp_bts_base_port_cmd);
 
/* deprecated 'mgcpgw' commands */
install_element(node, _mgcpgw_local_ip_cmd);
@@ -175,4 +202,5 @@
install_element(node, _mgcpgw_remote_ip_cmd);
install_element(node, _mgcpgw_remote_port_cmd);
install_element(node, _mgcpgw_endpoint_range_cmd);
+   install_element(node, _mgcpgw_rtp_bts_base_port_cmd);
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibce214c2bfc35623097abbb647619426ef3dcc94
Gerrit-PatchSet: 2
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


osmo-mgw[master]: Revert "mgcp_client: don't configure "bts base"" until osmo-...

2017-12-02 Thread Neels Hofmeyr
Neels Hofmeyr has reverted this change.

Change subject: Revert "mgcp_client: don't configure "bts base"" until osmo-msc 
is ready
..


Uploaded patch set 1.

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

Gerrit-MessageType: revert
Gerrit-Change-Id: Ibce214c2bfc35623097abbb647619426ef3dcc94
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


osmo-mgw[master]: Revert "mgcp_client: don't configure "bts base"" until osmo-...

2017-12-02 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibce214c2bfc35623097abbb647619426ef3dcc94
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


[PATCH] osmo-mgw[master]: Revert "mgcp_client: don't configure "bts base"" until osmo-...

2017-12-02 Thread Neels Hofmeyr

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

Revert "mgcp_client: don't configure "bts base"" until osmo-msc is ready

OsmoMSC is in the odd situation that it is already using the new 
libosmo-mgcp-client, which is targeted at osmo-mgw, to configure talking to the
old osmo-bsc_mgcp. By removing the bts_base, we break current OsmoMSC.

Removing bts_base makes sense, but let's revert this until OsmoMSC is ready
after merging Ieea9630358b3963261fa1993cf1f3b563ff23538 (which moves the 
osmo-msc over to osmo-mgw).

This reverts commit 0be3ce66c058f39e07f7a1c93a9bf632fb936edf.

Change-Id: Ibce214c2bfc35623097abbb647619426ef3dcc94
---
M include/osmocom/mgcp_client/mgcp_client.h
M src/libosmo-mgcp-client/mgcp_client.c
M src/libosmo-mgcp-client/mgcp_client_vty.c
3 files changed, 31 insertions(+), 0 deletions(-)


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

diff --git a/include/osmocom/mgcp_client/mgcp_client.h 
b/include/osmocom/mgcp_client/mgcp_client.h
index 8a2c404..1a6cbce 100644
--- a/include/osmocom/mgcp_client/mgcp_client.h
+++ b/include/osmocom/mgcp_client/mgcp_client.h
@@ -21,6 +21,7 @@
int remote_port;
uint16_t first_endpoint;
uint16_t last_endpoint;
+   uint16_t bts_base;
 };
 
 typedef unsigned int mgcp_trans_id_t;
diff --git a/src/libosmo-mgcp-client/mgcp_client.c 
b/src/libosmo-mgcp-client/mgcp_client.c
index a35ad6f..2047637 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -45,6 +45,7 @@
.remote_port = -1,
.first_endpoint = 0,
.last_endpoint = 0,
+   .bts_base = 0,
};
 }
 
@@ -382,6 +383,7 @@
 
mgcp->actual.first_endpoint = conf->first_endpoint > 0 ? 
(uint16_t)conf->first_endpoint : 0;
mgcp->actual.last_endpoint = conf->last_endpoint > 0 ? 
(uint16_t)conf->last_endpoint : 0;
+   mgcp->actual.bts_base = conf->bts_base > 0 ? (uint16_t)conf->bts_base : 
4000;
 
return mgcp;
 }
diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c 
b/src/libosmo-mgcp-client/mgcp_client_vty.c
index 1d58bb5..f8129c0 100644
--- a/src/libosmo-mgcp-client/mgcp_client_vty.c
+++ b/src/libosmo-mgcp-client/mgcp_client_vty.c
@@ -123,12 +123,32 @@
   "set first useable endpoint identifier\n"
   "set the last useable endpoint identifier\n")
 
+#define BTS_START_STR "First UDP port allocated for the BTS side\n"
+#define UDP_PORT_STR "UDP Port number\n"
+DEFUN(cfg_mgw_rtp_bts_base_port,
+  cfg_mgw_rtp_bts_base_port_cmd,
+  "mgw bts-base <0-65534>",
+  MGW_STR
+  BTS_START_STR
+  UDP_PORT_STR)
+{
+   global_mgcp_client_conf->bts_base = atoi(argv[0]);
+   return CMD_SUCCESS;
+}
+ALIAS_DEPRECATED(cfg_mgw_rtp_bts_base_port,
+  cfg_mgcpgw_rtp_bts_base_port_cmd,
+  "mgcpgw bts-base <0-65534>",
+  MGW_STR
+  BTS_START_STR
+  UDP_PORT_STR)
+
 int mgcp_client_config_write(struct vty *vty, const char *indent)
 {
const char *addr;
int port;
uint16_t first_endpoint;
uint16_t last_endpoint;
+   uint16_t bts_base;
 
addr = global_mgcp_client_conf->local_addr;
if (addr)
@@ -155,6 +175,12 @@
first_endpoint, last_endpoint, VTY_NEWLINE);
}
 
+   bts_base = global_mgcp_client_conf->bts_base;
+   if (bts_base) {
+   vty_out(vty, "%smgw bts-base %u%s", indent,
+   bts_base, VTY_NEWLINE);
+   }
+
return CMD_SUCCESS;
 }
 
@@ -168,6 +194,7 @@
install_element(node, _mgw_remote_ip_cmd);
install_element(node, _mgw_remote_port_cmd);
install_element(node, _mgw_endpoint_range_cmd);
+   install_element(node, _mgw_rtp_bts_base_port_cmd);
 
/* deprecated 'mgcpgw' commands */
install_element(node, _mgcpgw_local_ip_cmd);
@@ -175,4 +202,5 @@
install_element(node, _mgcpgw_remote_ip_cmd);
install_element(node, _mgcpgw_remote_port_cmd);
install_element(node, _mgcpgw_endpoint_range_cmd);
+   install_element(node, _mgcpgw_rtp_bts_base_port_cmd);
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibce214c2bfc35623097abbb647619426ef3dcc94
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] osmo-bts[master]: scheduler: Harmonize log line format; Always print TS name +...

2017-12-02 Thread Harald Welte

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

scheduler: Harmonize log line format; Always print TS name + decoded FN

Change-Id: I5703b46c8a59fe00a3cdc063bcf72872980ec5e5
---
M include/osmo-bts/scheduler_backend.h
M src/common/scheduler.c
M src/osmo-bts-trx/scheduler_trx.c
3 files changed, 93 insertions(+), 144 deletions(-)


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

diff --git a/include/osmo-bts/scheduler_backend.h 
b/include/osmo-bts/scheduler_backend.h
index af1cfbf..5e077ef 100644
--- a/include/osmo-bts/scheduler_backend.h
+++ b/include/osmo-bts/scheduler_backend.h
@@ -1,5 +1,11 @@
 #pragma once
 
+#define LOGL1S(subsys, level, l1t, tn, chan, fn, fmt, args ...)\
+   LOGP(subsys, level, "%s %s %s: " fmt,   \
+   gsm_fn_as_gsmtime_str(fn),  \
+   gsm_ts_name(&(l1t)->trx->ts[tn]),   \
+   chan >=0 ? trx_chan_desc[chan].name : "", ## args)
+
 typedef int trx_sched_rts_func(struct l1sched_trx *l1t, uint8_t tn,
   uint32_t fn, enum trx_chan_type chan);
 
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index f6cb07e..21232d5 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -282,8 +282,7 @@
l1sap = msgb_l1sap_prim(msg);
if (l1sap->oph.operation != PRIM_OP_REQUEST) {
 wrong_type:
-   LOGP(DL1P, LOGL_ERROR, "Prim for ts=%u at fn=%u has "
-   "wrong type.\n", tn, fn);
+   LOGL1S(DL1P, LOGL_ERROR, l1t, tn, chan, fn, "Prim has 
wrong type.\n");
 free_msg:
/* unlink and free message */
llist_del(>list);
@@ -305,14 +304,12 @@
goto wrong_type;
}
if (prim_fn > 100) {
-   LOGP(DL1P, LOGL_NOTICE, "Prim %u for trx=%u ts=%u at "
-"fn=%u is out of range (100), or channel %s with "
+   LOGL1S(DL1P, LOGL_NOTICE, l1t, tn, chan, fn,
+"Prim %u for is out of range (100), or channel %s 
with "
 "type %s is already disabled. If this happens in "
-"conjunction with PCU, increase 'rts-advance' by 
5."
-" (current fn=%u)\n", prim_fn, l1t->trx->nr, tn,
-l1sap->u.data.fn,
-get_lchan_by_chan_nr(l1t->trx, chan_nr)->name,
-get_value_string(trx_chan_type_names, chan), fn);
+"conjunction with PCU, increase 'rts-advance' by 
5.",
+prim_fn, get_lchan_by_chan_nr(l1t->trx, 
chan_nr)->name,
+get_value_string(trx_chan_type_names, chan));
/* unlink and free message */
llist_del(>list);
msgb_free(msg);
@@ -329,11 +326,9 @@
 found_msg:
if ((chan_nr ^ (trx_chan_desc[chan].chan_nr | tn))
 || ((link_id & 0xc0) ^ trx_chan_desc[chan].link_id)) {
-   LOGP(DL1P, LOGL_ERROR, "Prim for ts=%u at fn=%u has wrong "
-   "chan_nr=%02x link_id=%02x, expecting chan_nr=%02x "
-   "link_id=%02x.\n", tn, fn, chan_nr, link_id,
-   trx_chan_desc[chan].chan_nr | tn,
-   trx_chan_desc[chan].link_id);
+   LOGL1S(DL1P, LOGL_ERROR, l1t, tn, chan, fn, "Prim has wrong 
chan_nr=%02x link_id=%02x, "
+   "expecting chan_nr=%02x link_id=%02x.\n", chan_nr, 
link_id,
+   trx_chan_desc[chan].chan_nr | tn, 
trx_chan_desc[chan].link_id);
goto free_msg;
}
 
@@ -418,9 +413,9 @@
uint8_t tn = l1sap->u.data.chan_nr & 7;
struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn);
 
-   LOGP(DL1P, LOGL_INFO, "PH-DATA.req: chan_nr=0x%02x link_id=0x%02x "
-   "fn=%u ts=%u trx=%u\n", l1sap->u.data.chan_nr,
-   l1sap->u.data.link_id, l1sap->u.data.fn, tn, l1t->trx->nr);
+   LOGL1S(DL1P, LOGL_INFO, l1t, tn, -1, l1sap->u.data.fn,
+   "PH-DATA.req: chan_nr=0x%02x link_id=0x%02x\n",
+   l1sap->u.data.chan_nr, l1sap->u.data.link_id);
 
if (!l1sap->oph.msg)
abort();
@@ -441,9 +436,8 @@
uint8_t tn = l1sap->u.tch.chan_nr & 7;
struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn);
 
-   LOGP(DL1P, LOGL_INFO, "TCH.req: chan_nr=0x%02x "
-   "fn=%u ts=%u trx=%u\n", l1sap->u.tch.chan_nr,
-   l1sap->u.tch.fn, tn, l1t->trx->nr);
+   LOGL1S(DL1P, LOGL_INFO, l1t, tn, -1, l1sap->u.tch.fn, "TCH.req: 
chan_nr=0x%02x\n",
+   l1sap->u.tch.chan_nr);
 
if (!l1sap->oph.msg)
abort();
@@ -477,14 +471,13 @@
link_id = trx_chan_desc[chan].link_id;
 
if 

[PATCH] osmo-bts[master]: Comments on individual members of struct gsm_abis_mo

2017-12-02 Thread Harald Welte

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

Comments on individual members of struct gsm_abis_mo

Change-Id: I8e005410080201746906b8a60e9f7957031d2e58
---
M include/osmo-bts/gsm_data_shared.h
1 file changed, 7 insertions(+), 0 deletions(-)


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

diff --git a/include/osmo-bts/gsm_data_shared.h 
b/include/osmo-bts/gsm_data_shared.h
index c19b125..82c8243 100644
--- a/include/osmo-bts/gsm_data_shared.h
+++ b/include/osmo-bts/gsm_data_shared.h
@@ -107,12 +107,19 @@
 };
 
 struct gsm_abis_mo {
+   /* A-bis OML Object Class */
uint8_t obj_class;
+   /* is there still some procedure pending? */
uint8_t procedure_pending;
+   /* A-bist OML Object Instance */
struct abis_om_obj_inst obj_inst;
+   /* human-readable name */
const char *name;
+   /* NM State */
struct gsm_nm_state nm_state;
+   /* Attributes configured in this MO */
struct tlv_parsed *nm_attr;
+   /* BTS to which this MO belongs */
struct gsm_bts *bts;
 };
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e005410080201746906b8a60e9f7957031d2e58
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte