[PATCH] libosmocore[master]: gsm0480: parse optional IEs for RELEASE COMPLETE message

2018-01-16 Thread Vadim Yanitskiy

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

gsm0480: parse optional IEs for RELEASE COMPLETE message

According to GSM 04.80 section 2.5 "Release complete", a message
of the mentioned type may contain optional IEs, such as Cause
and Facility. Let's parse them.

Change-Id: Ib8fc1f6bae472b0b264b6158f372b6cce255b222
---
M src/gsm/gsm0480.c
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/40/5840/1

diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c
index 0f30250..0072812 100644
--- a/src/gsm/gsm0480.c
+++ b/src/gsm/gsm0480.c
@@ -295,7 +295,11 @@
switch (msg_type) {
case GSM0480_MTYPE_RELEASE_COMPLETE:
LOGP(0, LOGL_DEBUG, "SS Release Complete\n");
-   /* could also parse out the optional Cause/Facility data */
+
+   /* Parse optional Cause and/or Facility data */
+   if (len >= 2)
+   rc &= parse_ss_info_elements(>data[0], len, req);
+
req->ussd_text[0] = 0xFF;
break;
case GSM0480_MTYPE_REGISTER:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib8fc1f6bae472b0b264b6158f372b6cce255b222
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 


[PATCH] libosmocore[master]: gsm0480: move SS request length check to parse_ss()

2018-01-16 Thread Vadim Yanitskiy

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

gsm0480: move SS request length check to parse_ss()

Change-Id: I8e7ce5bd97f3a8731924264c92afb9a7183937dc
---
M src/gsm/gsm0480.c
1 file changed, 11 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/36/5836/1

diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c
index 75388b9..25f97a2 100644
--- a/src/gsm/gsm0480.c
+++ b/src/gsm/gsm0480.c
@@ -255,19 +255,7 @@
 int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len,
struct ss_request *req)
 {
-   uint8_t msg_type = hdr->msg_type & 0x3F;
int rc = 0;
-
-   /**
-* GSM 04.80 Section 2.5 'Release complete' Table 2.5
-* payload is optional for 'RELEASE COMPLETE' message
-*/
-   if (msg_type != GSM0480_MTYPE_RELEASE_COMPLETE) {
-   if (len < sizeof(*hdr) + 2) {
-   LOGP(0, LOGL_DEBUG, "SS Request is too short.\n");
-   return 0;
-   }
-   }
 
if (gsm48_hdr_pdisc(hdr) == GSM48_PDISC_NC_SS) {
req->transaction_id = hdr->proto_discr & 0x70;
@@ -285,6 +273,17 @@
int rc = 1;
uint8_t msg_type = hdr->msg_type & 0x3F;  /* message-type - section 3.4 
*/
 
+   /**
+* GSM 04.80 Section 2.5 'Release complete' Table 2.5
+* payload is optional for 'RELEASE COMPLETE' message
+*/
+   if (msg_type != GSM0480_MTYPE_RELEASE_COMPLETE) {
+   if (len < 2) {
+   LOGP(0, LOGL_DEBUG, "SS Request is too short.\n");
+   return 0;
+   }
+   }
+
/* Table 2.1: Messages for call independent SS control */
switch (msg_type) {
case GSM0480_MTYPE_RELEASE_COMPLETE:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e7ce5bd97f3a8731924264c92afb9a7183937dc
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 


[PATCH] libosmocore[master]: gsm0480: parse all SS info elements in a message

2018-01-16 Thread Vadim Yanitskiy

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

gsm0480: parse all SS info elements in a message

Change-Id: I20cc59c25fdbda176bcf76437174cda829518d60
---
M src/gsm/gsm0480.c
1 file changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/39/5839/1

diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c
index e3856a5..0f30250 100644
--- a/src/gsm/gsm0480.c
+++ b/src/gsm/gsm0480.c
@@ -334,11 +334,15 @@
uint8_t iei;
uint8_t iei_length;
 
+   /* We need at least two bytes */
+   if (len < 2)
+   return 0;
+
iei = ss_ie[0];
iei_length = ss_ie[1];
 
/* If the data does not fit, report an error */
-   if (len - 2 < iei_length)
+   if (iei_length + 2 > len)
return 0;
 
switch (iei) {
@@ -356,6 +360,11 @@
break;
}
 
+   /* A message may contain multiple IEs */
+   if (iei_length + 2 + 2 < len)
+   rc &= parse_ss_info_elements(ss_ie + iei_length + 2,
+   len - iei_length - 2, req);
+
return rc;
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I20cc59c25fdbda176bcf76437174cda829518d60
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 


[PATCH] libosmocore[master]: gsm0480: add specification reference to SS message type

2018-01-16 Thread Vadim Yanitskiy

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

gsm0480: add specification reference to SS message type

Change-Id: Iff0210e995053e270939a774db33f55b22545204
---
M src/gsm/gsm0480.c
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/34/5834/1

diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c
index 328a8c0..8319b19 100644
--- a/src/gsm/gsm0480.c
+++ b/src/gsm/gsm0480.c
@@ -285,6 +285,7 @@
int rc = 1;
uint8_t msg_type = hdr->msg_type & 0x3F;  /* message-type - section 3.4 
*/
 
+   /* Table 2.1: Messages for call independent SS control */
switch (msg_type) {
case GSM0480_MTYPE_RELEASE_COMPLETE:
LOGP(0, LOGL_DEBUG, "SS Release Complete\n");

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff0210e995053e270939a774db33f55b22545204
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 


[PATCH] libosmocore[master]: gsm0480: refactor gsm0480_decode_ss_request

2018-01-16 Thread Vadim Yanitskiy

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

gsm0480: refactor gsm0480_decode_ss_request

Change-Id: Iba734db97ab516f8fce816c4e4225b97b93619f1
---
M src/gsm/gsm0480.c
1 file changed, 14 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/37/5837/1

diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c
index 25f97a2..ca00999 100644
--- a/src/gsm/gsm0480.c
+++ b/src/gsm/gsm0480.c
@@ -255,17 +255,24 @@
 int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len,
struct ss_request *req)
 {
-   int rc = 0;
+   uint8_t pdisc;
 
-   if (gsm48_hdr_pdisc(hdr) == GSM48_PDISC_NC_SS) {
-   req->transaction_id = hdr->proto_discr & 0x70;
-   rc = parse_ss(hdr, len - sizeof(*hdr), req);
+   /**
+* Check Protocol Discriminator
+* see TS GSM 04.07 and GSM 04.80
+*/
+   pdisc = gsm48_hdr_pdisc(hdr);
+   if (pdisc != GSM48_PDISC_NC_SS) {
+   LOGP(0, LOGL_ERROR, "Dropping message with "
+   "unsupported pdisc=%02x\n", pdisc);
+   return 0;
}
 
-   if (!rc)
-   LOGP(0, LOGL_DEBUG, "Error occurred while parsing received 
SS!\n");
+   /* GSM 04.80 3.3 Transaction Identifier */
+   req->transaction_id = hdr->proto_discr & 0x70;
 
-   return rc;
+   /* Parse SS request */
+   return parse_ss(hdr, len - sizeof(*hdr), req);
 }
 
 static int parse_ss(const struct gsm48_hdr *hdr, uint16_t len, struct 
ss_request *req)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba734db97ab516f8fce816c4e4225b97b93619f1
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 


[PATCH] libosmocore[master]: gsm0480: correct parse_ss_info_elements() declaration

2018-01-16 Thread Vadim Yanitskiy

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

gsm0480: correct parse_ss_info_elements() declaration

Change-Id: I64df293188908c7eb10a61941db76656340d3a8e
---
M src/gsm/gsm0480.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/38/5838/1

diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c
index ca00999..e3856a5 100644
--- a/src/gsm/gsm0480.c
+++ b/src/gsm/gsm0480.c
@@ -198,7 +198,7 @@
uint16_t len, struct ss_request *req);
 static int parse_ss_facility(const uint8_t *ss_facility, uint16_t len,
 struct ss_request *req);
-static int parse_ss_info_elements(const uint8_t *ussd_ie, uint16_t len,
+static int parse_ss_info_elements(const uint8_t *ss_ie, uint16_t len,
  struct ss_request *req);
 static int parse_facility_ie(const uint8_t *facility_ie, uint16_t length,
 struct ss_request *req);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I64df293188908c7eb10a61941db76656340d3a8e
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 


[PATCH] libosmocore[master]: gsm0480: pass exact GSM 04.80 payload length to parse_ss()

2018-01-16 Thread Vadim Yanitskiy

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

gsm0480: pass exact GSM 04.80 payload length to parse_ss()

Change-Id: I9608d4ad16d7581320615c140beaac36628c31a4
---
M src/gsm/gsm0480.c
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/35/5835/1

diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c
index 8319b19..75388b9 100644
--- a/src/gsm/gsm0480.c
+++ b/src/gsm/gsm0480.c
@@ -232,7 +232,7 @@
req->transaction_id = hdr->proto_discr & 0x70;
 
ss.transaction_id = req->transaction_id;
-   rc = parse_ss(hdr, len, );
+   rc = parse_ss(hdr, len - sizeof(*hdr), );
 
/* convert from ss_request to legacy ussd_request */
req->transaction_id = ss.transaction_id;
@@ -271,7 +271,7 @@
 
if (gsm48_hdr_pdisc(hdr) == GSM48_PDISC_NC_SS) {
req->transaction_id = hdr->proto_discr & 0x70;
-   rc = parse_ss(hdr, len, req);
+   rc = parse_ss(hdr, len - sizeof(*hdr), req);
}
 
if (!rc)
@@ -293,10 +293,10 @@
req->ussd_text[0] = 0xFF;
break;
case GSM0480_MTYPE_REGISTER:
-   rc &= parse_ss_info_elements(>data[0], len - sizeof(*hdr), 
req);
+   rc &= parse_ss_info_elements(>data[0], len, req);
break;
case GSM0480_MTYPE_FACILITY:
-   rc &= parse_ss_facility(>data[0], len - sizeof(*hdr), req);
+   rc &= parse_ss_facility(>data[0], len, req);
break;
default:
LOGP(0, LOGL_DEBUG, "Unknown GSM 04.80 message-type field 
0x%02x\n",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9608d4ad16d7581320615c140beaac36628c31a4
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 


Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.10/i586

2018-01-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.10/i586

Package network:osmocom:nightly/libosmocore failed to build in 
xUbuntu_16.10/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly libosmocore

Last lines of build log:
[   28s] [113/237] installing autopoint-0.19.8.1-1ubuntu2
[   28s] [114/237] installing libp11-kit-dev-0.23.2-5
[   28s] [115/237] installing file-1:5.28-2ubuntu1
[   29s] [116/237] installing libacl1-2.2.52-3
[   29s] Processing triggers for libc-bin (2.24-3ubuntu1) ...
[   29s] [117/237] installing libgmp-dev-2:6.1.1+dfsg-1
[   29s] [118/237] installing libsasl2-2-2.1.26.dfsg1-15
[   29s] Processing triggers for libc-bin (2.24-3ubuntu1) ...
[   29s] [119/237] installing libselinux1-2.5-3
[   29s] Processing triggers for libc-bin (2.24-3ubuntu1) ...
[   29s] [120/237] installing zlib1g-dev-1:1.2.8.dfsg-2ubuntu5
[   29s] [121/237] installing bison-2:3.0.4.dfsg-1
[   29s] update-alternatives: using /usr/bin/bison.yacc to provide 
/usr/bin/yacc (yacc) in auto mode
[   29s] [122/237] installing libhcrypto4-heimdal-1.7~git20150920+dfsg-4ubuntu1
[   29s] Processing triggers for libc-bin (2.24-3ubuntu1) ...
[   29s] [123/237] installing libmpc3-1.0.3-1
[   29s] Processing triggers for libc-bin (2.24-3ubuntu1) ...
[   29s] [124/237] installing libxml2-2.9.4+dfsg1-2
[   29s] Processing triggers for libc-bin (2.24-3ubuntu1) ...
[   30s] [125/237] installing libkrb5-3-1.14.3+dfsg-2
[   30s] Processing triggers for libc-bin (2.24-3ubuntu1) ...
[   30s] [126/237] installing libllvm3.8-1:3.8.1-12ubuntu1
[28837s] qemu-system-x86_64: terminating on signal 15 from pid 5767 ()
[28837s] ### VM INTERACTION END ###
[28837s] No buildstatus set, either the base system is broken 
(kernel/initrd/udev/glibc/bash/perl)
[28837s] or the build host has a kernel or hardware problem...


Job seems to be stuck here, killed. (after 28800 seconds of inactivity)

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


osmo-bts[master]: Remove 11-bit RACH support from 'Known Limitations'

2018-01-16 Thread Alexander Huemer

Patch Set 1:

> Curious, have you tested that it actually works?

The reason why the build is failing at the moment is that 
https://gerrit.osmocom.org/#/c/5818/ is not yet merged.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I091f4fbd52c29c7d56ca392b8a1b872609829d81
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Alexander Huemer 
Gerrit-Reviewer: Alexander Huemer 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


osmo-bts[master]: Remove 11-bit RACH support from 'Known Limitations'

2018-01-16 Thread Max

Patch Set 1:

Curious, have you tested that it actually works?

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I091f4fbd52c29c7d56ca392b8a1b872609829d81
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Alexander Huemer 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


[PATCH] osmo-bts[master]: Remove 11-bit RACH support from 'Known Limitations'

2018-01-16 Thread Alexander Huemer

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

Remove 11-bit RACH support from 'Known Limitations'

Support for 11-bit RACH support was added to libosmocore with
https://gerrit.osmocom.org/#/c/5062

Change-Id: I091f4fbd52c29c7d56ca392b8a1b872609829d81
---
M README.md
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/README.md b/README.md
index 43c27b2..5e6355d 100644
--- a/README.md
+++ b/README.md
@@ -123,5 +123,4 @@
 
  * TCH/F_PDCH cannel not working as voice (https://osmocom.org/issues/1865)
  * No BER value delivered to OsmoPCU (https://osmocom.org/issues/1855)
- * No 11bit RACH support (https://osmocom.org/issues/1854)
  * No CBCH support (https://osmocom.org/issues/1617)

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

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


osmo-bts[master]: Fix test dependencies

2018-01-16 Thread Neels Hofmeyr

Patch Set 9: Code-Review-1

looks good, except I still insist on sane configure option semantics as 
described in earlier comment.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac
Gerrit-PatchSet: 9
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: neels 
Gerrit-HasComments: No


osmo-bts[master]: Move sysmobts-calib into osmo-bts-sysmo

2018-01-16 Thread Neels Hofmeyr

Patch Set 1: Code-Review+1

Thanks for splitting this off into another patch.

I'm not sure we should move the code around though. I was about to argue how 
src/ should be for the osmo-bts variants, with common/ and the various hardware 
platforms; but I see that there already is the sysmobts_mgr in 
src/osmo-bts-sysmo/misc as well. So I'd be fine with it after all, but would 
like confirmation from someone else (i.e. laforge).

Then the course of action would be to merge this patch even though jenkins 
cannot verify it, because the V+1 from jenkins on 
https://gerrit.osmocom.org/5818 does verify that this code works.

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

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


osmo-ggsn[master]: Fix stow-enabled jenkins build failure

2018-01-16 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

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

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


[MERGED] osmo-ggsn[master]: Fix stow-enabled jenkins build failure

2018-01-16 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: Fix stow-enabled jenkins build failure
..


Fix stow-enabled jenkins build failure

The error is:
CC   gtp-kernel.o
gtp-kernel.c:19:26: fatal error: libgtpnl/gtp.h: No such file or directory
 #include 
  ^
compilation terminated.

Fix it by using proper CFLAGS/LIBS for libgtpnl.

Change-Id: I5a24076778ea3ce263ac27211a6f45f935155b33
---
M ggsn/Makefile.am
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am
index 8a468a9..6b2232f 100644
--- a/ggsn/Makefile.am
+++ b/ggsn/Makefile.am
@@ -7,8 +7,8 @@
 osmo_ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a 
$(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS)
 
 if ENABLE_GTP_KERNEL
-AM_CFLAGS += -DGTP_KERNEL
-osmo_ggsn_LDADD += -lgtpnl
+AM_CFLAGS += -DGTP_KERNEL $(LIBGTPNL_CFLAGS)
+osmo_ggsn_LDADD += $(LIBGTPNL_LIBS)
 endif
 
 osmo_ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5a24076778ea3ce263ac27211a6f45f935155b33
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[PATCH] libosmocore[master]: fsm: fix double llist_del in osmo_fsm_inst_term()

2018-01-16 Thread dexter

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

fsm: fix double llist_del in osmo_fsm_inst_term()

llist_del(>proc.child) is executed always, regardless whether
a parent is configured or not. This may lead into a double llist_del
when the child has been previously unlinked.

- check if fi->proc.parent is set, and only then execute
  llist_del(>proc.child);

Change-Id: I4b33d508c8a11b72fbf30125088a882894d9e6ac
---
M src/fsm.c
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/31/5831/1

diff --git a/src/fsm.c b/src/fsm.c
index 0bdcd9d..f9effc4 100644
--- a/src/fsm.c
+++ b/src/fsm.c
@@ -483,10 +483,11 @@
 
/* delete ourselves from the parent */
parent = fi->proc.parent;
-   if (parent)
+   if (parent) {
LOGPFSMSRC(fi, file, line, "Removing from parent %s\n",
   osmo_fsm_inst_name(parent));
-   llist_del(>proc.child);
+   llist_del(>proc.child);
+   }
 
/* call destructor / clean-up function */
if (fi->fsm->cleanup)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b33d508c8a11b72fbf30125088a882894d9e6ac
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] libosmocore[master]: fsm: add function osmo_fsm_inst_set_parent()

2018-01-16 Thread dexter

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

fsm: add function osmo_fsm_inst_set_parent()

At the moment it is not possible to unlink a child from from
its parent, nor is it possible to assign a new parent to a
child FSM.

- Make it possible to unlink childs from a parent.

- Make it possible to change the parent of a child

Change-Id: I6d18cbd4ada903cf3720b3ad2a89fc643085beef
---
M include/osmocom/core/fsm.h
M src/fsm.c
2 files changed, 28 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/32/5832/1

diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h
index 2fbb250..1ae638b 100644
--- a/include/osmocom/core/fsm.h
+++ b/include/osmocom/core/fsm.h
@@ -150,6 +150,9 @@
 struct osmo_fsm_inst *osmo_fsm_inst_alloc_child(struct osmo_fsm *fsm,
struct osmo_fsm_inst *parent,
uint32_t parent_term_event);
+void osmo_fsm_inst_set_parent(struct osmo_fsm_inst *fi,
+ struct osmo_fsm_inst *new_parent,
+ uint32_t new_parent_term_event);
 void osmo_fsm_inst_free(struct osmo_fsm_inst *fi);
 
 const char *osmo_fsm_event_name(struct osmo_fsm *fsm, uint32_t event);
diff --git a/src/fsm.c b/src/fsm.c
index f9effc4..187d316 100644
--- a/src/fsm.c
+++ b/src/fsm.c
@@ -272,13 +272,35 @@
 
LOGPFSM(fi, "is child of %s\n", osmo_fsm_inst_name(parent));
 
-   fi->proc.parent = parent;
-   fi->proc.parent_term_event = parent_term_event;
-   llist_add(>proc.child, >proc.children);
+   osmo_fsm_inst_set_parent(fi, parent, parent_term_event);
 
return fi;
 }
 
+/*! set parent instance of an FSM.
+ *  \param[in] fi Descriptor of the to-be-allocated FSM.
+ *  \param[in] new_parent New parent FSM instance.
+ *  \param[in] new_parent_term_event Event to be sent to parent when 
terminating. */
+void osmo_fsm_inst_set_parent(struct osmo_fsm_inst *fi,
+ struct osmo_fsm_inst *new_parent,
+ uint32_t new_parent_term_event)
+{
+   /* If a parent already exists, unlink first */
+   if (fi->proc.parent) {
+   fi->proc.parent = NULL;
+   fi->proc.parent_term_event = 0;
+   llist_del(>proc.child);
+   }
+
+   /* Add new parent */
+   if (new_parent) {
+   fi->proc.parent = new_parent;
+   fi->proc.parent_term_event = new_parent_term_event;
+   llist_add(>proc.child, _parent->proc.children);
+
+   }
+}
+
 /*! delete a given instance of a FSM
  *  \param[in] fsm The FSM to be un-registered and deleted
  */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d18cbd4ada903cf3720b3ad2a89fc643085beef
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] osmo-bts[master]: Enable optional static builds

2018-01-16 Thread Max

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

Enable optional static builds

The default (for both manual and .deb builds) is to use shared build (as
before) - the static build is entirely optional.

Change-Id: Iabdebefef5c07dd1cd4b94b29ca40c6be0f8adda
---
M configure.ac
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/configure.ac b/configure.ac
index 89443d0..4a670ad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,7 @@
 AC_PROG_MAKE_SET
 AC_PROG_CC
 AC_PROG_INSTALL
-AC_PROG_RANLIB
+LT_INIT
 
 dnl check for pkg-config (explained in detail in libosmocore/configure.ac)
 AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iabdebefef5c07dd1cd4b94b29ca40c6be0f8adda
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 


libosmocore[master]: Log lapd_datalink state on errors

2018-01-16 Thread Max

Patch Set 1:

Resubmission of https://gerrit.osmocom.org/#/c/5749/ due to following error:
remote: Processing changes: refs: 1, done
To ssh://gerrit.osmocom.org:29418/libosmocore
 ! [remote rejected] HEAD -> refs/publish/master/log (commit already exists 
(in the change))
error: failed to push some refs to 
'ssh://m...@gerrit.osmocom.org:29418/libosmocore'

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

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


[ABANDON] libosmocore[master]: Log lapd_datalink state on errors

2018-01-16 Thread Max
Max has abandoned this change.

Change subject: Log lapd_datalink state on errors
..


Abandoned

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: I3141212fa74d045ee24a18eea1191d63cd15e0ed
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 


[PATCH] libosmocore[master]: Log lapd_datalink state on errors

2018-01-16 Thread Max

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

Log lapd_datalink state on errors

It's not very useful to get just the raw pointer address in case of
lapd_datalink receive error. Log it's state in addition.

Change-Id: Ie8c5df262312f886f509113f2707e36811df3bd5
---
M src/gsm/lapd_core.c
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/29/5829/1

diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c
index 5d87154..a2ff230 100644
--- a/src/gsm/lapd_core.c
+++ b/src/gsm/lapd_core.c
@@ -1505,7 +1505,7 @@
/* G.2.2 Wrong value of the C/R bit */
if (lctx->cr == dl->cr.rem2loc.resp) {
LOGP(DLLAPD, LOGL_ERROR,
-"I frame response not allowed (dl=%p)\n", dl);
+"I frame response not allowed (dl=%p state %s)\n", dl, 
lapd_state_name(dl->state));
msgb_free(msg);
mdl_error(MDL_CAUSE_FRM_UNIMPL, lctx);
return -EINVAL;
@@ -1517,7 +1517,7 @@
 * primitive with cause "I frame with incorrect length"
 * is sent to the mobile management entity. */
LOGP(DLLAPD, LOGL_ERROR,
-"I frame length not allowed (dl=%p)\n", dl);
+"I frame length not allowed (dl=%p state %s)\n", dl, 
lapd_state_name(dl->state));
msgb_free(msg);
mdl_error(MDL_CAUSE_IFRM_INC_LEN, lctx);
return -EIO;
@@ -1529,7 +1529,7 @@
 * mobile management entity. */
if (lctx->more && length < lctx->n201) {
LOGP(DLLAPD, LOGL_ERROR,
-"I frame with M bit too short (dl=%p)\n", dl);
+"I frame with M bit too short (dl=%p state %s)\n", dl, 
lapd_state_name(dl->state));
msgb_free(msg);
mdl_error(MDL_CAUSE_IFRM_INC_MBITS, lctx);
return -EIO;
@@ -1545,7 +1545,7 @@
case LAPD_STATE_SABM_SENT:
case LAPD_STATE_DISC_SENT:
LOGP(DLLAPD, LOGL_NOTICE,
-"I frame ignored in this state (dl=%p)\n", dl);
+"I frame ignored in state %s (dl=%p)\n", 
lapd_state_name(dl->state), dl);
msgb_free(msg);
return 0;
}
@@ -1553,7 +1553,7 @@
/* 5.7.1: N(s) sequence error */
if (ns != dl->v_recv) {
LOGP(DLLAPD, LOGL_NOTICE, "N(S) sequence error: N(S)=%u, "
-"V(R)=%u (dl=%p)\n", ns, dl->v_recv, dl);
+"V(R)=%u (dl=%p state %s)\n", ns, dl->v_recv, dl, 
lapd_state_name(dl->state));
/* discard data */
msgb_free(msg);
if (dl->seq_err_cond != 1) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie8c5df262312f886f509113f2707e36811df3bd5
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max 


[PATCH] osmo-ggsn[master]: Fix stow-enabled jenkins build failure

2018-01-16 Thread Max

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

Fix stow-enabled jenkins build failure

The error is:
CC   gtp-kernel.o
gtp-kernel.c:19:26: fatal error: libgtpnl/gtp.h: No such file or directory
 #include 
  ^
compilation terminated.

Fix it by using proper CFLAGS/LIBS for libgtpnl.

Change-Id: I5a24076778ea3ce263ac27211a6f45f935155b33
---
M ggsn/Makefile.am
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/28/5828/1

diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am
index 8a468a9..6b2232f 100644
--- a/ggsn/Makefile.am
+++ b/ggsn/Makefile.am
@@ -7,8 +7,8 @@
 osmo_ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a 
$(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS)
 
 if ENABLE_GTP_KERNEL
-AM_CFLAGS += -DGTP_KERNEL
-osmo_ggsn_LDADD += -lgtpnl
+AM_CFLAGS += -DGTP_KERNEL $(LIBGTPNL_CFLAGS)
+osmo_ggsn_LDADD += $(LIBGTPNL_LIBS)
 endif
 
 osmo_ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a24076778ea3ce263ac27211a6f45f935155b33
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Owner: Max 


[PATCH] osmo-ggsn[master]: Add GTP message names

2018-01-16 Thread Max
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/5758

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

Add GTP message names

Change-Id: I65eb80db4bcdc6da4d267bef3b907d3f98942a2e
---
M gtp/gtp.c
M gtp/gtp.h
2 files changed, 51 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/58/5758/2

diff --git a/gtp/gtp.c b/gtp/gtp.c
index b36e0c6..0d6d896 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -86,6 +86,51 @@
return VERSION;
 }
 
+const struct value_string gtp_type_names[] = {
+   { GTP_ECHO_REQ,"Echo Request" },
+   { GTP_ECHO_RSP,"Echo Response" },
+   { GTP_NOT_SUPPORTED,   "Version Not Supported" },
+   { GTP_ALIVE_REQ,   "Node Alive Request" },
+   { GTP_ALIVE_RSP,   "Node Alive Response" },
+   { GTP_REDIR_REQ,   "Redirection Request" },
+   { GTP_REDIR_RSP,   "Redirection Response" },
+   { GTP_CREATE_PDP_REQ,  "Create PDP Context Request" },
+   { GTP_CREATE_PDP_RSP,  "Create PDP Context Response" },
+   { GTP_UPDATE_PDP_REQ,  "Update PDP Context Request" },
+   { GTP_UPDATE_PDP_RSP,  "Update PDP Context Response" },
+   { GTP_DELETE_PDP_REQ,  "Delete PDP Context Request" },
+   { GTP_DELETE_PDP_RSP,  "Delete PDP Context Response" },
+   { GTP_ERROR,   "Error Indication" },
+   { GTP_PDU_NOT_REQ, "PDU Notification Request" },
+   { GTP_PDU_NOT_RSP, "PDU Notification Response" },
+   { GTP_PDU_NOT_REJ_REQ, "PDU Notification Reject Request" },
+   { GTP_PDU_NOT_REJ_RSP, "PDU Notification Reject Response" },
+   { GTP_SUPP_EXT_HEADER, "Supported Extension Headers Notification" },
+   { GTP_SND_ROUTE_REQ,   "Send Routeing Information for GPRS Request" },
+   { GTP_SND_ROUTE_RSP,   "Send Routeing Information for GPRS Response" },
+   { GTP_FAILURE_REQ, "Failure Report Request" },
+   { GTP_FAILURE_RSP, "Failure Report Response" },
+   { GTP_MS_PRESENT_REQ,  "Note MS GPRS Present Request" },
+   { GTP_MS_PRESENT_RSP,  "Note MS GPRS Present Response" },
+   { GTP_IDEN_REQ,"Identification Request" },
+   { GTP_IDEN_RSP,"Identification Response" },
+   { GTP_SGSN_CONTEXT_REQ,"SGSN Context Request" },
+   { GTP_SGSN_CONTEXT_RSP,"SGSN Context Response" },
+   { GTP_SGSN_CONTEXT_ACK,"SGSN Context Acknowledge" },
+   { GTP_FWD_RELOC_REQ,   "Forward Relocation Request" },
+   { GTP_FWD_RELOC_RSP,   "Forward Relocation Response" },
+   { GTP_FWD_RELOC_COMPL, "Forward Relocation Complete" },
+   { GTP_RELOC_CANCEL_REQ,"Relocation Cancel Request" },
+   { GTP_RELOC_CANCEL_RSP,"Relocation Cancel Response" },
+   { GTP_FWD_SRNS,"Forward SRNS Context" },
+   { GTP_FWD_RELOC_ACK,   "Forward Relocation Complete Acknowledge" },
+   { GTP_FWD_SRNS_ACK,"Forward SRNS Context Acknowledge" },
+   { GTP_DATA_TRAN_REQ,   "Data Record Transfer Request" },
+   { GTP_DATA_TRAN_RSP,   "Data Record Transfer Response" },
+   { GTP_GPDU,"G-PDU" },
+   { 0, NULL }
+};
+
 /* gtp_new */
 /* gtp_free */
 
diff --git a/gtp/gtp.h b/gtp/gtp.h
index d189ded..8f8e293 100644
--- a/gtp/gtp.h
+++ b/gtp/gtp.h
@@ -12,6 +12,8 @@
 #ifndef _GTP_H
 #define _GTP_H
 
+#include 
+
 #define GTP_MODE_GGSN 1
 #define GTP_MODE_SGSN 2
 
@@ -85,6 +87,10 @@
 /* 242-254 For future use. */
 #define GTP_GPDU255/* G-PDU */
 
+extern const struct value_string gtp_type_names[];
+static inline const char *gtp_type_name(uint8_t val)
+{ return get_value_string(gtp_type_names, val); }
+
 /* GTP information element cause codes from 29.060 v3.9.0 7.7 */
 /**/
 #define GTPCAUSE_REQ_IMSI   0  /* Request IMSI */

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I65eb80db4bcdc6da4d267bef3b907d3f98942a2e
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-pcu[master]: Allow specifying sysmocom headers explicitly

2018-01-16 Thread Max

Patch Set 7: Code-Review+1 Verified+1

Even more peculiar - sometimes it fails in one, sometimes in another fw 
version. Seems like this has nothing to do with the code, but some kind of race 
condition. I think we can safely merge this and figure out fix for unrelated 
issue in a separate patch.

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

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


osmo-bts[master]: Move sysmobts-calib into osmo-bts-sysmo

2018-01-16 Thread Max

Patch Set 1:

Note: we have to set V+1 manually because this is incomplete fix split off from 
5818 as requested.

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

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


osmo-bts[master]: Move sysmobts-calib into osmo-bts-sysmo

2018-01-16 Thread Max

Patch Set 1: Code-Review+1 Verified+1

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

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


[PATCH] osmo-bts[master]: Move sysmobts-calib into osmo-bts-sysmo

2018-01-16 Thread Max

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

Move sysmobts-calib into osmo-bts-sysmo

It's prerequisite for jenkins tests fix after migration to stow. The
sysmobts-calib uses hand-coded Makefile instead of automake which makes
it hard to properly propagate build flags. Also, make it optional to
enable excluding it from certain jenkins tests.

Change-Id: I3b54bfa5ef1d89092f6cf13dc27de10874b31b18
---
M .gitignore
M Makefile.am
M configure.ac
M contrib/jenkins_sysmobts.sh
D contrib/sysmobts-calib/Makefile
M src/osmo-bts-sysmo/Makefile.am
R src/osmo-bts-sysmo/misc/sysmobts-calib.c
R src/osmo-bts-sysmo/misc/sysmobts-layer1.c
R src/osmo-bts-sysmo/misc/sysmobts-layer1.h
9 files changed, 20 insertions(+), 19 deletions(-)


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

diff --git a/.gitignore b/.gitignore
index 2e8c884..1780e1c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,8 +22,7 @@
 core
 core.*
 
-contrib/sysmobts-calib/sysmobts-calib
-
+src/osmo-bts-sysmo/sysmobts-calib
 src/osmo-bts-sysmo/l1fwd-proxy
 src/osmo-bts-sysmo/osmo-bts-sysmo
 src/osmo-bts-sysmo/osmo-bts-sysmo-remote
diff --git a/Makefile.am b/Makefile.am
index 4832c84..dc42574 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,10 +7,6 @@
 EXTRA_DIST = \
contrib/dump_docs.py contrib/screenrc-l1fwd 
contrib/osmo-bts-sysmo.service \
contrib/l1fwd.init contrib/screenrc-sysmobts contrib/respawn.sh \
-   contrib/sysmobts.init contrib/sysmobts-calib/Makefile \
-   contrib/sysmobts-calib/sysmobts-calib.c \
-   contrib/sysmobts-calib/sysmobts-layer1.c \
-   contrib/sysmobts-calib/sysmobts-layer1.h \
doc/examples/sysmo/osmo-bts.cfg \
doc/examples/sysmo/sysmobts-mgr.cfg \
doc/examples/virtual/openbsc-virtual.cfg \
diff --git a/configure.ac b/configure.ac
index 89443d0..2181743 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,6 +54,14 @@
 PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 0.10.0)
 PKG_CHECK_MODULES(ORTP, ortp)
 
+AC_MSG_CHECKING([whether to enable support for sysmobts calibration tool])
+AC_ARG_ENABLE(sysmobts-calib,
+   AC_HELP_STRING([--enable-sysmobts-calib],
+   [enable code for sysmobts calibration tool 
[default=no]]),
+   [enable_sysmobts_calib="yes"],[enable_sysmobts_calib="no"])
+AC_MSG_RESULT([$enable_sysmobts_calib])
+AM_CONDITIONAL(ENABLE_SYSMOBTS_CALIB, test "x$enable_sysmobts_calib" = "xyes")
+
 AC_MSG_CHECKING([whether to enable support for sysmoBTS L1/PHY support])
 AC_ARG_ENABLE(sysmocom-bts,
AC_HELP_STRING([--enable-sysmocom-bts],
diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh
index faeb7c9..852542b 100755
--- a/contrib/jenkins_sysmobts.sh
+++ b/contrib/jenkins_sysmobts.sh
@@ -18,11 +18,11 @@
 
 configure_flags="--enable-sysmocom-bts"
 
-build_bts "osmo-bts-sysmo" "$configure_flags"
-
 # This will not work for the femtobts
 if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then
-  $MAKE -C contrib/sysmobts-calib
+configure_flags="$configure_flags --enable-sysmobts-calib"
 fi
 
+build_bts "osmo-bts-sysmo" "$configure_flags"
+
 osmo-clean-workspace.sh
diff --git a/contrib/sysmobts-calib/Makefile b/contrib/sysmobts-calib/Makefile
deleted file mode 100644
index a5d4b99..000
--- a/contrib/sysmobts-calib/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-CFLAGS=`pkg-config --cflags libosmocore` -Wall -Werror
-LIBS=`pkg-config --libs libosmocore libosmogsm`
-
-all: sysmobts-calib
-
-sysmobts-calib: sysmobts-calib.o sysmobts-layer1.o
-   $(CC) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ -lrt $(LIBS)
-
-clean:
-   @rm -f sysmobts-calib *.o
diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am
index c48b77c..6e917e7 100644
--- a/src/osmo-bts-sysmo/Makefile.am
+++ b/src/osmo-bts-sysmo/Makefile.am
@@ -4,6 +4,7 @@
 
 EXTRA_DIST = misc/sysmobts_mgr.h misc/sysmobts_misc.h misc/sysmobts_par.h \
misc/sysmobts_eeprom.h misc/sysmobts_nl.h femtobts.h hw_misc.h \
+   misc/sysmobts-layer1.h \
l1_fwd.h l1_if.h l1_transp.h eeprom.h utils.h oml_router.h
 
 bin_PROGRAMS = osmo-bts-sysmo osmo-bts-sysmo-remote l1fwd-proxy sysmobts-mgr 
sysmobts-util
@@ -20,6 +21,13 @@
 l1fwd_proxy_SOURCES = l1_fwd_main.c l1_transp_hw.c
 l1fwd_proxy_LDADD = $(top_builddir)/src/common/libbts.a $(COMMON_LDADD)
 
+if ENABLE_SYSMOBTS_CALIB
+bin_PROGRAMS = sysmobts-calib
+
+sysmobts_calib_SOURCES = misc/sysmobts-calib.c misc/sysmobts-layer1.c
+sysmobts_calib_LDADD = -lrt $(COMMON_LDADD)
+endif
+
 sysmobts_mgr_SOURCES = \
misc/sysmobts_mgr.c misc/sysmobts_misc.c \
misc/sysmobts_par.c misc/sysmobts_nl.c \
diff --git a/contrib/sysmobts-calib/sysmobts-calib.c 
b/src/osmo-bts-sysmo/misc/sysmobts-calib.c
similarity index 100%
rename from contrib/sysmobts-calib/sysmobts-calib.c
rename to src/osmo-bts-sysmo/misc/sysmobts-calib.c
diff --git a/contrib/sysmobts-calib/sysmobts-layer1.c 
b/src/osmo-bts-sysmo/misc/sysmobts-layer1.c
similarity index 

[PATCH] osmo-bts[master]: Fix test dependencies

2018-01-16 Thread Max
Hello Neels Hofmeyr, Jenkins Builder,

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

https://gerrit.osmocom.org/5818

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

Fix test dependencies

The stow-enabled jenkins builds are currently failing like below:

In file included from ../../include/osmo-bts/gsm_data.h:136:0,
 from ../../include/osmo-bts/bts.h:4,
 from misc_test.c:23:
../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: 
osmocom/abis/e1_input.h: No such file or directory
 #include 

Let's make sure that tests have all required CFLAGS/LIBS to build by
allowing to specify sysmobts headers location explicitly similar to
other BTS models.

Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac
---
M configure.ac
M contrib/jenkins_sysmobts.sh
M src/osmo-bts-sysmo/Makefile.am
M tests/misc/Makefile.am
M tests/sysmobts/Makefile.am
5 files changed, 14 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/5818/9

diff --git a/configure.ac b/configure.ac
index 2181743..1c3efe0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,10 +67,19 @@
AC_HELP_STRING([--enable-sysmocom-bts],
[enable code for sysmoBTS L1/PHY [default=no]]),
[enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"])
+AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], 
[Location of the sysmobts API header files])],
+
[sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"])
+AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir)
 AC_MSG_RESULT([$enable_sysmocom_bts])
 AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes")
 if test "$enable_sysmocom_bts" = "yes"; then
+   oldCPPFLAGS=$CPPFLAGS
+   CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include 
$LIBOSMOCORE_CFLAGS"
+   AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[],
+   [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not 
be found in $sysmobts_incdir])],
+   [#include ])
PKG_CHECK_MODULES(LIBGPS, libgps)
+   CPPFLAGS=$oldCPPFLAGS
 fi
 
 AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support])
diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh
index 852542b..88aef3d 100755
--- a/contrib/jenkins_sysmobts.sh
+++ b/contrib/jenkins_sysmobts.sh
@@ -16,7 +16,7 @@
 mkdir -p "$inst/include/sysmocom/femtobts"
 ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/"
 
-configure_flags="--enable-sysmocom-bts"
+configure_flags="--with-sysmobts=$inst/include/ --enable-sysmocom-bts"
 
 # This will not work for the femtobts
 if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then
diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am
index 6e917e7..b837d3a 100644
--- a/src/osmo-bts-sysmo/Makefile.am
+++ b/src/osmo-bts-sysmo/Makefile.am
@@ -1,4 +1,4 @@
-AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
+AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR)
 AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) 
$(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) 
$(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) 
$(LIBGPS_CFLAGS) $(ORTP_CFLAGS)
 COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) 
$(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) 
$(ORTP_LIBS)
 
diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am
index 6575fe8..2ddb649 100644
--- a/tests/misc/Makefile.am
+++ b/tests/misc/Makefile.am
@@ -1,6 +1,6 @@
 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
-AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) 
$(LIBOSMOCODEC_CFLAGS)
-LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS)
+AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) 
$(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS)
+LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) 
$(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS)
 noinst_PROGRAMS = misc_test
 EXTRA_DIST = misc_test.ok
 
diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am
index 654ab5d..2a57b2b 100644
--- a/tests/sysmobts/Makefile.am
+++ b/tests/sysmobts/Makefile.am
@@ -1,4 +1,4 @@
-AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include 
-I$(top_srcdir)/src/osmo-bts-sysmo
+AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include 
-I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR)
 AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) 
$(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS)
 LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) 
$(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS)
 

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: 

osmo-bts[master]: Fix test dependencies

2018-01-16 Thread Max

Patch Set 7:

Ok, than I'll first make it work with jenkins as a single patch and than 
resubmit splitted version.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac
Gerrit-PatchSet: 7
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: neels 
Gerrit-HasComments: No


[PATCH] osmo-bsc[master]: Split paging cases in bssmap_handle_paging() off into helper...

2018-01-16 Thread Stefan Sperling

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

Split paging cases in bssmap_handle_paging() off into helper functions.

This is mostly no-op code refactoring which makes it easier to maintain the
code for each paging case and reduces the scope of several local variables.

Also, ensure that paging failures where no matching BTS was found are logged
consistently in all cases. The log level changes from ERROR to NOTICE since
this is not necessarily a fatal condition.

Change-Id: If8fdf425145791f4904a70e295bdc3c7d0f4d5f6
---
M src/osmo-bsc/osmo_bsc_bssap.c
1 file changed, 186 insertions(+), 130 deletions(-)


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

diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 1894561..799cb46 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -273,6 +273,179 @@
return gsm48_decode_lai(, mcc, mnc, lac) != 0 ? -1 : 0;
 }
 
+static void
+page_all_bts(struct bsc_msc_data *msc, uint32_t tmsi, const char *mi_string, 
uint8_t chan_needed)
+{
+   struct gsm_bts *bts;
+   llist_for_each_entry(bts, >network->bts_list, list) {
+   /* ignore errors from page_subscriber(); try all BTS */
+   page_subscriber(msc, bts, tmsi, GSM_LAC_RESERVED_ALL_BTS, 
mi_string, chan_needed);
+   }
+}
+
+static void
+page_cgi(struct bsc_msc_data *msc, const uint8_t *data, uint8_t data_length, 
size_t remain,
+uint32_t tmsi, const char *mi_string, uint8_t chan_needed)
+{
+   uint16_t ci;
+   int i = 0;
+   while (remain >= sizeof(struct gsm48_loc_area_id) + sizeof(ci)) {
+   uint16_t mcc, mnc, lac, *ci_be;
+   size_t lai_offset = 1 + i * (sizeof(struct gsm48_loc_area_id) + 
sizeof(ci));
+   if (decode_lai([lai_offset], , , ) != 0) {
+   LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in 
Cell Identifier List "
+"for BSS (0x%x), paging entire BSS anyway (%s)\n",
+mi_string, CELL_IDENT_BSS, osmo_hexdump(data, 
data_length));
+   page_all_bts(msc, tmsi, mi_string, chan_needed);
+   return;
+   }
+   ci_be = (uint16_t *)([lai_offset + sizeof(struct 
gsm48_loc_area_id)]);
+   ci = osmo_load16be(ci_be);
+   if (mcc == msc->network->country_code && mnc == 
msc->network->network_code) {
+   int paged = 0;
+   struct gsm_bts *bts;
+   llist_for_each_entry(bts, >network->bts_list, 
list) {
+   if (bts->location_area_code != lac)
+   continue;
+   if (bts->cell_identity != ci)
+   continue;
+   /* ignore errors from page_subscriber(); keep 
trying other BTS */
+   page_subscriber(msc, bts, tmsi, lac, mi_string, 
chan_needed);
+   paged = 1;
+   }
+   if (!paged) {
+   LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: BTS 
with LAC %d and CI %d not found\n",
+mi_string, lac, ci);
+   }
+   } else {
+   LOGP(DMSC, LOGL_DEBUG, "Paging IMSI %s: MCC/MNC in Cell 
Identifier List "
+"(%d/%d) do not match our network (%d/%d)\n", 
mi_string, mcc, mnc,
+msc->network->country_code, 
msc->network->network_code);
+   }
+   remain -= sizeof(struct gsm48_loc_area_id) + sizeof(ci);
+   i++;
+   }
+}
+
+static void
+page_lac_and_ci(struct bsc_msc_data *msc, const uint8_t *data, size_t remain,
+uint32_t tmsi, const char *mi_string, uint8_t chan_needed)
+{
+   uint16_t *lacp_be, *ci_be;
+   lacp_be = (uint16_t *)([1]);
+   ci_be = (uint16_t *)([3]);
+   while (remain >= sizeof(*lacp_be) + sizeof(*ci_be)) {
+   uint16_t lac = osmo_load16be(lacp_be);
+   uint16_t ci = osmo_load16be(ci_be);
+   int paged = 0;
+   struct gsm_bts *bts;
+   llist_for_each_entry(bts, >network->bts_list, list) {
+   if (bts->location_area_code != lac)
+   continue;
+   if (bts->cell_identity != ci)
+   continue;
+   /* ignore errors from page_subscriber(); keep trying 
other BTS */
+   page_subscriber(msc, bts, tmsi, lac, mi_string, 
chan_needed);
+   paged = 1;
+   }
+   if (!paged) {
+   LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: BTS with LAC 
%d and CI %d not found\n",
+mi_string, lac, ci);
+   

[PATCH] osmo-bts[master]: Fix test dependencies

2018-01-16 Thread Max
Hello Neels Hofmeyr, Jenkins Builder,

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

https://gerrit.osmocom.org/5818

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

Fix test dependencies

The stow-enabled jenkins builds are currently failing like below:

In file included from ../../include/osmo-bts/gsm_data.h:136:0,
 from ../../include/osmo-bts/bts.h:4,
 from misc_test.c:23:
../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: 
osmocom/abis/e1_input.h: No such file or directory
 #include 

Let's make sure that tests have all required CFLAGS/LIBS to build by
allowing to specify sysmobts headers location explicitly similar to
other BTS models. To propagate dependencies properly, sysmobts-calib was
moved into osmo-bts-sysmo/misc.

Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac
---
M .gitignore
M Makefile.am
M configure.ac
M contrib/jenkins_sysmobts.sh
D contrib/sysmobts-calib/Makefile
M src/osmo-bts-sysmo/Makefile.am
R src/osmo-bts-sysmo/misc/sysmobts-calib.c
R src/osmo-bts-sysmo/misc/sysmobts-layer1.c
R src/osmo-bts-sysmo/misc/sysmobts-layer1.h
M tests/misc/Makefile.am
M tests/sysmobts/Makefile.am
11 files changed, 34 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/5818/8

diff --git a/.gitignore b/.gitignore
index 2e8c884..1780e1c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,8 +22,7 @@
 core
 core.*
 
-contrib/sysmobts-calib/sysmobts-calib
-
+src/osmo-bts-sysmo/sysmobts-calib
 src/osmo-bts-sysmo/l1fwd-proxy
 src/osmo-bts-sysmo/osmo-bts-sysmo
 src/osmo-bts-sysmo/osmo-bts-sysmo-remote
diff --git a/Makefile.am b/Makefile.am
index 4832c84..dc42574 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,10 +7,6 @@
 EXTRA_DIST = \
contrib/dump_docs.py contrib/screenrc-l1fwd 
contrib/osmo-bts-sysmo.service \
contrib/l1fwd.init contrib/screenrc-sysmobts contrib/respawn.sh \
-   contrib/sysmobts.init contrib/sysmobts-calib/Makefile \
-   contrib/sysmobts-calib/sysmobts-calib.c \
-   contrib/sysmobts-calib/sysmobts-layer1.c \
-   contrib/sysmobts-calib/sysmobts-layer1.h \
doc/examples/sysmo/osmo-bts.cfg \
doc/examples/sysmo/sysmobts-mgr.cfg \
doc/examples/virtual/openbsc-virtual.cfg \
diff --git a/configure.ac b/configure.ac
index 89443d0..1c3efe0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,15 +54,32 @@
 PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 0.10.0)
 PKG_CHECK_MODULES(ORTP, ortp)
 
+AC_MSG_CHECKING([whether to enable support for sysmobts calibration tool])
+AC_ARG_ENABLE(sysmobts-calib,
+   AC_HELP_STRING([--enable-sysmobts-calib],
+   [enable code for sysmobts calibration tool 
[default=no]]),
+   [enable_sysmobts_calib="yes"],[enable_sysmobts_calib="no"])
+AC_MSG_RESULT([$enable_sysmobts_calib])
+AM_CONDITIONAL(ENABLE_SYSMOBTS_CALIB, test "x$enable_sysmobts_calib" = "xyes")
+
 AC_MSG_CHECKING([whether to enable support for sysmoBTS L1/PHY support])
 AC_ARG_ENABLE(sysmocom-bts,
AC_HELP_STRING([--enable-sysmocom-bts],
[enable code for sysmoBTS L1/PHY [default=no]]),
[enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"])
+AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], 
[Location of the sysmobts API header files])],
+
[sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"])
+AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir)
 AC_MSG_RESULT([$enable_sysmocom_bts])
 AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes")
 if test "$enable_sysmocom_bts" = "yes"; then
+   oldCPPFLAGS=$CPPFLAGS
+   CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include 
$LIBOSMOCORE_CFLAGS"
+   AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[],
+   [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not 
be found in $sysmobts_incdir])],
+   [#include ])
PKG_CHECK_MODULES(LIBGPS, libgps)
+   CPPFLAGS=$oldCPPFLAGS
 fi
 
 AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support])
diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh
index faeb7c9..88aef3d 100755
--- a/contrib/jenkins_sysmobts.sh
+++ b/contrib/jenkins_sysmobts.sh
@@ -16,13 +16,13 @@
 mkdir -p "$inst/include/sysmocom/femtobts"
 ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/"
 
-configure_flags="--enable-sysmocom-bts"
-
-build_bts "osmo-bts-sysmo" "$configure_flags"
+configure_flags="--with-sysmobts=$inst/include/ --enable-sysmocom-bts"
 
 # This will not work for the femtobts
 if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then
-  $MAKE -C contrib/sysmobts-calib
+configure_flags="$configure_flags --enable-sysmobts-calib"
 fi
 
+build_bts "osmo-bts-sysmo" "$configure_flags"
+
 osmo-clean-workspace.sh
diff --git a/contrib/sysmobts-calib/Makefile b/contrib/sysmobts-calib/Makefile
deleted file mode 100644
index 

osmo-trx[master]: tests: convolve: Disable due to difference in output in diff...

2018-01-16 Thread Pau Espin Pedrol

Patch Set 1:

@alexander: On top of sending the mail to the ml, I already assigned a task to 
Tsou a few days ago too (https://osmocom.org/issues/2826). I think that counts 
as pinging specifically.

@max: I can prefix it with FIXME but anyway it's quite visible since everytime 
you run the tests it outputs "skipped" for that specific test. You can then go 
check and see the comment.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I2320309bc8c1c20e2de6ef2e0f17472c68de80cb
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: ttsou 
Gerrit-HasComments: No


asn1c[master]: fix jenkins build: add contrib/jenkins.sh expected by jobs

2018-01-16 Thread Neels Hofmeyr

Patch Set 2: Code-Review+2

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

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


[MERGED] asn1c[master]: fix jenkins build: add contrib/jenkins.sh expected by jobs

2018-01-16 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: fix jenkins build: add contrib/jenkins.sh expected by jobs
..


fix jenkins build: add contrib/jenkins.sh expected by jobs

Change-Id: I1ef4b9ce3080ce9cad9ed92ead01619b0d6f91f4
---
A contrib/jenkins.sh
1 file changed, 21 insertions(+), 0 deletions(-)

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



diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
new file mode 100755
index 000..1b09c8b
--- /dev/null
+++ b/contrib/jenkins.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# jenkins build helper script for asn1c.  This is how we build on 
jenkins.osmocom.org
+
+set -ex
+
+osmo-clean-workspace.sh
+
+set +x
+echo
+echo
+echo
+echo " === asn1c ==="
+echo
+set -x
+
+./configure # CFLAGS="-Werror" CPPFLAGS="-Werror" #-Werror currently broken
+$MAKE $PARALLEL_MAKE
+$MAKE check
+#$MAKE distcheck # distcheck currently broken
+
+osmo-clean-workspace.sh

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1ef4b9ce3080ce9cad9ed92ead01619b0d6f91f4
Gerrit-PatchSet: 2
Gerrit-Project: asn1c
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[PATCH] osmo-bsc[master]: handover_decision: log HO causes more accurately

2018-01-16 Thread Neels Hofmeyr
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/5802

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

handover_decision: log HO causes more accurately

Tweaked-by: nhofm...@sysmocom.de
Change-Id: Ib0a0787ac8b877ac63455d72886389b546e7a337
---
M src/libbsc/handover_decision.c
1 file changed, 15 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/02/5802/3

diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c
index c637e25..3bca05f 100644
--- a/src/libbsc/handover_decision.c
+++ b/src/libbsc/handover_decision.c
@@ -230,7 +230,7 @@
rc = handover_to_arfcn_bsic(mr->lchan, best_cell->arfcn, 
best_cell->bsic);
switch (rc) {
case 0:
-   LOGPC(DHO, LOGL_INFO, "Starting handover\n");
+   LOGPC(DHO, LOGL_INFO, "Starting handover: meas report number %d 
\n", mr->nr);
break;
case -ENOSPC:
LOGPC(DHO, LOGL_INFO, "No channel available\n");
@@ -278,20 +278,30 @@
 
/* Interference HO */
if (rxlev2dbm(av_rxlev) > -85 &&
-   meas_rep_n_out_of_m_be(mr->lchan, dqual, 3, 4, 5))
+   meas_rep_n_out_of_m_be(mr->lchan, dqual, 3, 4, 5)) {
+   LOGPC(DHO, LOGL_INFO, "HO cause: Interference HO av_rxlev=%d 
dBm\n",
+ rxlev2dbm(av_rxlev));
return attempt_handover(mr);
+   }
 
/* Bad Quality */
-   if (meas_rep_n_out_of_m_be(mr->lchan, dqual, 3, 4, 5))
+   if (meas_rep_n_out_of_m_be(mr->lchan, dqual, 3, 4, 5)) {
+   LOGPC(DHO, LOGL_INFO, "HO cause: Bad Quality av_rxlev=%d 
dBm\n", rxlev2dbm(av_rxlev));
return attempt_handover(mr);
+   }
 
/* Low Level */
-   if (rxlev2dbm(av_rxlev) <= -110)
+   if (rxlev2dbm(av_rxlev) <= -110) {
+   LOGPC(DHO, LOGL_INFO, "HO cause: Low Level av_rxlev=%d dBm\n", 
rxlev2dbm(av_rxlev));
return attempt_handover(mr);
+   }
 
/* Distance */
-   if (mr->ms_l1.ta > net->handover.max_distance)
+   if (mr->ms_l1.ta > net->handover.max_distance) {
+   LOGPC(DHO, LOGL_INFO, "HO cause: Distance av_rxlev=%d dBm 
ta=%u\n",
+ rxlev2dbm(av_rxlev), mr->ms_l1.ta);
return attempt_handover(mr);
+   }
 
/* Power Budget AKA Better Cell */
if ((mr->nr % net->handover.pwr_interval) == net->handover.pwr_interval 
- 1)

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ib0a0787ac8b877ac63455d72886389b546e7a337
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Ivan Kluchnikov 
Gerrit-Reviewer: Jenkins Builder


[PATCH] asn1c[master]: fix jenkins build: add contrib/jenkins.sh expected by jobs

2018-01-16 Thread Neels Hofmeyr
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/5825

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

fix jenkins build: add contrib/jenkins.sh expected by jobs

Change-Id: I1ef4b9ce3080ce9cad9ed92ead01619b0d6f91f4
---
A contrib/jenkins.sh
1 file changed, 21 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/asn1c refs/changes/25/5825/2

diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
new file mode 100755
index 000..1b09c8b
--- /dev/null
+++ b/contrib/jenkins.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# jenkins build helper script for asn1c.  This is how we build on 
jenkins.osmocom.org
+
+set -ex
+
+osmo-clean-workspace.sh
+
+set +x
+echo
+echo
+echo
+echo " === asn1c ==="
+echo
+set -x
+
+./configure # CFLAGS="-Werror" CPPFLAGS="-Werror" #-Werror currently broken
+$MAKE $PARALLEL_MAKE
+$MAKE check
+#$MAKE distcheck # distcheck currently broken
+
+osmo-clean-workspace.sh

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

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


osmo-bts[master]: jenkins_common.sh: fix build_bts distcheck for more than one...

2018-01-16 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


asn1c[master]: fix jenkins build: add contrib/jenkins.sh expected by jobs

2018-01-16 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-bsc[master]: handover_decision: log HO causes more accurately

2018-01-16 Thread Harald Welte

Patch Set 2: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/#/c/5802/2/src/libbsc/handover_decision.c
File src/libbsc/handover_decision.c:

Line 282:   LOGPC(DHO, LOGL_INFO, "HO cause: Interference HO 
av_rxlev=%d dbm\n",
"dBm" with uppercase B. Please fix, thanks!


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib0a0787ac8b877ac63455d72886389b546e7a337
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Ivan Kluchnikov 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: Yes


osmo-bsc[master]: handover_decision: Fix condition for power budget handover a...

2018-01-16 Thread Harald Welte

Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: If7f54a4cb179eaa9e5eb147b9477633ac618e69e
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Ivan Kluchnikov 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-bts[master]: Fix test dependencies

2018-01-16 Thread Harald Welte

Patch Set 7:

> agree but how do you plan to merge it? - all the parts are
 > necessary to unbreak jenkins tests.

we can always remove the "V-1" and give it a V+1 manually.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac
Gerrit-PatchSet: 7
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: neels 
Gerrit-HasComments: No


[PATCH] asn1c[master]: fix jenkins build: add contrib/jenkins.sh expected by jobs

2018-01-16 Thread Neels Hofmeyr

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

fix jenkins build: add contrib/jenkins.sh expected by jobs

Change-Id: I1ef4b9ce3080ce9cad9ed92ead01619b0d6f91f4
---
A contrib/jenkins.sh
1 file changed, 21 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/asn1c refs/changes/25/5825/1

diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
new file mode 100644
index 000..1b09c8b
--- /dev/null
+++ b/contrib/jenkins.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# jenkins build helper script for asn1c.  This is how we build on 
jenkins.osmocom.org
+
+set -ex
+
+osmo-clean-workspace.sh
+
+set +x
+echo
+echo
+echo
+echo " === asn1c ==="
+echo
+set -x
+
+./configure # CFLAGS="-Werror" CPPFLAGS="-Werror" #-Werror currently broken
+$MAKE $PARALLEL_MAKE
+$MAKE check
+#$MAKE distcheck # distcheck currently broken
+
+osmo-clean-workspace.sh

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ef4b9ce3080ce9cad9ed92ead01619b0d6f91f4
Gerrit-PatchSet: 1
Gerrit-Project: asn1c
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


osmo-bts[master]: Fix test dependencies

2018-01-16 Thread Max

Patch Set 7:

> would be nice to split this patch

agree but how do you plan to merge it? - all the parts are necessary to unbreak 
jenkins tests.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac
Gerrit-PatchSet: 7
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: neels 
Gerrit-HasComments: No


osmo-pcu[master]: Allow specifying sysmocom headers explicitly

2018-01-16 Thread Max

Patch Set 7:

The remaining issue with vty check puzzles me: unable to reproduce it locally 
and it somehow only happens with single fw version although vty commands are 
generic ones.

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

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


osmo-trx[master]: tests: convolve: Disable due to difference in output in diff...

2018-01-16 Thread Max

Patch Set 1:

> it is even inside the commit in testsuite.at

Might make sense to prefix it with FIXME so it'll jump out when grepping the 
sources.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I2320309bc8c1c20e2de6ef2e0f17472c68de80cb
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: ttsou 
Gerrit-HasComments: No


osmo-bts[master]: Fix test dependencies

2018-01-16 Thread Neels Hofmeyr

Patch Set 7: Code-Review-1

(2 comments)

would be nice to split this patch

https://gerrit.osmocom.org/#/c/5818/5/configure.ac
File configure.ac:

Line 62: AC_MSG_RESULT([$enable_sysmobts_calib])
With this patch it seems that this alone does not work:

  ./configure --with-sysmobts=foo

and that the old invocation

  ./configure --enable-sysmocom-bts

also no longer works on its own?

I think...

* we should keep the old --enable-sysmocom-bts option so we don't produce build 
fallout everywhere. It should yield exactly the previous behavior:
* we need a $sysmobts_incdir default so that --enable-sysmocom-bts works 
without issuing --with-sysmobts=.
* when --with-sysmobts was passed, $enable_sysmocom_bts should also be set to 
yes.


https://gerrit.osmocom.org/#/c/5818/5/contrib/sysmobts-calib/Makefile.am
File contrib/sysmobts-calib/Makefile.am:

Line 2: AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS)
shouldn't this also include the sysmobts header CFLAGS?


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac
Gerrit-PatchSet: 7
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: neels 
Gerrit-HasComments: Yes


[PATCH] osmo-bts[master]: Fix test dependencies

2018-01-16 Thread Max
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5818

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

Fix test dependencies

The stow-enabled jenkins builds are currently failing like below:

In file included from ../../include/osmo-bts/gsm_data.h:136:0,
 from ../../include/osmo-bts/bts.h:4,
 from misc_test.c:23:
../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: 
osmocom/abis/e1_input.h: No such file or directory
 #include 

Let's make sure that tests have all required CFLAGS/LIBS to build by
allowing to specify sysmobts headers location explicitly similar to
other BTS models. To propagate dependencies properly, sysmobts-calib was
converted to automake.

Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac
---
M Makefile.am
M configure.ac
M contrib/jenkins_sysmobts.sh
D contrib/sysmobts-calib/Makefile
A contrib/sysmobts-calib/Makefile.am
M src/osmo-bts-sysmo/Makefile.am
M tests/misc/Makefile.am
M tests/sysmobts/Makefile.am
8 files changed, 38 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/5818/7

diff --git a/Makefile.am b/Makefile.am
index 4832c84..89a0eec 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,15 +2,14 @@
 
 SUBDIRS = include src tests
 
+if ENABLE_SYSMOBTS_CALIB
+SUBDIRS += contrib/sysmobts-calib
+endif
 
 # package the contrib and doc
 EXTRA_DIST = \
contrib/dump_docs.py contrib/screenrc-l1fwd 
contrib/osmo-bts-sysmo.service \
contrib/l1fwd.init contrib/screenrc-sysmobts contrib/respawn.sh \
-   contrib/sysmobts.init contrib/sysmobts-calib/Makefile \
-   contrib/sysmobts-calib/sysmobts-calib.c \
-   contrib/sysmobts-calib/sysmobts-layer1.c \
-   contrib/sysmobts-calib/sysmobts-layer1.h \
doc/examples/sysmo/osmo-bts.cfg \
doc/examples/sysmo/sysmobts-mgr.cfg \
doc/examples/virtual/openbsc-virtual.cfg \
diff --git a/configure.ac b/configure.ac
index 89443d0..8604691 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,15 +54,32 @@
 PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 0.10.0)
 PKG_CHECK_MODULES(ORTP, ortp)
 
+AC_MSG_CHECKING([whether to enable support for sysmobts calibration tool])
+AC_ARG_ENABLE(sysmobts-calib,
+   AC_HELP_STRING([--enable-sysmobts-calib],
+   [enable code for sysmobts calibration tool 
[default=no]]),
+   [enable_sysmobts_calib="yes"],[enable_sysmobts_calib="no"])
+AC_MSG_RESULT([$enable_sysmobts_calib])
+AM_CONDITIONAL(ENABLE_SYSMOBTS_CALIB, test "x$enable_sysmobts_calib" = "xyes")
+
 AC_MSG_CHECKING([whether to enable support for sysmoBTS L1/PHY support])
 AC_ARG_ENABLE(sysmocom-bts,
AC_HELP_STRING([--enable-sysmocom-bts],
[enable code for sysmoBTS L1/PHY [default=no]]),
[enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"])
+AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], 
[Location of the sysmobts API header files])],
+
[sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"])
+AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir)
 AC_MSG_RESULT([$enable_sysmocom_bts])
 AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes")
 if test "$enable_sysmocom_bts" = "yes"; then
+   oldCPPFLAGS=$CPPFLAGS
+   CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include 
$LIBOSMOCORE_CFLAGS"
+   AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[],
+   [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not 
be found in $sysmobts_incdir])],
+   [#include ])
PKG_CHECK_MODULES(LIBGPS, libgps)
+   CPPFLAGS=$oldCPPFLAGS
 fi
 
 AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support])
@@ -179,6 +196,7 @@
 src/osmo-bts-octphy/Makefile
 include/Makefile
 include/osmo-bts/Makefile
+contrib/sysmobts-calib/Makefile
 tests/Makefile
 tests/paging/Makefile
 tests/agch/Makefile
diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh
index faeb7c9..88aef3d 100755
--- a/contrib/jenkins_sysmobts.sh
+++ b/contrib/jenkins_sysmobts.sh
@@ -16,13 +16,13 @@
 mkdir -p "$inst/include/sysmocom/femtobts"
 ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/"
 
-configure_flags="--enable-sysmocom-bts"
-
-build_bts "osmo-bts-sysmo" "$configure_flags"
+configure_flags="--with-sysmobts=$inst/include/ --enable-sysmocom-bts"
 
 # This will not work for the femtobts
 if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then
-  $MAKE -C contrib/sysmobts-calib
+configure_flags="$configure_flags --enable-sysmobts-calib"
 fi
 
+build_bts "osmo-bts-sysmo" "$configure_flags"
+
 osmo-clean-workspace.sh
diff --git a/contrib/sysmobts-calib/Makefile b/contrib/sysmobts-calib/Makefile
deleted file mode 100644
index a5d4b99..000
--- a/contrib/sysmobts-calib/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-CFLAGS=`pkg-config 

[PATCH] osmo-bts[master]: Fix test dependencies

2018-01-16 Thread Max
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5818

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

Fix test dependencies

The stow-enabled jenkins builds are currently failing like below:

In file included from ../../include/osmo-bts/gsm_data.h:136:0,
 from ../../include/osmo-bts/bts.h:4,
 from misc_test.c:23:
../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: 
osmocom/abis/e1_input.h: No such file or directory
 #include 

Let's make sure that tests have all required CFLAGS/LIBS to build by
allowing to specify sysmobts headers location explicitly similar to
other BTS models. To propagate dependencies properly, sysmobts-calib was
converted to automake.

Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac
---
M Makefile.am
M configure.ac
M contrib/jenkins_sysmobts.sh
D contrib/sysmobts-calib/Makefile
A contrib/sysmobts-calib/Makefile.am
M src/osmo-bts-sysmo/Makefile.am
M tests/misc/Makefile.am
M tests/sysmobts/Makefile.am
8 files changed, 38 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/5818/6

diff --git a/Makefile.am b/Makefile.am
index 4832c84..89a0eec 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,15 +2,14 @@
 
 SUBDIRS = include src tests
 
+if ENABLE_SYSMOBTS_CALIB
+SUBDIRS += contrib/sysmobts-calib
+endif
 
 # package the contrib and doc
 EXTRA_DIST = \
contrib/dump_docs.py contrib/screenrc-l1fwd 
contrib/osmo-bts-sysmo.service \
contrib/l1fwd.init contrib/screenrc-sysmobts contrib/respawn.sh \
-   contrib/sysmobts.init contrib/sysmobts-calib/Makefile \
-   contrib/sysmobts-calib/sysmobts-calib.c \
-   contrib/sysmobts-calib/sysmobts-layer1.c \
-   contrib/sysmobts-calib/sysmobts-layer1.h \
doc/examples/sysmo/osmo-bts.cfg \
doc/examples/sysmo/sysmobts-mgr.cfg \
doc/examples/virtual/openbsc-virtual.cfg \
diff --git a/configure.ac b/configure.ac
index 89443d0..8604691 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,15 +54,32 @@
 PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 0.10.0)
 PKG_CHECK_MODULES(ORTP, ortp)
 
+AC_MSG_CHECKING([whether to enable support for sysmobts calibration tool])
+AC_ARG_ENABLE(sysmobts-calib,
+   AC_HELP_STRING([--enable-sysmobts-calib],
+   [enable code for sysmobts calibration tool 
[default=no]]),
+   [enable_sysmobts_calib="yes"],[enable_sysmobts_calib="no"])
+AC_MSG_RESULT([$enable_sysmobts_calib])
+AM_CONDITIONAL(ENABLE_SYSMOBTS_CALIB, test "x$enable_sysmobts_calib" = "xyes")
+
 AC_MSG_CHECKING([whether to enable support for sysmoBTS L1/PHY support])
 AC_ARG_ENABLE(sysmocom-bts,
AC_HELP_STRING([--enable-sysmocom-bts],
[enable code for sysmoBTS L1/PHY [default=no]]),
[enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"])
+AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], 
[Location of the sysmobts API header files])],
+
[sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"])
+AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir)
 AC_MSG_RESULT([$enable_sysmocom_bts])
 AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes")
 if test "$enable_sysmocom_bts" = "yes"; then
+   oldCPPFLAGS=$CPPFLAGS
+   CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include 
$LIBOSMOCORE_CFLAGS"
+   AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[],
+   [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not 
be found in $sysmobts_incdir])],
+   [#include ])
PKG_CHECK_MODULES(LIBGPS, libgps)
+   CPPFLAGS=$oldCPPFLAGS
 fi
 
 AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support])
@@ -179,6 +196,7 @@
 src/osmo-bts-octphy/Makefile
 include/Makefile
 include/osmo-bts/Makefile
+contrib/sysmobts-calib/Makefile
 tests/Makefile
 tests/paging/Makefile
 tests/agch/Makefile
diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh
index faeb7c9..f9d5bf6 100755
--- a/contrib/jenkins_sysmobts.sh
+++ b/contrib/jenkins_sysmobts.sh
@@ -16,13 +16,13 @@
 mkdir -p "$inst/include/sysmocom/femtobts"
 ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/"
 
-configure_flags="--enable-sysmocom-bts"
-
-build_bts "osmo-bts-sysmo" "$configure_flags"
+configure_flags="--with-sysmobts=$inst/include/ --enable-sysmocom-bts"
 
 # This will not work for the femtobts
 if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then
-  $MAKE -C contrib/sysmobts-calib
+$configure_flags="$configure_flags --enable-sysmobts-calib"
 fi
 
+build_bts "osmo-bts-sysmo" "$configure_flags"
+
 osmo-clean-workspace.sh
diff --git a/contrib/sysmobts-calib/Makefile b/contrib/sysmobts-calib/Makefile
deleted file mode 100644
index a5d4b99..000
--- a/contrib/sysmobts-calib/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-CFLAGS=`pkg-config 

[MERGED] osmo-msc[master]: Improve an error message in db_init().

2018-01-16 Thread Stefan Sperling
Stefan Sperling has submitted this change and it was merged.

Change subject: Improve an error message in db_init().
..


Improve an error message in db_init().

If we cannot open a connection to the sqlite3 database, show the name of the
database we failed to access, and also hint at the fact that a likely reason
for the problem is a missing sqlite3 driver for libdbi.

Change-Id: If1c0026e882984b4358ce116ec4a7ad40340517c
---
M src/libmsc/db.c
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/src/libmsc/db.c b/src/libmsc/db.c
index 28004f7..7007c7a 100644
--- a/src/libmsc/db.c
+++ b/src/libmsc/db.c
@@ -614,7 +614,8 @@
 
conn = dbi_conn_new_r("sqlite3", inst);
if (conn == NULL) {
-   LOGP(DDB, LOGL_FATAL, "Failed to create connection.\n");
+   LOGP(DDB, LOGL_FATAL, "Failed to create database connection to 
sqlite3 db '%s'; "
+   "Is the sqlite3 database driver for libdbi installed on 
this system?\n", name);
return 1;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If1c0026e882984b4358ce116ec4a7ad40340517c
Gerrit-PatchSet: 2
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Stefan Sperling 


[MERGED] osmo-bsc[master]: Show the BTS number for outgoing paging commands in debug log.

2018-01-16 Thread Stefan Sperling
Stefan Sperling has submitted this change and it was merged.

Change subject: Show the BTS number for outgoing paging commands in debug log.
..


Show the BTS number for outgoing paging commands in debug log.

Change-Id: I7b6e03087fc2dfecb6235c5ed1494d3c9b4bbf0e
---
M src/libbsc/paging.c
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/src/libbsc/paging.c b/src/libbsc/paging.c
index 314dfdd..be272f5 100644
--- a/src/libbsc/paging.c
+++ b/src/libbsc/paging.c
@@ -86,8 +86,8 @@
 
log_set_context(LOG_CTX_BSC_SUBSCR, request->bsub);
 
-   LOGP(DPAG, LOGL_INFO, "Going to send paging commands: imsi: %s tmsi: "
-"0x%08x for ch. type %d (attempt %d)\n", request->bsub->imsi,
+   LOGP(DPAG, LOGL_INFO, "(bts=%d) Going to send paging commands: imsi: %s 
tmsi: "
+"0x%08x for ch. type %d (attempt %d)\n", bts->nr, 
request->bsub->imsi,
 request->bsub->tmsi, request->chan_type, request->attempts);
 
if (request->bsub->tmsi == GSM_RESERVED_TMSI)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7b6e03087fc2dfecb6235c5ed1494d3c9b4bbf0e
Gerrit-PatchSet: 5
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Stefan Sperling 


[MERGED] osmo-bsc[master]: Implement support for paging based on LAC and CI.

2018-01-16 Thread Stefan Sperling
Stefan Sperling has submitted this change and it was merged.

Change subject: Implement support for paging based on LAC and CI.
..


Implement support for paging based on LAC and CI.

This is a simple combination of the LAC and CI cases which have
already been implemented.

The BSC_Tests.TC_paging_imsi_nochan_lac_ci ttcn3 test passes.

The switch statement in bssmap_handle_paging() is getting a bit large,
and scoping of local variables could be improved. I will focus on
cleaning this up later once paging functionality is complete.

Change-Id: If7f596663a97a1db1a00f115a366f4a5a271c127
Depends: Id83f8b3b1ce80a39417176d99fd09f3b394fd19c
Related: OS#2752
---
M src/osmo-bsc/osmo_bsc_bssap.c
1 file changed, 24 insertions(+), 0 deletions(-)

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



diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 04541c2..1894561 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -395,6 +395,30 @@
}
}
 
+   case CELL_IDENT_LAC_AND_CI: {
+   uint16_t ci, *ci_be;
+   lacp_be = (uint16_t *)([1]);
+   ci_be = (uint16_t *)([3]);
+   while (remain >= sizeof(*lacp_be) + sizeof(*ci_be)) {
+   lac = osmo_load16be(lacp_be);
+   ci = osmo_load16be(ci_be);
+
+   llist_for_each_entry(bts, >network->bts_list, 
list) {
+   if (bts->location_area_code != lac)
+   continue;
+   if (bts->cell_identity != ci)
+   continue;
+   if (page_subscriber(msc, bts, tmsi, lac, 
mi_string, chan_needed) < 0)
+   break;
+   }
+
+   remain -= sizeof(*lacp_be) + sizeof(*ci_be);
+   lacp_be++;
+   ci_be++;
+   }
+   break;
+   }
+
case CELL_IDENT_CI: {
uint16_t *ci_be = (uint16_t *)([1]);
while (remain >= sizeof(*ci_be)) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If7f596663a97a1db1a00f115a366f4a5a271c127
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Stefan Sperling 


[MERGED] osmo-bsc[master]: Implement support for paging based on a Cell Global Identifier.

2018-01-16 Thread Stefan Sperling
Stefan Sperling has submitted this change and it was merged.

Change subject: Implement support for paging based on a Cell Global Identifier.
..


Implement support for paging based on a Cell Global Identifier.

This is essentially a case which combines paging by LAI and CI.

Depends: Ic1c72c7f83e53988eb9fedf314b1dc459836833d
Change-Id: Id83f8b3b1ce80a39417176d99fd09f3b394fd19c
Related: OS#2751
---
M src/osmo-bsc/osmo_bsc_bssap.c
1 file changed, 50 insertions(+), 7 deletions(-)

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



diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index e3a30f5..04541c2 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -260,6 +260,19 @@
return ret;
 }
 
+/* Decode 5-byte LAI list element data (see TS 08.08 3.2.2.27) into 
MCC/MNC/LAC.
+ * Return 0 if successful, negative on error. */
+static int
+decode_lai(const uint8_t *data, uint16_t *mcc, uint16_t *mnc, uint16_t *lac)
+{
+   struct gsm48_loc_area_id lai;
+
+   /* Copy data to stack to prevent unaligned access in 
gsm48_decode_lai(). */
+   memcpy(, data, sizeof(lai)); /* don't byte swap yet */
+
+   return gsm48_decode_lai(, mcc, mnc, lac) != 0 ? -1 : 0;
+}
+
 /* GSM 08.08 § 3.2.1.19 */
 static int bssmap_handle_paging(struct bsc_msc_data *msc,
struct msgb *msg, unsigned int payload_length)
@@ -348,6 +361,40 @@
LOGP(DMSC, LOGL_NOTICE, "Ignoring no-op paging request for IMSI 
%s\n", mi_string);
return 0; /* nothing to do */
 
+   case CELL_IDENT_WHOLE_GLOBAL: {
+   uint16_t ci;
+   int i = 0;
+   while (remain >= sizeof(struct gsm48_loc_area_id) + sizeof(ci)) 
{
+   uint16_t *ci_be;
+   size_t lai_offset = 1 + i * (sizeof(struct 
gsm48_loc_area_id) + sizeof(ci));
+   if (decode_lai([lai_offset], , , ) != 
0) {
+   LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid 
LAI in Cell Identifier List "
+"for BSS (0x%x), paging entire BSS anyway 
(%s)\n",
+mi_string, CELL_IDENT_BSS, 
osmo_hexdump(data, data_length));
+   lac = GSM_LAC_RESERVED_ALL_BTS;
+   break;
+   }
+   ci_be = (uint16_t *)([lai_offset + sizeof(struct 
gsm48_loc_area_id)]);
+   ci = osmo_load16be(ci_be);
+   if (mcc == msc->network->country_code && mnc == 
msc->network->network_code) {
+   llist_for_each_entry(bts, 
>network->bts_list, list) {
+   if (bts->location_area_code != lac)
+   continue;
+   if (bts->cell_identity != ci)
+   continue;
+   if (page_subscriber(msc, bts, tmsi, 
lac, mi_string, chan_needed) < 0)
+   break;
+   }
+   } else {
+   LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: 
MCC/MNC in Cell Identifier List "
+"(%d/%d) do not match our network 
(%d/%d)\n", mi_string, mcc, mnc,
+msc->network->country_code, 
msc->network->network_code);
+   }
+   remain -= sizeof(struct gsm48_loc_area_id) + sizeof(ci);
+   i++;
+   }
+   }
+
case CELL_IDENT_CI: {
uint16_t *ci_be = (uint16_t *)([1]);
while (remain >= sizeof(*ci_be)) {
@@ -372,13 +419,9 @@
}
 
case CELL_IDENT_LAI_AND_LAC: {
-   struct gsm48_loc_area_id lai;
int i = 0;
-   while (remain >= sizeof(lai)) {
-   /* Parse and decode 5-byte LAI list element (see TS 
08.08 3.2.2.27).
-* Copy data to stack to prevent unaligned access in 
gsm48_decode_lai(). */
-   memcpy(, [1 + i * sizeof(lai)], sizeof(lai)); 
/* don't byte swap yet */
-   if (gsm48_decode_lai(, , , ) != 0) {
+   while (remain >= sizeof(struct gsm48_loc_area_id)) {
+   if (decode_lai([1 + i * sizeof(struct 
gsm48_loc_area_id)], , , ) != 0) {
LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid 
LAI in Cell Identifier List "
 "for BSS (0x%x), paging entire BSS anyway 
(%s)\n",
 mi_string, CELL_IDENT_BSS, 
osmo_hexdump(data, data_length));
@@ -397,7 +440,7 @@
  

[MERGED] osmo-bsc[master]: Move BTS selection for paging from osmo_bsc_grace.c into osm...

2018-01-16 Thread Stefan Sperling
Stefan Sperling has submitted this change and it was merged.

Change subject: Move BTS selection for paging from osmo_bsc_grace.c into 
osmo_bsc_bssap.c.
..


Move BTS selection for paging from osmo_bsc_grace.c into osmo_bsc_bssap.c.

We can now either page an invidual BTS directly or page several BTS in a
given location area. This decision is taken based on the contents of the
cell identifier list in the paging request. Select a set of BTS for paging
while processing the cell identifier list, rather than requiring the
paging layer to loop over all BTS in the MSC.

This change requires some adjustment in bssap_test. In particular,
this test must now add a BTS to its network in order to pass.

The purpose of this change is to make the layering a bit cleaner.
There is one functional change: We no longer abort paging if paging fails
for a particular BTS. Instead, we keep trying to page on other BTS.

Change-Id: Ic1c72c7f83e53988eb9fedf314b1dc459836833d
Suggested-by: Harald Welte
Depends: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d
Related: OS#2753
---
M include/osmocom/bsc/paging.h
M src/osmo-bsc/osmo_bsc_bssap.c
M src/osmo-bsc/osmo_bsc_grace.c
M tests/bssap/bssap_test.c
M tests/bssap/bssap_test.err
5 files changed, 54 insertions(+), 75 deletions(-)

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



diff --git a/include/osmocom/bsc/paging.h b/include/osmocom/bsc/paging.h
index 2b1bc50..2be71c3 100644
--- a/include/osmocom/bsc/paging.h
+++ b/include/osmocom/bsc/paging.h
@@ -56,8 +56,6 @@
 };
 
 /* schedule paging request */
-int paging_request(struct gsm_network *network, struct bsc_subscr *bsub, int 
type,
-  struct bsc_msc_data *msc);
 int paging_request_bts(struct gsm_bts *bts, struct bsc_subscr *bsub, int type,
struct bsc_msc_data *msc);
 
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index a02ea9e..e3a30f5 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -228,14 +228,16 @@
return 0;
 }
 
-/* Page a subscriber based on TMSI and LAC in the specified MSC.
- * If BTS is not NULL, page the subscriber via this particular BTS.
- * A non-zero return value indicates a fatal out of memory condition. */
+/* Page a subscriber based on TMSI and LAC via the specified BTS.
+ * The msc parameter is the MSC which issued the corresponding paging request.
+ * Returns 1 if the paging request could be issued, 0 if not.
+ * A negative return value indicates an error. */
 static int
 page_subscriber(struct bsc_msc_data *msc, struct gsm_bts *bts,
 uint32_t tmsi, uint32_t lac, const char *mi_string, uint8_t chan_needed)
 {
struct bsc_subscr *subscr;
+   int ret;
 
subscr = 
bsc_subscr_find_or_create_by_imsi(msc->network->bsc_subscribers,
   mi_string);
@@ -247,19 +249,15 @@
subscr->lac = lac;
subscr->tmsi = tmsi;
 
-   if (bts)
-   LOGP(DMSC, LOGL_INFO, "Paging request from MSC BTS: %d IMSI: 
'%s' TMSI: '0x%x/%u' LAC: 0x%x\n",
-   bts->nr, mi_string, tmsi, tmsi, lac);
-   else
-   LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: 
'0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac);
+   LOGP(DMSC, LOGL_INFO, "Paging request from MSC BTS: %d IMSI: '%s' TMSI: 
'0x%x/%u' LAC: 0x%x\n",
+   bts->nr, mi_string, tmsi, tmsi, lac);
 
-   bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy,
-subscr, chan_needed, msc, bts);
+   ret = bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, 
subscr, chan_needed, msc, bts);
 
/* the paging code has grabbed its own references */
bsc_subscr_put(subscr);
 
-   return 0;
+   return ret;
 }
 
 /* GSM 08.08 § 3.2.1.19 */
@@ -277,6 +275,7 @@
const uint8_t *data;
uint8_t chan_needed = RSL_CHANNEED_ANY;
uint8_t cell_ident;
+   struct gsm_bts *bts;
 
tlv_parse(, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 
0, 0);
remain = payload_length - 1;
@@ -353,7 +352,6 @@
uint16_t *ci_be = (uint16_t *)([1]);
while (remain >= sizeof(*ci_be)) {
uint16_t ci = osmo_load16be(ci_be);
-   struct gsm_bts *bts;
 
llist_for_each_entry(bts, >network->bts_list, 
list) {
if (bts->cell_identity == ci)
@@ -361,11 +359,12 @@
}
 
if (bts) {
-   if (page_subscriber(msc, bts, tmsi, lac, 
mi_string, chan_needed) != 0)
-   break;
-   } else
+   /* ignore errors from page_subscriber(); keep 
trying other BTS */
+   

[MERGED] osmo-msc[master]: fix build: missing LIBOSMORANAP flags in libmsc

2018-01-16 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: fix build: missing LIBOSMORANAP flags in libmsc
..


fix build: missing LIBOSMORANAP flags in libmsc

Change-Id: I2f498a2d008571d3eb8753bede0847fa7ab704ed
---
M src/libmsc/Makefile.am
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am
index 7dfb047..3ff97a3 100644
--- a/src/libmsc/Makefile.am
+++ b/src/libmsc/Makefile.am
@@ -15,6 +15,7 @@
$(LIBOSMOSIGTRAN_CFLAGS) \
$(LIBOSMOSCCP_CFLAGS) \
$(LIBOSMOMGCPCLIENT_CFLAGS) \
+   $(LIBOSMORANAP_CFLAGS) \
$(NULL)
 
 noinst_HEADERS = \

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2f498a2d008571d3eb8753bede0847fa7ab704ed
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[MERGED] osmo-sgsn[master]: fix build: missing LIBGTP_CFLAGS in sgsn_test

2018-01-16 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: fix build: missing LIBGTP_CFLAGS in sgsn_test
..


fix build: missing LIBGTP_CFLAGS in sgsn_test

Change-Id: I250cadecaf90238df1afa6997e5d165fb9eee8b6
---
M tests/sgsn/Makefile.am
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am
index 802811d..8692fc3 100644
--- a/tests/sgsn/Makefile.am
+++ b/tests/sgsn/Makefile.am
@@ -10,6 +10,7 @@
$(LIBOSMOABIS_CFLAGS) \
$(LIBOSMOGSM_CFLAGS) \
$(LIBCARES_CFLAGS) \
+   $(LIBGTP_CFLAGS) \
$(NULL)
 if BUILD_IU
 AM_CFLAGS += \

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I250cadecaf90238df1afa6997e5d165fb9eee8b6
Gerrit-PatchSet: 1
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


osmo-sgsn[master]: fix build: missing LIBGTP_CFLAGS in sgsn_test

2018-01-16 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

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

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


osmo-msc[master]: fix build: missing LIBOSMORANAP flags in libmsc

2018-01-16 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

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

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


[PATCH] osmo-bts[master]: Fix test dependencies

2018-01-16 Thread Max
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5818

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

Fix test dependencies

The stow-enabled jenkins builds are currently failing like below:

In file included from ../../include/osmo-bts/gsm_data.h:136:0,
 from ../../include/osmo-bts/bts.h:4,
 from misc_test.c:23:
../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: 
osmocom/abis/e1_input.h: No such file or directory
 #include 

Let's make sure that tests have all required CFLAGS/LIBS to build by
allowing to specify sysmobts headers location explicitly similar to
other BTS models. To propagate dependencies properly, sysmobts-calib was
converted to automake.

Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac
---
M Makefile.am
M configure.ac
M contrib/jenkins_sysmobts.sh
D contrib/sysmobts-calib/Makefile
A contrib/sysmobts-calib/Makefile.am
M src/osmo-bts-sysmo/Makefile.am
M tests/misc/Makefile.am
M tests/sysmobts/Makefile.am
8 files changed, 25 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/5818/5

diff --git a/Makefile.am b/Makefile.am
index 4832c84..322de36 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,16 +1,12 @@
 AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6
 
-SUBDIRS = include src tests
+SUBDIRS = include src tests contrib/sysmobts-calib
 
 
 # package the contrib and doc
 EXTRA_DIST = \
contrib/dump_docs.py contrib/screenrc-l1fwd 
contrib/osmo-bts-sysmo.service \
contrib/l1fwd.init contrib/screenrc-sysmobts contrib/respawn.sh \
-   contrib/sysmobts.init contrib/sysmobts-calib/Makefile \
-   contrib/sysmobts-calib/sysmobts-calib.c \
-   contrib/sysmobts-calib/sysmobts-layer1.c \
-   contrib/sysmobts-calib/sysmobts-layer1.h \
doc/examples/sysmo/osmo-bts.cfg \
doc/examples/sysmo/sysmobts-mgr.cfg \
doc/examples/virtual/openbsc-virtual.cfg \
diff --git a/configure.ac b/configure.ac
index 89443d0..616d3b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,10 +59,19 @@
AC_HELP_STRING([--enable-sysmocom-bts],
[enable code for sysmoBTS L1/PHY [default=no]]),
[enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"])
+AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], 
[Location of the sysmobts API header files])],
+
[sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"])
+AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir)
 AC_MSG_RESULT([$enable_sysmocom_bts])
 AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes")
 if test "$enable_sysmocom_bts" = "yes"; then
+   oldCPPFLAGS=$CPPFLAGS
+   CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include 
$LIBOSMOCORE_CFLAGS"
+   AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[],
+   [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not 
be found in $sysmobts_incdir])],
+   [#include ])
PKG_CHECK_MODULES(LIBGPS, libgps)
+   CPPFLAGS=$oldCPPFLAGS
 fi
 
 AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support])
@@ -179,6 +188,7 @@
 src/osmo-bts-octphy/Makefile
 include/Makefile
 include/osmo-bts/Makefile
+contrib/sysmobts-calib/Makefile
 tests/Makefile
 tests/paging/Makefile
 tests/agch/Makefile
diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh
index faeb7c9..f4f5da2 100755
--- a/contrib/jenkins_sysmobts.sh
+++ b/contrib/jenkins_sysmobts.sh
@@ -16,7 +16,7 @@
 mkdir -p "$inst/include/sysmocom/femtobts"
 ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/"
 
-configure_flags="--enable-sysmocom-bts"
+configure_flags="--with-sysmobts=$inst/include/ --enable-sysmocom-bts"
 
 build_bts "osmo-bts-sysmo" "$configure_flags"
 
diff --git a/contrib/sysmobts-calib/Makefile b/contrib/sysmobts-calib/Makefile
deleted file mode 100644
index a5d4b99..000
--- a/contrib/sysmobts-calib/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-CFLAGS=`pkg-config --cflags libosmocore` -Wall -Werror
-LIBS=`pkg-config --libs libosmocore libosmogsm`
-
-all: sysmobts-calib
-
-sysmobts-calib: sysmobts-calib.o sysmobts-layer1.o
-   $(CC) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ -lrt $(LIBS)
-
-clean:
-   @rm -f sysmobts-calib *.o
diff --git a/contrib/sysmobts-calib/Makefile.am 
b/contrib/sysmobts-calib/Makefile.am
new file mode 100644
index 000..26275ab
--- /dev/null
+++ b/contrib/sysmobts-calib/Makefile.am
@@ -0,0 +1,9 @@
+AM_CPPFLAGS = $(all_includes) -I$(SYSMOBTS_INCDIR)
+AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS)
+LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS)
+
+noinst_PROGRAMS = sysmobts-calib
+noinst_HEADERS = sysmobts-layer1.h
+
+sysmobts_calib_test_SOURCES = sysmobts-calib.c sysmobts-layer1.c
+sysmobts_calib_test_LDADD = -lrt
diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am
index 

[PATCH] osmo-pcu[master]: Allow specifying sysmocom headers explicitly

2018-01-16 Thread Max
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/5796

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

Allow specifying sysmocom headers explicitly

The headers for LC1.5 are specified explicitly. Add corresponding option
to specify sysmoBTS headers location and use it in jenkins build. While
at it, unify header fixup code with the one used in OsmoBTS.

Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462
---
M configure.ac
M contrib/jenkins.sh
M src/Makefile.am
3 files changed, 15 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/96/5796/7

diff --git a/configure.ac b/configure.ac
index 56e2057..3706b6c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,8 +65,19 @@
AC_HELP_STRING([--enable-sysmocom-dsp],
[enable code for sysmocom DSP [default=no]]),
[enable_sysmocom_dsp="$enableval"],[enable_sysmocom_dsp="no"])
+AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], 
[Location of the sysmobts API header files])],
+
[sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"])
+AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir)
 AC_MSG_RESULT([$enable_sysmocom_dsp])
 AM_CONDITIONAL(ENABLE_SYSMODSP, test "x$enable_sysmocom_dsp" = "xyes")
+if test "$enable_sysmocom_bts" = "yes"; then
+   oldCPPFLAGS=$CPPFLAGS
+   CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include 
$LIBOSMOCORE_CFLAGS"
+   AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[],
+   [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not 
be found in $sysmobts_incdir])],
+   [#include ])
+   CPPFLAGS=$oldCPPFLAGS
+fi
 
 AC_MSG_CHECKING([whether to enable direct PHY access for PDCH of NuRAN 
Wireless Litecell 1.5 BTS])
 AC_ARG_ENABLE(lc15bts-phy,
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index b7cfc3d..af25c69 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -26,15 +26,13 @@
 # Collect configure options for osmo-pcu
 PCU_CONFIG=""
 if [ "$with_dsp" = sysmo ]; then
-  PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp"
+  PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp --with-sysmobts=$inst/include/"
 
   # For direct sysmo DSP access, provide the SysmoBTS Layer 1 API
   cd "$deps"
   osmo-layer1-headers.sh sysmo
-  cd layer1-headers
-  api_incl="$inst/include/sysmocom/femtobts/"
-  mkdir -p "$api_incl"
-  cp include/*.h "$api_incl"
+  mkdir -p "$inst/include/sysmocom/femtobts"
+  ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/"
   cd "$base"
 
 elif [ "$with_dsp" = lc15 ]; then
diff --git a/src/Makefile.am b/src/Makefile.am
index a6e98e5..7d2a62e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -103,7 +103,7 @@
 osmo_pcu_SOURCES = pcu_main.cpp
 
 if ENABLE_SYSMODSP
-AM_CPPFLAGS += -I$(srcdir)/osmo-bts-sysmo
+AM_CPPFLAGS += -I$(srcdir)/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR)
 
 EXTRA_DIST = \
osmo-bts-sysmo/sysmo_l1_if.c \

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462
Gerrit-PatchSet: 7
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmo-sgsn[master]: fix build: missing LIBGTP_CFLAGS in sgsn_test

2018-01-16 Thread Neels Hofmeyr

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

fix build: missing LIBGTP_CFLAGS in sgsn_test

Change-Id: I250cadecaf90238df1afa6997e5d165fb9eee8b6
---
M tests/sgsn/Makefile.am
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am
index 802811d..8692fc3 100644
--- a/tests/sgsn/Makefile.am
+++ b/tests/sgsn/Makefile.am
@@ -10,6 +10,7 @@
$(LIBOSMOABIS_CFLAGS) \
$(LIBOSMOGSM_CFLAGS) \
$(LIBCARES_CFLAGS) \
+   $(LIBGTP_CFLAGS) \
$(NULL)
 if BUILD_IU
 AM_CFLAGS += \

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

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


[PATCH] osmo-msc[master]: fix build: missing LIBOSMORANAP flags in libmsc

2018-01-16 Thread Neels Hofmeyr

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

fix build: missing LIBOSMORANAP flags in libmsc

Change-Id: I2f498a2d008571d3eb8753bede0847fa7ab704ed
---
M src/libmsc/Makefile.am
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am
index 7dfb047..3ff97a3 100644
--- a/src/libmsc/Makefile.am
+++ b/src/libmsc/Makefile.am
@@ -15,6 +15,7 @@
$(LIBOSMOSIGTRAN_CFLAGS) \
$(LIBOSMOSCCP_CFLAGS) \
$(LIBOSMOMGCPCLIENT_CFLAGS) \
+   $(LIBOSMORANAP_CFLAGS) \
$(NULL)
 
 noinst_HEADERS = \

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

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


[PATCH] osmo-pcu[master]: Allow specifying sysmocom headers explicitly

2018-01-16 Thread Max
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/5796

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

Allow specifying sysmocom headers explicitly

The headers for LC1.5 are specified explicitly. Add corresponding option
to specify sysmoBTS headers location and use it in jenkins build. While
at it, unify header fixup code with the one used in OsmoBTS.

Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462
---
M configure.ac
M contrib/jenkins.sh
M src/Makefile.am
3 files changed, 17 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/96/5796/6

diff --git a/configure.ac b/configure.ac
index 56e2057..84502d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,8 +65,19 @@
AC_HELP_STRING([--enable-sysmocom-dsp],
[enable code for sysmocom DSP [default=no]]),
[enable_sysmocom_dsp="$enableval"],[enable_sysmocom_dsp="no"])
-AC_MSG_RESULT([$enable_sysmocom_dsp])
-AM_CONDITIONAL(ENABLE_SYSMODSP, test "x$enable_sysmocom_dsp" = "xyes")
+AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], 
[Location of the sysmobts API header files])],
+
[sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"])
+AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir)
+AC_MSG_RESULT([$enable_sysmocom_bts])
+AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes")
+if test "$enable_sysmocom_bts" = "yes"; then
+   oldCPPFLAGS=$CPPFLAGS
+   CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include 
$LIBOSMOCORE_CFLAGS"
+   AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[],
+   [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not 
be found in $sysmobts_incdir])],
+   [#include ])
+   CPPFLAGS=$oldCPPFLAGS
+fi
 
 AC_MSG_CHECKING([whether to enable direct PHY access for PDCH of NuRAN 
Wireless Litecell 1.5 BTS])
 AC_ARG_ENABLE(lc15bts-phy,
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index b7cfc3d..af25c69 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -26,15 +26,13 @@
 # Collect configure options for osmo-pcu
 PCU_CONFIG=""
 if [ "$with_dsp" = sysmo ]; then
-  PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp"
+  PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp --with-sysmobts=$inst/include/"
 
   # For direct sysmo DSP access, provide the SysmoBTS Layer 1 API
   cd "$deps"
   osmo-layer1-headers.sh sysmo
-  cd layer1-headers
-  api_incl="$inst/include/sysmocom/femtobts/"
-  mkdir -p "$api_incl"
-  cp include/*.h "$api_incl"
+  mkdir -p "$inst/include/sysmocom/femtobts"
+  ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/"
   cd "$base"
 
 elif [ "$with_dsp" = lc15 ]; then
diff --git a/src/Makefile.am b/src/Makefile.am
index a6e98e5..7d2a62e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -103,7 +103,7 @@
 osmo_pcu_SOURCES = pcu_main.cpp
 
 if ENABLE_SYSMODSP
-AM_CPPFLAGS += -I$(srcdir)/osmo-bts-sysmo
+AM_CPPFLAGS += -I$(srcdir)/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR)
 
 EXTRA_DIST = \
osmo-bts-sysmo/sysmo_l1_if.c \

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462
Gerrit-PatchSet: 6
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmo-bts[master]: jenkins_common.sh: fix build_bts distcheck for more than one...

2018-01-16 Thread Neels Hofmeyr

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

jenkins_common.sh: fix build_bts distcheck for more than one conf_flag

Passing configure flags in DISTCHECK_CONFIGURE_FLAGS requires enclosing all
flags in quotes. Currently we seem to have no callers with more than one
configure flag, so we were lucky not to break there.

Change-Id: I37bc517a30d00c744eddc8565a0a8181cb3b2cdb
---
M contrib/jenkins_common.sh
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh
index cc1b5b3..bdb12d5 100644
--- a/contrib/jenkins_common.sh
+++ b/contrib/jenkins_common.sh
@@ -43,5 +43,5 @@
 ./configure $conf_flags
 $MAKE $PARALLEL_MAKE
 $MAKE check || cat-testlogs.sh
-DISTCHECK_CONFIGURE_FLAGS=$conf_flags $MAKE distcheck || cat-testlogs.sh
+DISTCHECK_CONFIGURE_FLAGS="$conf_flags" $MAKE distcheck || cat-testlogs.sh
 }

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

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


[PATCH] osmo-bts[master]: Fix test dependencies

2018-01-16 Thread Max
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5818

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

Fix test dependencies

The stow-enabled jenkins builds are currently failing like below:

In file included from ../../include/osmo-bts/gsm_data.h:136:0,
 from ../../include/osmo-bts/bts.h:4,
 from misc_test.c:23:
../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: 
osmocom/abis/e1_input.h: No such file or directory
 #include 

Let's make sure that tests have all required CFLAGS/LIBS to build by
allowing to specify sysmobts headers location explicitly similar to
other BTS models. To propagate dependencies properly, sysmobts-calib was
converted to automake.

Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac
---
M Makefile.am
M configure.ac
M contrib/jenkins_sysmobts.sh
A contrib/sysmobts-calib/Makefile.am
M src/osmo-bts-sysmo/Makefile.am
M tests/misc/Makefile.am
M tests/sysmobts/Makefile.am
7 files changed, 25 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/5818/4

diff --git a/Makefile.am b/Makefile.am
index 4832c84..347a89b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
 AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6
 
-SUBDIRS = include src tests
+SUBDIRS = include src tests contrib/sysmobts-calib
 
 
 # package the contrib and doc
diff --git a/configure.ac b/configure.ac
index 89443d0..616d3b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,10 +59,19 @@
AC_HELP_STRING([--enable-sysmocom-bts],
[enable code for sysmoBTS L1/PHY [default=no]]),
[enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"])
+AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], 
[Location of the sysmobts API header files])],
+
[sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"])
+AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir)
 AC_MSG_RESULT([$enable_sysmocom_bts])
 AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes")
 if test "$enable_sysmocom_bts" = "yes"; then
+   oldCPPFLAGS=$CPPFLAGS
+   CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include 
$LIBOSMOCORE_CFLAGS"
+   AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[],
+   [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not 
be found in $sysmobts_incdir])],
+   [#include ])
PKG_CHECK_MODULES(LIBGPS, libgps)
+   CPPFLAGS=$oldCPPFLAGS
 fi
 
 AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support])
@@ -179,6 +188,7 @@
 src/osmo-bts-octphy/Makefile
 include/Makefile
 include/osmo-bts/Makefile
+contrib/sysmobts-calib/Makefile
 tests/Makefile
 tests/paging/Makefile
 tests/agch/Makefile
diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh
index faeb7c9..f4f5da2 100755
--- a/contrib/jenkins_sysmobts.sh
+++ b/contrib/jenkins_sysmobts.sh
@@ -16,7 +16,7 @@
 mkdir -p "$inst/include/sysmocom/femtobts"
 ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/"
 
-configure_flags="--enable-sysmocom-bts"
+configure_flags="--with-sysmobts=$inst/include/ --enable-sysmocom-bts"
 
 build_bts "osmo-bts-sysmo" "$configure_flags"
 
diff --git a/contrib/sysmobts-calib/Makefile.am 
b/contrib/sysmobts-calib/Makefile.am
new file mode 100644
index 000..26275ab
--- /dev/null
+++ b/contrib/sysmobts-calib/Makefile.am
@@ -0,0 +1,9 @@
+AM_CPPFLAGS = $(all_includes) -I$(SYSMOBTS_INCDIR)
+AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS)
+LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS)
+
+noinst_PROGRAMS = sysmobts-calib
+noinst_HEADERS = sysmobts-layer1.h
+
+sysmobts_calib_test_SOURCES = sysmobts-calib.c sysmobts-layer1.c
+sysmobts_calib_test_LDADD = -lrt
diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am
index c48b77c..667ebdd 100644
--- a/src/osmo-bts-sysmo/Makefile.am
+++ b/src/osmo-bts-sysmo/Makefile.am
@@ -1,4 +1,4 @@
-AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
+AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR)
 AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) 
$(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) 
$(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) 
$(LIBGPS_CFLAGS) $(ORTP_CFLAGS)
 COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) 
$(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) 
$(ORTP_LIBS)
 
diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am
index 6575fe8..2ddb649 100644
--- a/tests/misc/Makefile.am
+++ b/tests/misc/Makefile.am
@@ -1,6 +1,6 @@
 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
-AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) 
$(LIBOSMOCODEC_CFLAGS)
-LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS)
+AM_CFLAGS = -Wall 

[MERGED] osmo-hlr[master]: fix build: db_test: missing LIBOSMOABIS_CFLAGS and _LIBS

2018-01-16 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: fix build: db_test: missing LIBOSMOABIS_CFLAGS and _LIBS
..


fix build: db_test: missing LIBOSMOABIS_CFLAGS and _LIBS

Change-Id: I2539f5dc7a512a57ad36c460a11195ccbd84d7d6
---
M tests/db/Makefile.am
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/tests/db/Makefile.am b/tests/db/Makefile.am
index 55b1655..d5fce65 100644
--- a/tests/db/Makefile.am
+++ b/tests/db/Makefile.am
@@ -6,6 +6,7 @@
-ggdb3 \
$(LIBOSMOCORE_CFLAGS) \
$(LIBOSMOGSM_CFLAGS) \
+   $(LIBOSMOABIS_CFLAGS) \
$(SQLITE3_CFLAGS) \
$(NULL)
 
@@ -27,6 +28,7 @@
$(top_srcdir)/src/logging.c \
$(LIBOSMOCORE_LIBS) \
$(LIBOSMOGSM_LIBS) \
+   $(LIBOSMOABIS_LIBS) \
$(SQLITE3_LIBS) \
$(NULL)
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2539f5dc7a512a57ad36c460a11195ccbd84d7d6
Gerrit-PatchSet: 1
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[PATCH] osmo-bts[master]: Fix test dependencies

2018-01-16 Thread Max
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5818

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

Fix test dependencies

The stow-enabled jenkins builds are currently failing like below:

In file included from ../../include/osmo-bts/gsm_data.h:136:0,
 from ../../include/osmo-bts/bts.h:4,
 from misc_test.c:23:
../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: 
osmocom/abis/e1_input.h: No such file or directory
 #include 

Let's make sure that tests have all required CFLAGS/LIBS to build by
allowing to specify sysmobts headers location explicitly similar to
other BTS models. To propagate dependencies properly, sysmobts-calib was
converted to automake.

Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac
---
M configure.ac
M contrib/jenkins_sysmobts.sh
A contrib/sysmobts-calib/Makefile.am
M src/osmo-bts-sysmo/Makefile.am
M tests/misc/Makefile.am
M tests/sysmobts/Makefile.am
6 files changed, 24 insertions(+), 5 deletions(-)


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

diff --git a/configure.ac b/configure.ac
index 89443d0..616d3b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,10 +59,19 @@
AC_HELP_STRING([--enable-sysmocom-bts],
[enable code for sysmoBTS L1/PHY [default=no]]),
[enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"])
+AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], 
[Location of the sysmobts API header files])],
+
[sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"])
+AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir)
 AC_MSG_RESULT([$enable_sysmocom_bts])
 AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes")
 if test "$enable_sysmocom_bts" = "yes"; then
+   oldCPPFLAGS=$CPPFLAGS
+   CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include 
$LIBOSMOCORE_CFLAGS"
+   AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[],
+   [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not 
be found in $sysmobts_incdir])],
+   [#include ])
PKG_CHECK_MODULES(LIBGPS, libgps)
+   CPPFLAGS=$oldCPPFLAGS
 fi
 
 AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support])
@@ -179,6 +188,7 @@
 src/osmo-bts-octphy/Makefile
 include/Makefile
 include/osmo-bts/Makefile
+contrib/sysmobts-calib/Makefile
 tests/Makefile
 tests/paging/Makefile
 tests/agch/Makefile
diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh
index faeb7c9..f4f5da2 100755
--- a/contrib/jenkins_sysmobts.sh
+++ b/contrib/jenkins_sysmobts.sh
@@ -16,7 +16,7 @@
 mkdir -p "$inst/include/sysmocom/femtobts"
 ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/"
 
-configure_flags="--enable-sysmocom-bts"
+configure_flags="--with-sysmobts=$inst/include/ --enable-sysmocom-bts"
 
 build_bts "osmo-bts-sysmo" "$configure_flags"
 
diff --git a/contrib/sysmobts-calib/Makefile.am 
b/contrib/sysmobts-calib/Makefile.am
new file mode 100644
index 000..26275ab
--- /dev/null
+++ b/contrib/sysmobts-calib/Makefile.am
@@ -0,0 +1,9 @@
+AM_CPPFLAGS = $(all_includes) -I$(SYSMOBTS_INCDIR)
+AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS)
+LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS)
+
+noinst_PROGRAMS = sysmobts-calib
+noinst_HEADERS = sysmobts-layer1.h
+
+sysmobts_calib_test_SOURCES = sysmobts-calib.c sysmobts-layer1.c
+sysmobts_calib_test_LDADD = -lrt
diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am
index c48b77c..667ebdd 100644
--- a/src/osmo-bts-sysmo/Makefile.am
+++ b/src/osmo-bts-sysmo/Makefile.am
@@ -1,4 +1,4 @@
-AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
+AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR)
 AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) 
$(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) 
$(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) 
$(LIBGPS_CFLAGS) $(ORTP_CFLAGS)
 COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) 
$(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) 
$(ORTP_LIBS)
 
diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am
index 6575fe8..2ddb649 100644
--- a/tests/misc/Makefile.am
+++ b/tests/misc/Makefile.am
@@ -1,6 +1,6 @@
 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
-AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) 
$(LIBOSMOCODEC_CFLAGS)
-LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS)
+AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) 
$(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS)
+LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) 
$(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS)
 noinst_PROGRAMS = misc_test
 EXTRA_DIST = misc_test.ok
 
diff --git 

osmo-hlr[master]: fix build: db_test: missing LIBOSMOABIS_CFLAGS and _LIBS

2018-01-16 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

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

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


libosmocore[master]: logging: separate the '<000b>' subsys from filename logging

2018-01-16 Thread Neels Hofmeyr

Patch Set 1:

I would gladly separate the hex category out to its own logging config api, the 
only reason why I'm continuing to tie it with the filename is backwards compat. 
If you agree that we completely untie it from the filename (and that changing 
the logging API behavior is acceptable) I'll change the patches.

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

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


osmo-trx[master]: tests: convolve: Disable due to difference in output in diff...

2018-01-16 Thread Alexander Chemeris

Patch Set 1:

I think you should send an e-mail to the mailing list, as not everyone is 
reading Gerrit. I've stumbled upon this patch completely accidentally and I 
haven't seen any discussions.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I2320309bc8c1c20e2de6ef2e0f17472c68de80cb
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: ttsou 
Gerrit-HasComments: No


[ABANDON] osmo-bts[master]: Allow specifying sysmocom headers explicitly

2018-01-16 Thread Max
Max has abandoned this change.

Change subject: Allow specifying sysmocom headers explicitly
..


Abandoned

Merged into previous commit.

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ibe4e9965ce887b82c3aa32e0bb0fc5cc6a527112
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmo-bts[master]: Allow specifying sysmocom headers explicitly

2018-01-16 Thread Max

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

Allow specifying sysmocom headers explicitly

The headers for other models are specified explicitly. Add corresponding
option to specify sysmoBTS headers location and use it in jenkins
build. This fixes the issue after moving to stow for jenkins tests.

Change-Id: Ibe4e9965ce887b82c3aa32e0bb0fc5cc6a527112
---
M configure.ac
M contrib/jenkins_sysmobts.sh
M src/osmo-bts-sysmo/Makefile.am
3 files changed, 11 insertions(+), 2 deletions(-)


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

diff --git a/configure.ac b/configure.ac
index 89443d0..6c571d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,10 +59,19 @@
AC_HELP_STRING([--enable-sysmocom-bts],
[enable code for sysmoBTS L1/PHY [default=no]]),
[enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"])
+AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], 
[Location of the sysmobts API header files])],
+
[sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"])
+AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir)
 AC_MSG_RESULT([$enable_sysmocom_bts])
 AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes")
 if test "$enable_sysmocom_bts" = "yes"; then
+   oldCPPFLAGS=$CPPFLAGS
+   CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include 
$LIBOSMOCORE_CFLAGS"
+   AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[],
+   [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not 
be found in $sysmobts_incdir])],
+   [#include ])
PKG_CHECK_MODULES(LIBGPS, libgps)
+   CPPFLAGS=$oldCPPFLAGS
 fi
 
 AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support])
diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh
index faeb7c9..f4f5da2 100755
--- a/contrib/jenkins_sysmobts.sh
+++ b/contrib/jenkins_sysmobts.sh
@@ -16,7 +16,7 @@
 mkdir -p "$inst/include/sysmocom/femtobts"
 ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/"
 
-configure_flags="--enable-sysmocom-bts"
+configure_flags="--with-sysmobts=$inst/include/ --enable-sysmocom-bts"
 
 build_bts "osmo-bts-sysmo" "$configure_flags"
 
diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am
index c48b77c..667ebdd 100644
--- a/src/osmo-bts-sysmo/Makefile.am
+++ b/src/osmo-bts-sysmo/Makefile.am
@@ -1,4 +1,4 @@
-AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
+AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR)
 AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) 
$(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) 
$(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) 
$(LIBGPS_CFLAGS) $(ORTP_CFLAGS)
 COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) 
$(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) 
$(ORTP_LIBS)
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe4e9965ce887b82c3aa32e0bb0fc5cc6a527112
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 


osmo-trx[master]: Remove unneeded libdl dependency

2018-01-16 Thread Alexander Chemeris

Patch Set 1: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0caea2a2a8e6bd07432fd73bae72b42b1ce022cd
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-trx[master]: tests: convolve: Disable due to difference in output in diff...

2018-01-16 Thread Alexander Chemeris

Patch Set 1: Code-Review-1

I don't think to disable it is a good idea. Why not improve it? I think Thomas 
Tsou and/or Vadim had suggestions how to do that.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I2320309bc8c1c20e2de6ef2e0f17472c68de80cb
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] osmo-trx[master]: Remove unneeded libdl dependency

2018-01-16 Thread Pau Espin Pedrol

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

Remove unneeded libdl dependency

Closes: OS#1929

Change-Id: I0caea2a2a8e6bd07432fd73bae72b42b1ce022cd
---
M CommonLibs/Makefile.am
M Makefile.am
M Transceiver52M/Makefile.am
3 files changed, 5 insertions(+), 5 deletions(-)


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

diff --git a/CommonLibs/Makefile.am b/CommonLibs/Makefile.am
index 46cc143..fa0b285 100644
--- a/CommonLibs/Makefile.am
+++ b/CommonLibs/Makefile.am
@@ -22,7 +22,7 @@
 include $(top_srcdir)/Makefile.common
 
 AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES)
-AM_CXXFLAGS = -Wall -O3 -g -ldl -lpthread
+AM_CXXFLAGS = -Wall -O3 -g -lpthread
 
 EXTRA_DIST = \
example.config \
diff --git a/Makefile.am b/Makefile.am
index 1e659a0..71f7b91 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,9 +22,9 @@
 
 ACLOCAL_AMFLAGS = -I config
 AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(USB_INCLUDES) $(WITH_INCLUDES)
-AM_CXXFLAGS = -Wall -pthread -ldl
-#AM_CXXFLAGS = -Wall -O2 -NDEBUG -pthread -ldl
-#AM_CFLAGS = -Wall -O2 -NDEBUG -pthread -ldl
+AM_CXXFLAGS = -Wall -pthread
+#AM_CXXFLAGS = -Wall -O2 -NDEBUG -pthread
+#AM_CFLAGS = -Wall -O2 -NDEBUG -pthread
 
 # Order must be preserved
 SUBDIRS = \
diff --git a/Transceiver52M/Makefile.am b/Transceiver52M/Makefile.am
index 8df2d34..f56ce06 100644
--- a/Transceiver52M/Makefile.am
+++ b/Transceiver52M/Makefile.am
@@ -22,7 +22,7 @@
 include $(top_srcdir)/Makefile.common
 
 AM_CPPFLAGS = -Wall $(STD_DEFINES_AND_INCLUDES) -I${srcdir}/common
-AM_CXXFLAGS = -ldl -lpthread
+AM_CXXFLAGS = -lpthread
 
 SUBDIRS = arm x86
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0caea2a2a8e6bd07432fd73bae72b42b1ce022cd
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


libosmocore[master]: cosmetic: logging: if color is disabled, don't print ""

2018-01-16 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


libosmocore[master]: logging: allow adding separators to the extended-timestamp

2018-01-16 Thread Harald Welte

Patch Set 1:

(1 comment)

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

Line 17: log_set_print_extended_timestamp(). Passing 1 still produces the 
unseparated
please introduce some meaningful enum in addition to the magic numbers


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

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


libosmocore[master]: logging: vty: add 'logging print file (0|1|with-cat)' cmd

2018-01-16 Thread Harald Welte

Patch Set 1:

(1 comment)

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

Line 7: logging: vty: add 'logging print file (0|1|with-cat)' cmd
why does the category related to the file name?


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

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


libosmocore[master]: logging: separate the '<000b>' subsys from filename logging

2018-01-16 Thread Harald Welte

Patch Set 1: Code-Review-1

I think the feature is useful.  By the way, the "Weird" format with <> comes 
from syslog, AFAIR.  However, what I don't like is hiding it in a seemingly 
unrelated API that is about logging the file name.

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

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


libosmocore[master]: logging: color the log category according to level

2018-01-16 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-iuh[master]: hnbgw_rua: fix dereference of unset pointer

2018-01-16 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-iuh[master]: hnbgw_hnbap: fix missing return in rx [un]successful outcome

2018-01-16 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[MERGED] osmo-iuh[master]: hnbgw_cn: rx ranap: set rc in all cases

2018-01-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: hnbgw_cn: rx ranap: set rc in all cases
..


hnbgw_cn: rx ranap: set rc in all cases

There don't seem to be any evaluations of the rc, nevertheless return
well-defined values.

Fixes: CID#181968
Change-Id: I59295388564e5d270da32db6e7488755231f8a11
---
M src/hnbgw_cn.c
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c
index c48f4b7..ede00c8 100644
--- a/src/hnbgw_cn.c
+++ b/src/hnbgw_cn.c
@@ -19,6 +19,7 @@
  */
 
 #include 
+#include 
 
 #include 
 #include 
@@ -209,10 +210,12 @@
LOGP(DRANAP, LOGL_NOTICE, "Received unsupported RANAP "
 "unsuccessful outcome procedure %ld from CN, ignoring\n",
 pdu->choice.unsuccessfulOutcome.procedureCode);
+   rc = -ENOTSUP;
break;
default:
LOGP(DRANAP, LOGL_NOTICE, "Received suspicious RANAP "
 "presence %u from CN, ignoring\n", pdu->present);
+   rc = -EINVAL;
break;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I59295388564e5d270da32db6e7488755231f8a11
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-iuh[master]: hnbgw_hnbap: fix missing return in rx [un]successful outcome

2018-01-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: hnbgw_hnbap: fix missing return in rx [un]successful outcome
..


hnbgw_hnbap: fix missing return in rx [un]successful outcome

Fixes: CID#57732 CID#57733
Change-Id: Iddf76d23c2c7d5824e82708f7da013c88411e832
---
M src/hnbgw_hnbap.c
1 file changed, 4 insertions(+), 2 deletions(-)

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



diff --git a/src/hnbgw_hnbap.c b/src/hnbgw_hnbap.c
index 058a42a..fab520d 100644
--- a/src/hnbgw_hnbap.c
+++ b/src/hnbgw_hnbap.c
@@ -522,12 +522,14 @@
 
 static int hnbgw_rx_successful_outcome_msg(struct hnb_context *hnb, 
SuccessfulOutcome_t *msg)
 {
-
+   /* We don't care much about HNBAP */
+   return 0;
 }
 
 static int hnbgw_rx_unsuccessful_outcome_msg(struct hnb_context *hnb, 
UnsuccessfulOutcome_t *msg)
 {
-
+   /* We don't care much about HNBAP */
+   return 0;
 }
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iddf76d23c2c7d5824e82708f7da013c88411e832
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-iuh[master]: hnbgw_rua.c: log: fix integer format for cN_DomainIndicator

2018-01-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: hnbgw_rua.c: log: fix integer format for cN_DomainIndicator
..


hnbgw_rua.c: log: fix integer format for cN_DomainIndicator

Fixes: CID#135219
Change-Id: I32c11100c87a59f34d7c1fefd2f0037e5d63f0e0
---
M src/hnbgw_rua.c
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c
index b2b8792..e918c47 100644
--- a/src/hnbgw_rua.c
+++ b/src/hnbgw_rua.c
@@ -198,7 +198,7 @@
is_ps = true;
break;
default:
-   LOGP(DRUA, LOGL_ERROR, "Unsupported Domain %u\n",
+   LOGP(DRUA, LOGL_ERROR, "Unsupported Domain %ld\n",
 cN_DomainIndicator);
return -1;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I32c11100c87a59f34d7c1fefd2f0037e5d63f0e0
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-iuh[master]: hnbgw_cn: rx ranap: set rc in all cases

2018-01-16 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-iuh[master]: cosmetic: hnbgw: hnbap: log rx of unsuccessful outcome

2018-01-16 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[MERGED] osmo-iuh[master]: hnbgw_rua: fix dereference of unset pointer

2018-01-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: hnbgw_rua: fix dereference of unset pointer
..


hnbgw_rua: fix dereference of unset pointer

In the UNITDATA case, there is no map, so a) initialize map as NULL and b)
print the RUA ctx id directly from local var context_id instead.

Fixes: CID#181969
Change-Id: I73f508b719b61a389e10cbad1bafad1650634abe
---
M src/hnbgw_rua.c
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c
index e918c47..40d1d94 100644
--- a/src/hnbgw_rua.c
+++ b/src/hnbgw_rua.c
@@ -181,7 +181,7 @@
 {
struct msgb *msg;
struct osmo_scu_prim *prim;
-   struct hnbgw_context_map *map;
+   struct hnbgw_context_map *map = NULL;
struct hnbgw_cnlink *cn = hnb->gw->sccp.cnlink;
struct osmo_sccp_addr *remote_addr;
bool is_ps;
@@ -218,7 +218,7 @@
DEBUGP(DRUA, "rua_to_scu() %s to %s, rua_ctx_id %u (unitdata, 
no scu_conn_id)\n",
   cn_domain_indicator_to_str(cN_DomainIndicator),
   osmo_sccp_addr_dump(remote_addr),
-  map->rua_ctx_id);
+  context_id);
break;
default:
map = context_map_alloc_by_hnb(hnb, context_id, is_ps, cn);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I73f508b719b61a389e10cbad1bafad1650634abe
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-iuh[master]: cosmetic: hnbgw: hnbap: log rx of unsuccessful outcome

2018-01-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: cosmetic: hnbgw: hnbap: log rx of unsuccessful outcome
..


cosmetic: hnbgw: hnbap: log rx of unsuccessful outcome

HNBAP isn't really that important to osmo-hnbgw operation, all we do is service
the few requests so that the other side is happy and uses our Iuh.
Nevertheless, could at least log if an UnsuccessfulOutcome was received.

Change-Id: I3f309dc2d3436798e9e76bcc2ebd82403ea538a1
---
M src/hnbgw_hnbap.c
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/src/hnbgw_hnbap.c b/src/hnbgw_hnbap.c
index fab520d..2746c21 100644
--- a/src/hnbgw_hnbap.c
+++ b/src/hnbgw_hnbap.c
@@ -529,6 +529,10 @@
 static int hnbgw_rx_unsuccessful_outcome_msg(struct hnb_context *hnb, 
UnsuccessfulOutcome_t *msg)
 {
/* We don't care much about HNBAP */
+   LOGP(DHNBAP, LOGL_ERROR, "Received Unsuccessful Outcome, procedureCode 
%ld, criticality %ld,"
+" from '%s', cell mcc %u mnc %u lac %u rac %u sac %u cid %u\n",
+msg->procedureCode, msg->criticality, hnb->identity_info,
+hnb->id.mcc, hnb->id.mnc, hnb->id.lac, hnb->id.rac, hnb->id.sac, 
hnb->id.cid);
return 0;
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3f309dc2d3436798e9e76bcc2ebd82403ea538a1
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-iuh[master]: hnbgw_rua.c: log: fix integer format for cN_DomainIndicator

2018-01-16 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[PATCH] osmo-bts[master]: Fix test dependencies

2018-01-16 Thread Max

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

Fix test dependencies

The stow-enabled jenkins builds are currently failing like below:

In file included from ../../include/osmo-bts/gsm_data.h:136:0,
 from ../../include/osmo-bts/bts.h:4,
 from misc_test.c:23:
../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: 
osmocom/abis/e1_input.h: No such file or directory
 #include 

Let's make sure that tests have all required CFLAGS/LIBS to build.

Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac
---
M tests/misc/Makefile.am
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am
index 6575fe8..2ddb649 100644
--- a/tests/misc/Makefile.am
+++ b/tests/misc/Makefile.am
@@ -1,6 +1,6 @@
 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
-AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) 
$(LIBOSMOCODEC_CFLAGS)
-LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS)
+AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) 
$(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS)
+LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) 
$(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS)
 noinst_PROGRAMS = misc_test
 EXTRA_DIST = misc_test.ok
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 


[PATCH] osmo-trx[master]: tests: convolve: Disable due to difference in output in diff...

2018-01-16 Thread Pau Espin Pedrol

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

tests: convolve: Disable due to difference in output in different archs

Let's disable this test in order to have passing jenkins jobs until we
find a better way to properly test this for different architectures.

Change-Id: I2320309bc8c1c20e2de6ef2e0f17472c68de80cb
---
M tests/testsuite.at
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/tests/testsuite.at b/tests/testsuite.at
index ca979e5..f84225e 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -46,8 +46,8 @@
 
 AT_SETUP([convolve_test])
 AT_KEYWORDS([convolve_test])
-# Disabled for ARM builds as it gives different output than x86, see  OS#2826
-AT_SKIP_IF(! uname -m | grep x86)
+# Different results for i686, x86_64 and ARM. see  OS#2826, OS#2828, and 
https://lists.osmocom.org/pipermail/openbsc/2018-January/011655.html
+AT_SKIP_IF(true)
 cat $abs_srcdir/Transceiver52M/convolve_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/Transceiver52M/convolve_test], [], [expout], 
[])
 AT_CLEANUP

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2320309bc8c1c20e2de6ef2e0f17472c68de80cb
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[MERGED] osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ...

2018-01-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged.

Change subject: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests 
with ARM instruction set
..


contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests with ARM 
instruction set

The following logic doesn't require root access to run the tests, which
means we can easily run it inside jenkins.

Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8
---
M contrib/jenkins.sh
M tests/testsuite.at
2 files changed, 55 insertions(+), 3 deletions(-)

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



diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index f31579e..11def5c 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -1,12 +1,62 @@
 #!/bin/sh
 set -ex
 
-osmo-clean-workspace.sh
+substr() { [ -z "${2##*$1*}" ]; }
+
+#apt-get install qemu qemu-user-static qemu-system-arm debootstrap fakeroot 
proot
+mychroot_nocwd() {
+# LC_ALL + LANGUAGE set to avoid lots of print errors due to locale 
not being set inside container
+# PATH is needed to be able to reach binaries like ldconfig without 
logging in to root, which adds the paths to PATH.
+# PROOT_NO_SECCOMP is requried due to proot bug #106
+LC_ALL=C LANGUAGE=C PATH="$PATH:/usr/sbin:/sbin" PROOT_NO_SECCOMP=1 
proot -r "$ROOTFS" -w / -b /proc --root-id -q qemu-arm-static "$@"
+}
+
+mychroot() {
+mychroot_nocwd -w / "$@"
+}
+
+if [ -z "${INSIDE_CHROOT}" ]; then
+
+osmo-clean-workspace.sh
+
+# Only use ARM chroot if host is not ARM and the target is ARM:
+if ! $(substr "arm" "$(uname -m)") && [ "x${INSTR}" = "x--with-neon" 
-o "x${INSTR}" = "x--with-neon-vfpv4" ]; then
+
+OSMOTRX_DIR="$PWD" # we assume we are called as 
contrib/jenkins.sh
+ROOTFS_PREFIX="${ROOTFS_PREFIX:-/opt}"
+ROOTFS="${ROOTFS_PREFIX}/qemu-img"
+mkdir -p "${ROOTFS_PREFIX}"
+
+# Prepare chroot:
+if [ ! -d "$ROOTFS" ]; then
+mkdir -p "$ROOTFS"
+if [ "x${USE_DEBOOTSTRAP}" = "x1" ]; then
+fakeroot qemu-debootstrap --foreign 
--include="linux-image-armmp-lpae" --arch=armhf stretch "$ROOTFS" 
http://ftp.de.debian.org/debian/
+# Hack to avoid debootstrap trying to mount 
/proc, as it will fail with "no permissions" and anyway proot takes care of it:
+sed -i "s/setup_proc//g" 
"$ROOTFS/debootstrap/suite-script"
+mychroot /debootstrap/debootstrap 
--second-stage --verbose http://ftp.de.debian.org/debian/
+else
+wget -nc -q 
"https://uk.images.linuxcontainers.org/images/debian/stretch/armhf/default/20180114_22:42/rootfs.tar.xz;
+tar -xf rootfs.tar.xz -C "$ROOTFS/" || true
+echo "nameserver 8.8.8.8" > 
"$ROOTFS/etc/resolv.conf"
+fi
+mychroot -b /dev apt-get update
+mychroot apt-get -y install build-essential 
dh-autoreconf pkg-config libuhd-dev libusb-1.0-0-dev libusb-dev git
+fi
+# Run jenkins.sh inside the chroot:
+INSIDE_CHROOT=1 mychroot_nocwd -w /osmo-trx -b 
"$OSMOTRX_DIR:/osmo-trx" -b "$(which 
osmo-clean-workspace.sh):/usr/bin/osmo-clean-workspace.sh" ./contrib/jenkins.sh
+exit 0
+fi
+fi
+
+### BUILD osmo-trx
 
 autoreconf --install --force
-./configure
+./configure $INSTR
 $MAKE $PARALLEL_MAKE
 $MAKE check \
   || cat-testlogs.sh
 
-osmo-clean-workspace.sh
+if [ -z "x${INSIDE_CHROOT}" ]; then
+osmo-clean-workspace.sh
+fi
diff --git a/tests/testsuite.at b/tests/testsuite.at
index c6ca848..ca979e5 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -46,6 +46,8 @@
 
 AT_SETUP([convolve_test])
 AT_KEYWORDS([convolve_test])
+# Disabled for ARM builds as it gives different output than x86, see  OS#2826
+AT_SKIP_IF(! uname -m | grep x86)
 cat $abs_srcdir/Transceiver52M/convolve_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/Transceiver52M/convolve_test], [], [expout], 
[])
 AT_CLEANUP

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8
Gerrit-PatchSet: 13
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 


[MERGED] osmo-ci[master]: jobs: osmo-trx: Set slave_axis to use only debian9

2018-01-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged.

Change subject: jobs: osmo-trx: Set slave_axis to use only debian9
..


jobs: osmo-trx: Set slave_axis to use only debian9

Debian 8 contains quite old qemu and proot packages which have some
issues running the chroot infrastructure set up in osmo-trx's
jenkins.sh.

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

Approvals:
  Pau Espin Pedrol: Verified
  Harald Welte: Looks good to me, approved



diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml
index 9cb12a5..4e553ea 100644
--- a/jobs/gerrit-verifications.yml
+++ b/jobs/gerrit-verifications.yml
@@ -178,7 +178,7 @@
   - osmo-sip-connector
 
   - osmo-trx:
-  slave_axis: !!python/tuple [OsmocomBuild1]
+  slave_axis: !!python/tuple [linux_amd64_debian9]
   a1_name: INSTR
   a1: !!python/tuple [--with-sse, --with-neon, --with-neon-vfpv4]
   concurrent: true
diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml
index 84a97a9..b98513a 100644
--- a/jobs/master-builds.yml
+++ b/jobs/master-builds.yml
@@ -235,7 +235,7 @@
   - osmo-tetra
 
   - osmo-trx:
-  slave_axis: !!python/tuple [OsmocomBuild1]
+  slave_axis: !!python/tuple [linux_amd64_debian9]
   a1_name: INSTR
   a1: !!python/tuple [--with-sse, --with-neon, --with-neon-vfpv4]
   concurrent: true

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I24665880fff5a5b918bb6ffaf1e7bb51ae860b0b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 


osmo-ci[master]: jobs: osmo-trx: Set slave_axis to use only debian9

2018-01-16 Thread Pau Espin Pedrol

Patch Set 1: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I24665880fff5a5b918bb6ffaf1e7bb51ae860b0b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No