[MERGED] osmo-ttcn3-hacks[master]: Add initial OsmoBTS test suite

2018-02-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Add initial OsmoBTS test suite
..


Add initial OsmoBTS test suite

This Test suite implements the BSC-side of Abis RSL and is used to
test OsmoBTS.  It contains provisions for using L1CTL against
(virt_phy + osmo-bts-virtual) or (trxcon + fake_trx + osmo-bts-trx)
to also simulate the MS/Um side, bu those provisions are not used
yet.

Implemented tests currently are only related to RSL dedicated channel
activation / deactivation.

We still terminate OML inside OsmoBSC, and let the test suite deal
exclusively with RSL to keep complexity low.

Change-Id: I8ced0d29777aad3ec842d54eabea87dfcc943c79
---
M Makefile
A bts/BTS_Tests.ttcn
A bts/gen_links.sh
A bts/regen_makefile.sh
4 files changed, 674 insertions(+), 1 deletion(-)

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



diff --git a/Makefile b/Makefile
index 2fcc561..3f2230b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-SUBDIRS=bsc bsc-nat ggsn_tests gprs_gb lapdm mgw msc selftest sgsn sysinfo
+SUBDIRS=bsc bsc-nat bts ggsn_tests gprs_gb lapdm mgw msc selftest sgsn sysinfo
 
 PARALLEL_MAKE:=-j4
 
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
new file mode 100644
index 000..58c7118
--- /dev/null
+++ b/bts/BTS_Tests.ttcn
@@ -0,0 +1,618 @@
+module BTS_Tests {
+
+import from General_Types all;
+import from GSM_Types all;
+import from GSM_RR_Types all;
+import from Osmocom_Types all;
+import from GSM_Types all;
+import from GSM_RR_Types all;
+import from L1CTL_PortType all;
+import from L1CTL_Types all;
+import from LAPDm_Types all;
+import from Osmocom_CTRL_Adapter all;
+
+import from RSL_Types all;
+import from IPA_Emulation all;
+import from RSL_Emulation all;
+
+import from IPL4asp_Types all;
+import from TRXC_Types all;
+import from TRXC_CodecPort all;
+import from TRXC_CodecPort_CtrlFunct all;
+
+/* The tests assume a BTS with the following timeslot configuration:
+ * TS0 : Combined CCCH + SDCCH/4
+ * TS1 .. TS 4: TCH/F
+ * TS5 : TCH/H
+ * TS6 : SDCCH/8
+ * TS7 : PDCH
+ */
+
+modulepar {
+   charstring mp_rsl_ip := "127.0.0.2";
+   integer mp_rsl_port := 3003;
+   integer mp_trx0_arfcn := 871;
+   integer mp_bb_trxc_port := 5704;
+}
+
+type component test_CT extends CTRL_Adapter_CT {
+   var IPA_Emulation_CT vc_IPA;
+
+   var RSL_Emulation_CT vc_RSL;
+   port RSL_CCHAN_PT RSL_CCHAN;
+}
+
+/* an individual call / channel */
+type component ConnHdlr extends RSL_DchanHdlr {
+   port L1CTL_PT L1CTL;
+
+   port TRXC_CODEC_PT BB_TRXC;
+   var integer g_bb_trxc_conn_id;
+
+   timer g_Tguard;
+   timer g_Tmeas_exp := 2.0; /* >= 103 SACCH multiframe ~ 500ms */
+
+   var ConnHdlrPars g_pars;
+   var uint8_t g_next_meas_res_nr := 0;
+}
+
+function f_init_rsl(charstring id) runs on test_CT {
+   vc_IPA := IPA_Emulation_CT.create(id & "-RSL-IPA");
+   vc_RSL := RSL_Emulation_CT.create(id & "-RSL");
+
+   map(vc_IPA:IPA_PORT, system:IPA_CODEC_PT);
+   connect(vc_IPA:IPA_RSL_PORT, vc_RSL:IPA_PT);
+   connect(self:RSL_CCHAN, vc_RSL:CCHAN_PT);
+
+   vc_IPA.start(IPA_Emulation.main_server(mp_rsl_ip, mp_rsl_port));
+   vc_RSL.start(RSL_Emulation.main(false));
+}
+
+type record ConnHdlrPars {
+   RslChannelNr chan_nr,
+   RSL_IE_ChannelMode chan_mode,
+   float t_guard,
+   ConnL1Pars l1_pars
+}
+
+
+/* global init function */
+function f_init(charstring id) runs on test_CT {
+   f_init_rsl(id);
+   RSL_CCHAN.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP});
+}
+
+type function void_fn(charstring id) runs on ConnHdlr;
+
+/* create a new test component */
+function f_start_handler(void_fn fn, ConnHdlrPars pars)
+runs on test_CT return ConnHdlr {
+   var charstring id := testcasename();
+   var ConnHdlr vc_conn;
+
+   vc_conn := ConnHdlr.create(id);
+   /* connect to RSL Emulation main component */
+   connect(vc_conn:RSL, vc_RSL:CLIENT_PT);
+   connect(vc_conn:RSL_PROC, vc_RSL:RSL_PROC);
+
+   vc_conn.start(f_handler_init(fn, id, pars));
+   return vc_conn;
+}
+
+private altstep as_Tguard() runs on ConnHdlr {
+   [] g_Tguard.timeout {
+   setverdict(fail, "Tguard timeout");
+   self.stop;
+   }
+}
+
+private function f_l1_tune() runs on ConnHdlr {
+   /* tune our virtual L1 to the right ARFCN */
+   //var BCCH_tune_req tune_req := { arfcn := { false, mp_trx0_arfcn }, 
combined_ccch := true };
+   //L1.send(tune_req);
+   f_L1CTL_FBSB(L1CTL, { false, mp_trx0_arfcn }, CCCH_MODE_COMBINED);
+}
+
+private function f_trxc_connect() runs on ConnHdlr {
+   map(self:BB_TRXC, system:BB_TRXC);
+   var Result res;
+   res := TRXC_CodecPort_CtrlFunct.f_IPL4_connect(BB_TRXC, "127.0.0.1", 
mp_bb_trxc_port,
+   "127.0.0.1", 0, -1, 
{udp:={}}, {});

[MERGED] osmo-bts[master]: load_indication: Fix start of load indication timer

2018-02-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: load_indication: Fix start of load indication timer
..


load_indication: Fix start of load indication timer

Starting the timer in bts_init() may result in it expiring already
before the load indication period is set via OML.   Let's make
load_timer_start() safe to call several times and call it from OML
code.

Change-Id: I295d91413542014aa2507d5f09e01243fc3916fa
Fixes: OS#2991
---
M src/common/load_indication.c
M src/common/oml.c
2 files changed, 9 insertions(+), 6 deletions(-)

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



diff --git a/src/common/load_indication.c b/src/common/load_indication.c
index a445ecb..4756d5a 100644
--- a/src/common/load_indication.c
+++ b/src/common/load_indication.c
@@ -85,11 +85,12 @@
 {
struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
 
-   btsb->load.ccch.timer.data = bts;
-   btsb->load.ccch.timer.cb = load_timer_cb;
-   reset_load_counters(bts);
-   osmo_timer_schedule(>load.ccch.timer,
-   btsb->load.ccch.load_ind_period, 0);
+   if (!btsb->load.ccch.timer.data) {
+   btsb->load.ccch.timer.data = bts;
+   btsb->load.ccch.timer.cb = load_timer_cb;
+   reset_load_counters(bts);
+   }
+   osmo_timer_schedule(>load.ccch.timer, 
btsb->load.ccch.load_ind_period, 0);
 }
 
 void load_timer_stop(struct gsm_bts *bts)
diff --git a/src/common/oml.c b/src/common/oml.c
index 00b85f1..75c2347 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -695,8 +695,10 @@
btsb->load.ccch.load_ind_thresh = *TLVP_VAL(, 
NM_ATT_CCCH_L_T);
 
/* 9.4.11 CCCH Load Indication Period */
-   if (TLVP_PRES_LEN(, NM_ATT_CCCH_L_I_P, 1))
+   if (TLVP_PRES_LEN(, NM_ATT_CCCH_L_I_P, 1)) {
btsb->load.ccch.load_ind_period = *TLVP_VAL(, 
NM_ATT_CCCH_L_I_P);
+   load_timer_start(bts);
+   }
 
/* 9.4.44 RACH Busy Threshold */
if (TLVP_PRES_LEN(, NM_ATT_RACH_B_THRESH, 1)) {

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

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


osmo-bts[master]: RSL: Implement DELETE INDICATION on AGCH overflow

2018-02-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-bts[master]: load_indication: Fix start of load indication timer

2018-02-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[PATCH] osmo-bts[master]: rsl: Improve ERROR REPORTing

2018-02-23 Thread Harald Welte

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

rsl: Improve ERROR REPORTing

Let's make sure all useful optional IEs of the RSL ERROR REPort aare present

Change-Id: I5ecb98f8c72f472ac23c1e4e0f606b75e2cf032c
---
M src/common/rsl.c
1 file changed, 81 insertions(+), 44 deletions(-)


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

diff --git a/src/common/rsl.c b/src/common/rsl.c
index bffe69d..df480a6 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -56,7 +56,9 @@
 
 //#define FAKE_CIPH_MODE_COMPL
 
-static int rsl_tx_error_report(struct gsm_bts_trx *trx, uint8_t cause);
+
+static int rsl_tx_error_report(struct gsm_bts_trx *trx, uint8_t cause, const 
uint8_t *chan_nr,
+   const uint8_t *link_id, const struct msgb 
*orig_msg);
 
 /* list of RSL SI types that can occur on the SACCH */
 static const unsigned int rsl_sacch_sitypes[] = {
@@ -225,16 +227,36 @@
  */
 
 /* 8.6.4 sending ERROR REPORT */
-static int rsl_tx_error_report(struct gsm_bts_trx *trx, uint8_t cause)
+static int rsl_tx_error_report(struct gsm_bts_trx *trx, uint8_t cause, const 
uint8_t *chan_nr,
+   const uint8_t *link_id, const struct msgb 
*orig_msg)
 {
+   unsigned int len = sizeof(struct abis_rsl_common_hdr);
struct msgb *nmsg;
 
LOGP(DRSL, LOGL_NOTICE, "Tx RSL Error Report: cause = 0x%02x\n", cause);
 
-   nmsg = rsl_msgb_alloc(sizeof(struct abis_rsl_common_hdr));
+   if (orig_msg)
+   len += 2 + 3+msgb_l2len(orig_msg); /* chan_nr + TLV(orig_msg) */
+   if (chan_nr)
+   len += 2;
+   if (link_id)
+   len += 2;
+
+   nmsg = rsl_msgb_alloc(len);
if (!nmsg)
return -ENOMEM;
msgb_tlv_put(nmsg, RSL_IE_CAUSE, 1, );
+   if (orig_msg && msgb_l2len(orig_msg) >= sizeof(struct 
abis_rsl_common_hdr)) {
+   struct abis_rsl_common_hdr *ch = (struct abis_rsl_common_hdr *) 
msgb_l2(orig_msg);
+   msgb_tv_put(nmsg, RSL_IE_MSG_ID, ch->msg_type);
+   }
+   if (chan_nr)
+   msgb_tv_put(nmsg, RSL_IE_CHAN_NR, *chan_nr);
+   if (link_id)
+   msgb_tv_put(nmsg, RSL_IE_LINK_IDENT, *link_id);
+   if (orig_msg)
+   msgb_tlv_put(nmsg, RSL_IE_ERR_MSG, msgb_l2len(orig_msg), 
msgb_l2(orig_msg));
+
rsl_trx_push_hdr(nmsg, RSL_MT_ERROR_REPORT);
nmsg->trx = trx;
 
@@ -276,16 +298,16 @@
 
/* 9.3.30 System Info Type */
if (!TLVP_PRESENT(, RSL_IE_SYSINFO_TYPE))
-   return rsl_tx_error_report(trx, RSL_ERR_MAND_IE_ERROR);
+   return rsl_tx_error_report(trx, RSL_ERR_MAND_IE_ERROR, NULL, 
NULL, msg);
 
rsl_si = *TLVP_VAL(, RSL_IE_SYSINFO_TYPE);
if (OSMO_IN_ARRAY(rsl_si, rsl_sacch_sitypes))
-   return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT);
+   return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT, NULL, NULL, 
msg);
 
osmo_si = osmo_rsl2sitype(rsl_si);
if (osmo_si == SYSINFO_TYPE_NONE) {
LOGP(DRSL, LOGL_NOTICE, " Rx RSL SI 0x%02x not supported.\n", 
rsl_si);
-   return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT);
+   return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT, NULL, NULL, 
msg);
}
/* 9.3.39 Full BCCH Information */
if (TLVP_PRESENT(, RSL_IE_FULL_BCCH_INFO)) {
@@ -316,13 +338,13 @@
if (bts->si2q_index > bts->si2q_count) {
LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater with 
index %u > count %u\n",
 bts->si2q_index, bts->si2q_count);
-   return rsl_tx_error_report(trx, 
RSL_ERR_IE_CONTENT);
+   return rsl_tx_error_report(trx, 
RSL_ERR_IE_CONTENT, NULL, NULL, msg);
}
 
if (bts->si2q_index > SI2Q_MAX_NUM || bts->si2q_count > 
SI2Q_MAX_NUM) {
LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater with 
impossible parameters: index %u, count %u"
 "should be <= %u\n", bts->si2q_index, 
bts->si2q_count, SI2Q_MAX_NUM);
-   return rsl_tx_error_report(trx, 
RSL_ERR_IE_CONTENT);
+   return rsl_tx_error_report(trx, 
RSL_ERR_IE_CONTENT, NULL, NULL, msg);
}
 
memset(GSM_BTS_SI2Q(bts, bts->si2q_index), 
GSM_MACBLOCK_PADDING, sizeof(sysinfo_buf_t));
@@ -432,7 +454,7 @@
 
if (!TLVP_PRESENT(, RSL_IE_PAGING_GROUP) ||
!TLVP_PRESENT(, RSL_IE_MS_IDENTITY))
-   return rsl_tx_error_report(trx, RSL_ERR_MAND_IE_ERROR);
+   return rsl_tx_error_report(trx, RSL_ERR_MAND_IE_ERROR, NULL, 
NULL, msg);
 
paging_group = *TLVP_VAL(, RSL_IE_PAGING_GROUP);
identity_lv = TLVP_VAL(, RSL_IE_MS_IDENTITY)-1;
@@ -464,7 +486,7 @@
 
if (!TLVP_PRESENT(, 

[PATCH] osmo-bts[master]: RSL: Send ERROR REPORT on too short/truncated messages + wro...

2018-02-23 Thread Harald Welte

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

RSL: Send ERROR REPORT on too short/truncated messages + wrong discriminator

Change-Id: I6a0e63999f39592474064e2f05df450aec8e37fe
---
M src/common/rsl.c
1 file changed, 6 insertions(+), 0 deletions(-)


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

diff --git a/src/common/rsl.c b/src/common/rsl.c
index 2638ad2..bffe69d 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -2276,6 +2276,7 @@
 
if (msgb_l2len(msg) < sizeof(*rh)) {
LOGP(DRSL, LOGL_NOTICE, "RSL Radio Link Layer message too 
short\n");
+   rsl_tx_error_report(trx, RSL_ERR_PROTO);
msgb_free(msg);
return -EIO;
}
@@ -2469,6 +2470,7 @@
 
if (msgb_l2len(msg) < sizeof(*cch)) {
LOGP(DRSL, LOGL_NOTICE, "RSL Common Channel Management message 
too short\n");
+   rsl_tx_error_report(trx, RSL_ERR_PROTO);
msgb_free(msg);
return -EIO;
}
@@ -2598,6 +2600,7 @@
 
if (msgb_l2len(msg) < sizeof(*th)) {
LOGP(DRSL, LOGL_NOTICE, "RSL TRX message too short\n");
+   rsl_tx_error_report(trx, RSL_ERR_PROTO);
msgb_free(msg);
return -EIO;
}
@@ -2626,6 +2629,7 @@
 
if (msgb_l2len(msg) < sizeof(*dch)) {
LOGP(DRSL, LOGL_NOTICE, "RSL ip.access message too short\n");
+   rsl_tx_error_report(trx, RSL_ERR_PROTO);
msgb_free(msg);
return -EIO;
}
@@ -2683,6 +2687,7 @@
 
if (msgb_l2len(msg) < sizeof(*rslh)) {
LOGP(DRSL, LOGL_NOTICE, "RSL message too short\n");
+   rsl_tx_error_report(trx, RSL_ERR_PROTO);
msgb_free(msg);
return -EIO;
}
@@ -2708,6 +2713,7 @@
default:
LOGP(DRSL, LOGL_NOTICE, "unknown RSL msg_discr 0x%02x\n",
rslh->msg_discr);
+   rsl_tx_error_report(trx, RSL_ERR_MSG_DISCR);
msgb_free(msg);
ret = -EINVAL;
}

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

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


[PATCH] osmo-bts[master]: RSL: Implement DELETE INDICATION on AGCH overflow

2018-02-23 Thread Harald Welte

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

RSL: Implement DELETE INDICATION on AGCH overflow

This patch adds generation of a DELETE INDICATION when the BTS AGCH
queue overflows due to too many IMMEDIATE ASSIGN CMDs, as required
by the specs.

The AGCH queue length in OsmoBTS so far is at 1000 entries, which I
consider way too high.  But that is for another patch.

Change-Id: Ied3306e85cbdc6f3476b10dc4bb0463cd728b274
Related: OS#2990
---
M src/common/rsl.c
1 file changed, 17 insertions(+), 0 deletions(-)


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

diff --git a/src/common/rsl.c b/src/common/rsl.c
index 8448925..2638ad2 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -404,6 +404,21 @@
return abis_bts_rsl_sendmsg(msg);
 }
 
+/* 8.5.4 DELETE INDICATION */
+static int rsl_tx_delete_ind(struct gsm_bts *bts, const uint8_t *ia, uint8_t 
ia_len)
+{
+   struct msgb *msg;
+
+   msg = rsl_msgb_alloc(sizeof(struct abis_rsl_cchan_hdr));
+   if (!msg)
+   return -ENOMEM;
+   rsl_cch_push_hdr(msg, RSL_MT_DELETE_IND, RSL_CHAN_PCH_AGCH);
+   msgb_tlv_put(msg, RSL_IE_FULL_IMM_ASS_INFO, ia_len, ia);
+   msg->trx = bts->c0;
+
+   return abis_bts_rsl_sendmsg(msg);
+}
+
 /* 8.5.5 PAGING COMMAND */
 static int rsl_rx_paging_cmd(struct gsm_bts_trx *trx, struct msgb *msg)
 {
@@ -546,6 +561,8 @@
/* put into the AGCH queue of the BTS */
if (bts_agch_enqueue(trx->bts, msg) < 0) {
/* if there is no space in the queue: send DELETE IND */
+   rsl_tx_delete_ind(trx->bts, TLVP_VAL(, 
RSL_IE_FULL_IMM_ASS_INFO),
+ TLVP_LEN(, RSL_IE_FULL_IMM_ASS_INFO));
msgb_free(msg);
}
 

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

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


[PATCH] osmo-bts[master]: load_indication: Fix start of load indication timer

2018-02-23 Thread Harald Welte

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

load_indication: Fix start of load indication timer

Starting the timer in bts_init() may result in it expiring already
before the load indication period is set via OML.   Let's make
load_timer_start() safe to call several times and call it from OML
code.

Change-Id: I295d91413542014aa2507d5f09e01243fc3916fa
Fixes: OS#2991
---
M src/common/load_indication.c
M src/common/oml.c
2 files changed, 9 insertions(+), 6 deletions(-)


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

diff --git a/src/common/load_indication.c b/src/common/load_indication.c
index a445ecb..4756d5a 100644
--- a/src/common/load_indication.c
+++ b/src/common/load_indication.c
@@ -85,11 +85,12 @@
 {
struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
 
-   btsb->load.ccch.timer.data = bts;
-   btsb->load.ccch.timer.cb = load_timer_cb;
-   reset_load_counters(bts);
-   osmo_timer_schedule(>load.ccch.timer,
-   btsb->load.ccch.load_ind_period, 0);
+   if (!btsb->load.ccch.timer.data) {
+   btsb->load.ccch.timer.data = bts;
+   btsb->load.ccch.timer.cb = load_timer_cb;
+   reset_load_counters(bts);
+   }
+   osmo_timer_schedule(>load.ccch.timer, 
btsb->load.ccch.load_ind_period, 0);
 }
 
 void load_timer_stop(struct gsm_bts *bts)
diff --git a/src/common/oml.c b/src/common/oml.c
index 00b85f1..75c2347 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -695,8 +695,10 @@
btsb->load.ccch.load_ind_thresh = *TLVP_VAL(, 
NM_ATT_CCCH_L_T);
 
/* 9.4.11 CCCH Load Indication Period */
-   if (TLVP_PRES_LEN(, NM_ATT_CCCH_L_I_P, 1))
+   if (TLVP_PRES_LEN(, NM_ATT_CCCH_L_I_P, 1)) {
btsb->load.ccch.load_ind_period = *TLVP_VAL(, 
NM_ATT_CCCH_L_I_P);
+   load_timer_start(bts);
+   }
 
/* 9.4.44 RACH Busy Threshold */
if (TLVP_PRES_LEN(, NM_ATT_RACH_B_THRESH, 1)) {

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

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


[MERGED] osmo-ttcn3-hacks[master]: GSM_Types: add rxqual2ber and rxlev2dbm + ivnerse functions

2018-02-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: GSM_Types: add rxqual2ber and rxlev2dbm + ivnerse functions
..


GSM_Types: add rxqual2ber and rxlev2dbm + ivnerse functions

Change-Id: I6293f6a9b73d5614cbb61c64617af4dd8afc1e73
---
M library/GSM_Types.ttcn
1 file changed, 52 insertions(+), 0 deletions(-)

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



diff --git a/library/GSM_Types.ttcn b/library/GSM_Types.ttcn
index e57575d..634af34 100644
--- a/library/GSM_Types.ttcn
+++ b/library/GSM_Types.ttcn
@@ -168,4 +168,56 @@
}
}
 
+/* Convert RF signal level in dBm to RxLev (TS 45.008 Chapter 8.1.4) */
+function dbm2rxlev(integer dbm) return uint6_t {
+   var integer rxlev := dbm + 110;
+   if (rxlev > 63) {
+   rxlev := 63;
+   } else if (rxlev < 0) {
+   rxlev := 0;
+   }
+   return rxlev;
+}
+
+function rxlev2dbm(uint6_t rxlev) return integer {
+   return -110 + rxlev;
+}
+
+/* convert BER to RxQual value (TS 45.008 Chapter 8.2.4 */
+function ber2rxqual(float ber) return uint3_t {
+   if (ber < 0.2) {
+   return 0;
+   } else if (ber < 0.4) {
+   return 1;
+   } else if (ber < 0.8) {
+   return 2;
+   } else if (ber < 1.6) {
+   return 3;
+   } else if (ber < 3.2) {
+   return 4;
+   } else if (ber < 6.4) {
+   return 5;
+   } else if (ber < 12.8) {
+   return 6;
+   } else {
+   return 7;
+   }
+}
+
+/* convert RxQual to BER (TS 45.008 Chapter 8.2.4 */
+function rxqual2ber(uint3_t rxqual) return float {
+   select (rxqual) {
+   case (0) { return 0.14 }
+   case (1) { return 0.28 }
+   case (2) { return 0.57 }
+   case (3) { return 1.13 }
+   case (4) { return 2.26 }
+   case (5) { return 4.53 }
+   case (6) { return 9.05 }
+   case (7) { return 18.10 }
+   case else { return 1000.0 }
+   }
+}
+
+
 } with { encode "RAW"; variant "FIELDORDER(msb)" }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6293f6a9b73d5614cbb61c64617af4dd8afc1e73
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-ttcn3-hacks[master]: Add TRXC (OsmoTRX Control) protocol types + codec port

2018-02-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Add TRXC (OsmoTRX Control) protocol types + codec port
..


Add TRXC (OsmoTRX Control) protocol types + codec port

Change-Id: I3b5e81693e5cf8ee8a2c360bde8b16c5276d2297
---
A library/TRXC_CodecPort.ttcn
A library/TRXC_CodecPort_CtrlFunct.ttcn
A library/TRXC_CodecPort_CtrlFunctDef.cc
A library/TRXC_Types.ttcn
4 files changed, 234 insertions(+), 0 deletions(-)

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



diff --git a/library/TRXC_CodecPort.ttcn b/library/TRXC_CodecPort.ttcn
new file mode 100644
index 000..6acead0
--- /dev/null
+++ b/library/TRXC_CodecPort.ttcn
@@ -0,0 +1,62 @@
+module TRXC_CodecPort {
+
+import from IPL4asp_PortType all;
+import from IPL4asp_Types all;
+import from TRXC_Types all;
+
+type record TRXC_RecvFrom {
+   ConnectionIdconnId,
+   HostNameremName,
+   PortNumber  remPort,
+   HostNamelocName,
+   PortNumber  locPort,
+   TrxcMessage msg
+}
+
+template TRXC_RecvFrom tr_TRXC_RecvFrom(template TrxcMessage msg) := {
+   connId := ?,
+   remName := ?,
+   remPort := ?,
+   locName := ?,
+   locPort := ?,
+   msg := msg
+}
+
+type record TRXC_Send {
+   ConnectionIdconnId,
+   TrxcMessage msg
+}
+
+private function IPL4_to_TRXC_RecvFrom(in ASP_RecvFrom pin, out TRXC_RecvFrom 
pout) {
+   pout.connId := pin.connId;
+   pout.remName := pin.remName;
+   pout.remPort := pin.remPort;
+   pout.locName := pin.locName;
+   pout.locPort := pin.locPort;
+   pout.msg := dec_TrxcMessage(oct2char(pin.msg));
+} with { extension "prototype(fast)" };
+
+private function TRXC_to_IPL4_Send(in TRXC_Send pin, out ASP_Send pout) {
+   pout.connId := pin.connId;
+   pout.proto := { udp := {} };
+   pout.msg := char2oct(enc_TrxcMessage(pin.msg));
+} with { extension "prototype(fast)" };
+
+type port TRXC_CODEC_PT message {
+   out TRXC_Send;
+   in  TRXC_RecvFrom,
+   ASP_ConnId_ReadyToRelease,
+   ASP_Event;
+} with { extension "user IPL4asp_PT
+   out(TRXC_Send -> ASP_Send: function(TRXC_to_IPL4_Send))
+   in(ASP_RecvFrom -> TRXC_RecvFrom: function(IPL4_to_TRXC_RecvFrom);
+  ASP_ConnId_ReadyToRelease -> ASP_ConnId_ReadyToRelease: simple;
+  ASP_Event -> ASP_Event: simple)"
+}
+
+template (value) TRXC_Send ts_TRXC_Send(ConnectionId cid, template (value) 
TrxcMessage msg) := {
+   connId := cid,
+   msg := msg
+}
+
+}
diff --git a/library/TRXC_CodecPort_CtrlFunct.ttcn 
b/library/TRXC_CodecPort_CtrlFunct.ttcn
new file mode 100644
index 000..07d809c
--- /dev/null
+++ b/library/TRXC_CodecPort_CtrlFunct.ttcn
@@ -0,0 +1,43 @@
+module TRXC_CodecPort_CtrlFunct {
+
+  import from TRXC_CodecPort all;
+  import from IPL4asp_Types all;
+
+  external function f_IPL4_listen(
+inout TRXC_CODEC_PT portRef,
+in HostName locName,
+in PortNumber locPort,
+in ProtoTuple proto,
+in OptionList options := {}
+  ) return Result;
+
+  external function f_IPL4_connect(
+inout TRXC_CODEC_PT portRef,
+in HostName remName,
+in PortNumber remPort,
+in HostName locName,
+in PortNumber locPort,
+in ConnectionId connId,
+in ProtoTuple proto,
+in OptionList options := {}
+  ) return Result;
+
+  external function f_IPL4_close(
+inout TRXC_CODEC_PT portRef,
+in ConnectionId id,
+in ProtoTuple proto := { unspecified := {} }
+  ) return Result;
+
+  external function f_IPL4_setUserData(
+inout TRXC_CODEC_PT portRef,
+in ConnectionId id,
+in UserData userData
+  ) return Result;
+
+  external function f_IPL4_getUserData(
+inout TRXC_CODEC_PT portRef,
+in ConnectionId id,
+out UserData userData
+  ) return Result;
+
+ }
diff --git a/library/TRXC_CodecPort_CtrlFunctDef.cc 
b/library/TRXC_CodecPort_CtrlFunctDef.cc
new file mode 100644
index 000..aecd1ee
--- /dev/null
+++ b/library/TRXC_CodecPort_CtrlFunctDef.cc
@@ -0,0 +1,55 @@
+#include "IPL4asp_PortType.hh"
+#include "IPL4asp_PT.hh"
+#include "TRXC_CodecPort.hh"
+
+namespace TRXC__CodecPort__CtrlFunct {
+
+  IPL4asp__Types::Result f__IPL4__listen(
+TRXC__CodecPort::TRXC__CODEC__PT& portRef,
+const IPL4asp__Types::HostName& locName,
+const IPL4asp__Types::PortNumber& locPort,
+const IPL4asp__Types::ProtoTuple& proto,
+const IPL4asp__Types::OptionList& options)
+  {
+return f__IPL4__PROVIDER__listen(portRef, locName, locPort, proto, 
options);
+  }
+  
+  IPL4asp__Types::Result f__IPL4__connect(
+TRXC__CodecPort::TRXC__CODEC__PT& portRef,
+const IPL4asp__Types::HostName& remName,
+const IPL4asp__Types::PortNumber& remPort,
+const IPL4asp__Types::HostName& locName,
+const IPL4asp__Types::PortNumber& locPort,
+const IPL4asp__Types::ConnectionId& connId,
+const 

osmo-ttcn3-hacks[master]: Add initial OsmoBTS test suite

2018-02-23 Thread Harald Welte

Patch Set 2: Code-Review+2

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

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


osmo-ttcn3-hacks[master]: GSM_Types: add rxqual2ber and rxlev2dbm + ivnerse functions

2018-02-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I6293f6a9b73d5614cbb61c64617af4dd8afc1e73
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: Add TRXC (OsmoTRX Control) protocol types + codec port

2018-02-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I3b5e81693e5cf8ee8a2c360bde8b16c5276d2297
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] osmo-ttcn3-hacks[master]: Add initial OsmoBTS test suite

2018-02-23 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/6629

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

Add initial OsmoBTS test suite

This Test suite implements the BSC-side of Abis RSL and is used to
test OsmoBTS.  It contains provisions for using L1CTL against
(virt_phy + osmo-bts-virtual) or (trxcon + fake_trx + osmo-bts-trx)
to also simulate the MS/Um side, bu those provisions are not used
yet.

Implemented tests currently are only related to RSL dedicated channel
activation / deactivation.

We still terminate OML inside OsmoBSC, and let the test suite deal
exclusively with RSL to keep complexity low.

Change-Id: I8ced0d29777aad3ec842d54eabea87dfcc943c79
---
M Makefile
A bts/BTS_Tests.ttcn
A bts/gen_links.sh
A bts/regen_makefile.sh
4 files changed, 674 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/29/6629/2

diff --git a/Makefile b/Makefile
index 2fcc561..3f2230b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-SUBDIRS=bsc bsc-nat ggsn_tests gprs_gb lapdm mgw msc selftest sgsn sysinfo
+SUBDIRS=bsc bsc-nat bts ggsn_tests gprs_gb lapdm mgw msc selftest sgsn sysinfo
 
 PARALLEL_MAKE:=-j4
 
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
new file mode 100644
index 000..58c7118
--- /dev/null
+++ b/bts/BTS_Tests.ttcn
@@ -0,0 +1,618 @@
+module BTS_Tests {
+
+import from General_Types all;
+import from GSM_Types all;
+import from GSM_RR_Types all;
+import from Osmocom_Types all;
+import from GSM_Types all;
+import from GSM_RR_Types all;
+import from L1CTL_PortType all;
+import from L1CTL_Types all;
+import from LAPDm_Types all;
+import from Osmocom_CTRL_Adapter all;
+
+import from RSL_Types all;
+import from IPA_Emulation all;
+import from RSL_Emulation all;
+
+import from IPL4asp_Types all;
+import from TRXC_Types all;
+import from TRXC_CodecPort all;
+import from TRXC_CodecPort_CtrlFunct all;
+
+/* The tests assume a BTS with the following timeslot configuration:
+ * TS0 : Combined CCCH + SDCCH/4
+ * TS1 .. TS 4: TCH/F
+ * TS5 : TCH/H
+ * TS6 : SDCCH/8
+ * TS7 : PDCH
+ */
+
+modulepar {
+   charstring mp_rsl_ip := "127.0.0.2";
+   integer mp_rsl_port := 3003;
+   integer mp_trx0_arfcn := 871;
+   integer mp_bb_trxc_port := 5704;
+}
+
+type component test_CT extends CTRL_Adapter_CT {
+   var IPA_Emulation_CT vc_IPA;
+
+   var RSL_Emulation_CT vc_RSL;
+   port RSL_CCHAN_PT RSL_CCHAN;
+}
+
+/* an individual call / channel */
+type component ConnHdlr extends RSL_DchanHdlr {
+   port L1CTL_PT L1CTL;
+
+   port TRXC_CODEC_PT BB_TRXC;
+   var integer g_bb_trxc_conn_id;
+
+   timer g_Tguard;
+   timer g_Tmeas_exp := 2.0; /* >= 103 SACCH multiframe ~ 500ms */
+
+   var ConnHdlrPars g_pars;
+   var uint8_t g_next_meas_res_nr := 0;
+}
+
+function f_init_rsl(charstring id) runs on test_CT {
+   vc_IPA := IPA_Emulation_CT.create(id & "-RSL-IPA");
+   vc_RSL := RSL_Emulation_CT.create(id & "-RSL");
+
+   map(vc_IPA:IPA_PORT, system:IPA_CODEC_PT);
+   connect(vc_IPA:IPA_RSL_PORT, vc_RSL:IPA_PT);
+   connect(self:RSL_CCHAN, vc_RSL:CCHAN_PT);
+
+   vc_IPA.start(IPA_Emulation.main_server(mp_rsl_ip, mp_rsl_port));
+   vc_RSL.start(RSL_Emulation.main(false));
+}
+
+type record ConnHdlrPars {
+   RslChannelNr chan_nr,
+   RSL_IE_ChannelMode chan_mode,
+   float t_guard,
+   ConnL1Pars l1_pars
+}
+
+
+/* global init function */
+function f_init(charstring id) runs on test_CT {
+   f_init_rsl(id);
+   RSL_CCHAN.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP});
+}
+
+type function void_fn(charstring id) runs on ConnHdlr;
+
+/* create a new test component */
+function f_start_handler(void_fn fn, ConnHdlrPars pars)
+runs on test_CT return ConnHdlr {
+   var charstring id := testcasename();
+   var ConnHdlr vc_conn;
+
+   vc_conn := ConnHdlr.create(id);
+   /* connect to RSL Emulation main component */
+   connect(vc_conn:RSL, vc_RSL:CLIENT_PT);
+   connect(vc_conn:RSL_PROC, vc_RSL:RSL_PROC);
+
+   vc_conn.start(f_handler_init(fn, id, pars));
+   return vc_conn;
+}
+
+private altstep as_Tguard() runs on ConnHdlr {
+   [] g_Tguard.timeout {
+   setverdict(fail, "Tguard timeout");
+   self.stop;
+   }
+}
+
+private function f_l1_tune() runs on ConnHdlr {
+   /* tune our virtual L1 to the right ARFCN */
+   //var BCCH_tune_req tune_req := { arfcn := { false, mp_trx0_arfcn }, 
combined_ccch := true };
+   //L1.send(tune_req);
+   f_L1CTL_FBSB(L1CTL, { false, mp_trx0_arfcn }, CCCH_MODE_COMBINED);
+}
+
+private function f_trxc_connect() runs on ConnHdlr {
+   map(self:BB_TRXC, system:BB_TRXC);
+   var Result res;
+   res := TRXC_CodecPort_CtrlFunct.f_IPL4_connect(BB_TRXC, "127.0.0.1", 
mp_bb_trxc_port,
+   "127.0.0.1", 0, -1, 
{udp:={}}, {});
+   g_bb_trxc_conn_id := 

[PATCH] osmo-ttcn3-hacks[master]: Add TRXC (OsmoTRX Control) protocol types + codec port

2018-02-23 Thread Harald Welte

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

Add TRXC (OsmoTRX Control) protocol types + codec port

Change-Id: I3b5e81693e5cf8ee8a2c360bde8b16c5276d2297
---
A library/TRXC_CodecPort.ttcn
A library/TRXC_CodecPort_CtrlFunct.ttcn
A library/TRXC_CodecPort_CtrlFunctDef.cc
A library/TRXC_Types.ttcn
4 files changed, 234 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/72/6872/1

diff --git a/library/TRXC_CodecPort.ttcn b/library/TRXC_CodecPort.ttcn
new file mode 100644
index 000..6acead0
--- /dev/null
+++ b/library/TRXC_CodecPort.ttcn
@@ -0,0 +1,62 @@
+module TRXC_CodecPort {
+
+import from IPL4asp_PortType all;
+import from IPL4asp_Types all;
+import from TRXC_Types all;
+
+type record TRXC_RecvFrom {
+   ConnectionIdconnId,
+   HostNameremName,
+   PortNumber  remPort,
+   HostNamelocName,
+   PortNumber  locPort,
+   TrxcMessage msg
+}
+
+template TRXC_RecvFrom tr_TRXC_RecvFrom(template TrxcMessage msg) := {
+   connId := ?,
+   remName := ?,
+   remPort := ?,
+   locName := ?,
+   locPort := ?,
+   msg := msg
+}
+
+type record TRXC_Send {
+   ConnectionIdconnId,
+   TrxcMessage msg
+}
+
+private function IPL4_to_TRXC_RecvFrom(in ASP_RecvFrom pin, out TRXC_RecvFrom 
pout) {
+   pout.connId := pin.connId;
+   pout.remName := pin.remName;
+   pout.remPort := pin.remPort;
+   pout.locName := pin.locName;
+   pout.locPort := pin.locPort;
+   pout.msg := dec_TrxcMessage(oct2char(pin.msg));
+} with { extension "prototype(fast)" };
+
+private function TRXC_to_IPL4_Send(in TRXC_Send pin, out ASP_Send pout) {
+   pout.connId := pin.connId;
+   pout.proto := { udp := {} };
+   pout.msg := char2oct(enc_TrxcMessage(pin.msg));
+} with { extension "prototype(fast)" };
+
+type port TRXC_CODEC_PT message {
+   out TRXC_Send;
+   in  TRXC_RecvFrom,
+   ASP_ConnId_ReadyToRelease,
+   ASP_Event;
+} with { extension "user IPL4asp_PT
+   out(TRXC_Send -> ASP_Send: function(TRXC_to_IPL4_Send))
+   in(ASP_RecvFrom -> TRXC_RecvFrom: function(IPL4_to_TRXC_RecvFrom);
+  ASP_ConnId_ReadyToRelease -> ASP_ConnId_ReadyToRelease: simple;
+  ASP_Event -> ASP_Event: simple)"
+}
+
+template (value) TRXC_Send ts_TRXC_Send(ConnectionId cid, template (value) 
TrxcMessage msg) := {
+   connId := cid,
+   msg := msg
+}
+
+}
diff --git a/library/TRXC_CodecPort_CtrlFunct.ttcn 
b/library/TRXC_CodecPort_CtrlFunct.ttcn
new file mode 100644
index 000..07d809c
--- /dev/null
+++ b/library/TRXC_CodecPort_CtrlFunct.ttcn
@@ -0,0 +1,43 @@
+module TRXC_CodecPort_CtrlFunct {
+
+  import from TRXC_CodecPort all;
+  import from IPL4asp_Types all;
+
+  external function f_IPL4_listen(
+inout TRXC_CODEC_PT portRef,
+in HostName locName,
+in PortNumber locPort,
+in ProtoTuple proto,
+in OptionList options := {}
+  ) return Result;
+
+  external function f_IPL4_connect(
+inout TRXC_CODEC_PT portRef,
+in HostName remName,
+in PortNumber remPort,
+in HostName locName,
+in PortNumber locPort,
+in ConnectionId connId,
+in ProtoTuple proto,
+in OptionList options := {}
+  ) return Result;
+
+  external function f_IPL4_close(
+inout TRXC_CODEC_PT portRef,
+in ConnectionId id,
+in ProtoTuple proto := { unspecified := {} }
+  ) return Result;
+
+  external function f_IPL4_setUserData(
+inout TRXC_CODEC_PT portRef,
+in ConnectionId id,
+in UserData userData
+  ) return Result;
+
+  external function f_IPL4_getUserData(
+inout TRXC_CODEC_PT portRef,
+in ConnectionId id,
+out UserData userData
+  ) return Result;
+
+ }
diff --git a/library/TRXC_CodecPort_CtrlFunctDef.cc 
b/library/TRXC_CodecPort_CtrlFunctDef.cc
new file mode 100644
index 000..aecd1ee
--- /dev/null
+++ b/library/TRXC_CodecPort_CtrlFunctDef.cc
@@ -0,0 +1,55 @@
+#include "IPL4asp_PortType.hh"
+#include "IPL4asp_PT.hh"
+#include "TRXC_CodecPort.hh"
+
+namespace TRXC__CodecPort__CtrlFunct {
+
+  IPL4asp__Types::Result f__IPL4__listen(
+TRXC__CodecPort::TRXC__CODEC__PT& portRef,
+const IPL4asp__Types::HostName& locName,
+const IPL4asp__Types::PortNumber& locPort,
+const IPL4asp__Types::ProtoTuple& proto,
+const IPL4asp__Types::OptionList& options)
+  {
+return f__IPL4__PROVIDER__listen(portRef, locName, locPort, proto, 
options);
+  }
+  
+  IPL4asp__Types::Result f__IPL4__connect(
+TRXC__CodecPort::TRXC__CODEC__PT& portRef,
+const IPL4asp__Types::HostName& remName,
+const IPL4asp__Types::PortNumber& remPort,
+const IPL4asp__Types::HostName& locName,
+const IPL4asp__Types::PortNumber& locPort,
+const IPL4asp__Types::ConnectionId& connId,
+const IPL4asp__Types::ProtoTuple& proto,
+const IPL4asp__Types::OptionList& options)
+  {
+return f__IPL4__PROVIDER__connect(portRef, remName, remPort,
+

[PATCH] osmo-ttcn3-hacks[master]: GSM_Types: add rxqual2ber and rxlev2dbm + ivnerse functions

2018-02-23 Thread Harald Welte

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

GSM_Types: add rxqual2ber and rxlev2dbm + ivnerse functions

Change-Id: I6293f6a9b73d5614cbb61c64617af4dd8afc1e73
---
M library/GSM_Types.ttcn
1 file changed, 52 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/73/6873/1

diff --git a/library/GSM_Types.ttcn b/library/GSM_Types.ttcn
index e57575d..634af34 100644
--- a/library/GSM_Types.ttcn
+++ b/library/GSM_Types.ttcn
@@ -168,4 +168,56 @@
}
}
 
+/* Convert RF signal level in dBm to RxLev (TS 45.008 Chapter 8.1.4) */
+function dbm2rxlev(integer dbm) return uint6_t {
+   var integer rxlev := dbm + 110;
+   if (rxlev > 63) {
+   rxlev := 63;
+   } else if (rxlev < 0) {
+   rxlev := 0;
+   }
+   return rxlev;
+}
+
+function rxlev2dbm(uint6_t rxlev) return integer {
+   return -110 + rxlev;
+}
+
+/* convert BER to RxQual value (TS 45.008 Chapter 8.2.4 */
+function ber2rxqual(float ber) return uint3_t {
+   if (ber < 0.2) {
+   return 0;
+   } else if (ber < 0.4) {
+   return 1;
+   } else if (ber < 0.8) {
+   return 2;
+   } else if (ber < 1.6) {
+   return 3;
+   } else if (ber < 3.2) {
+   return 4;
+   } else if (ber < 6.4) {
+   return 5;
+   } else if (ber < 12.8) {
+   return 6;
+   } else {
+   return 7;
+   }
+}
+
+/* convert RxQual to BER (TS 45.008 Chapter 8.2.4 */
+function rxqual2ber(uint3_t rxqual) return float {
+   select (rxqual) {
+   case (0) { return 0.14 }
+   case (1) { return 0.28 }
+   case (2) { return 0.57 }
+   case (3) { return 1.13 }
+   case (4) { return 2.26 }
+   case (5) { return 4.53 }
+   case (6) { return 9.05 }
+   case (7) { return 18.10 }
+   case else { return 1000.0 }
+   }
+}
+
+
 } with { encode "RAW"; variant "FIELDORDER(msb)" }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6293f6a9b73d5614cbb61c64617af4dd8afc1e73
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmo-bts[master]: measurement.c: Fix sdcch4_meas_rep_fn102 / sdcch8_meas_rep_f...

2018-02-23 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/6871

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

measurement.c: Fix sdcch4_meas_rep_fn102 / sdcch8_meas_rep_fn102

Since Change-Id: I23fba50f48415314da40cf5bf86fce2ed3e66af6 we were not
reporting measurements for SDCCH channel types due to the wrong
encoding of the sdcch{4,8}_meas_rep_fn102 table.

Let's fix the table by encoding the needed information:

 "What is the modulo-102 remainder of the first burst of the last block
  before fn%102 reaches 37?" (SDCCH/4)

 "What is the modulo-102 remainder of the first burst of the last block
  before fn%102 reaches 12?" (SDCCH/8)

The TS 45.002 Clause 7 tables have to be consulted carefully to
determine this information.

Change-Id: Icf02354872670126ab3297b787b216981ca6c309
Related: OS#2965
---
M src/common/measurement.c
1 file changed, 14 insertions(+), 15 deletions(-)


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

diff --git a/src/common/measurement.c b/src/common/measurement.c
index 69fbd94..6e9971b 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -64,25 +64,24 @@
  * SDCCH/4 37 to 36
  */
 
-/* Added interleave offset to Meas period end Fn which
- * would reduce the Meas Res msg load at Abis */
-
+/* FN of the first burst whose block completes before reaching fn%102=11 */
 static const uint8_t sdcch8_meas_rep_fn102[] = {
-   [0] = 11 + 7,
-   [1] = 11 + 11,
-   [2] = 11 + 15,
-   [3] = 11 + 19,
-   [4] = 11 + 23,
-   [5] = 11 + 27,
-   [6] = 11 + 31,
-   [7] = 11 + 35
+   [0] = 66,   /* 15(SDCCH), 47(SACCH), 66(SDCCH) */
+   [1] = 70,   /* 19(SDCCH), 51(SACCH), 70(SDCCH) */
+   [2] = 74,   /* 23(SDCCH), 55(SACCH), 74(SDCCH) */
+   [3] = 78,   /* 27(SDCCH), 59(SACCH), 78(SDCCH) */
+   [4] = 98,   /* 31(SDCCH), 98(SACCH), 82(SDCCH) */
+   [5] = 0,/* 35(SDCCH),  0(SACCH), 86(SDCCH) */
+   [6] = 4,/* 39(SDCCH),  4(SACCH), 90(SDCCH) */
+   [7] = 8,/* 43(SDCCH),  8(SACCH), 94(SDCCH) */
 };
 
+/* FN of the first burst whose block completes before reaching fn%102=37 */
 static const uint8_t sdcch4_meas_rep_fn102[] = {
-   [0] = 36 + 4,
-   [1] = 36 + 8,
-   [2] = 36 + 14,
-   [3] = 36 + 18
+   [0] = 88,   /* 37(SDCCH), 57(SACCH), 88(SDCCH) */
+   [1] = 92,   /* 41(SDCCH), 61(SACCH), 92(SDCCH) */
+   [2] = 6,/*  6(SACCH), 47(SDCCH), 98(SDCCH) */
+   [3] = 10/* 10(SACCH),  0(SDCCH), 51(SDCCH) */
 };
 
 /* Note: The reporting of the measurement results is done via the SACCH 
channel.

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

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


[PATCH] osmo-bts[master]: measurement.c: Fix sdcch4_meas_rep_fn102

2018-02-23 Thread Harald Welte

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

measurement.c: Fix sdcch4_meas_rep_fn102

Since Change-Id: I23fba50f48415314da40cf5bf86fce2ed3e66af6 we were not
reporting measurements for SDCCH/4 channel types due to the wrong
encoding of the sdcch4_meas_rep_fn102 table.

Let's fix the table by encoding the needed information:

 "What is the modulo-102 remainder of the first burst of the last block
  before fn%102 reaches 37?"

The TS 45.002 Clause 7 tables have to be consulted carefully to
determine this information.

Change-Id: Icf02354872670126ab3297b787b216981ca6c309
Related: OS#2965
---
M src/common/measurement.c
1 file changed, 5 insertions(+), 4 deletions(-)


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

diff --git a/src/common/measurement.c b/src/common/measurement.c
index 69fbd94..edb1e31 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -78,11 +78,12 @@
[7] = 11 + 35
 };
 
+/* FN of the first burst whose block completes before reaching fn%102=37 */
 static const uint8_t sdcch4_meas_rep_fn102[] = {
-   [0] = 36 + 4,
-   [1] = 36 + 8,
-   [2] = 36 + 14,
-   [3] = 36 + 18
+   [0] = 88,   /* 37(SDCCH), 57(SACCH), 88(SDCCH) */
+   [1] = 92,   /* 41(SDCCH), 61(SACCH), 92(SDCCH) */
+   [2] = 6,/* 6(SACCH), 47(SDCCH), 98(SDCCH) */
+   [3] = 10/* 10(SACCH), 0(SDCCH), 51(SDCCH) */
 };
 
 /* Note: The reporting of the measurement results is done via the SACCH 
channel.

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

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


osmo-bts[master]: scheduler.c: Print message when burst substitution happens

2018-02-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[MERGED] osmo-bts[master]: scheduler.c: Print message when burst substitution happens

2018-02-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: scheduler.c: Print message when burst substitution happens
..


scheduler.c: Print message when burst substitution happens

Whenever we receive discontinuous frame numbers from the TRX socket,
osmo-bts-trx is substituting zero-filled bursts for those frame numbers
which we missed.  Don't just do this silently, but actually log about
it, as it is an error.

Note: This [currently] happens when using a virtual air interface with trxcon
as opposed to a real SDR receiver with osmo-trx.

Change-Id: If79eab37c80647c9ab64f399fa4676d97af3e9ad
---
M src/common/scheduler.c
1 file changed, 4 insertions(+), 1 deletion(-)

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



diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index 4e48160..e6e7eaf 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -1725,8 +1725,11 @@
func(l1t, tn, fn, chan, bid, bits, nbits, rssi, toa);
} else if (chan != TRXC_RACH && !l1cs->ho_rach_detect) {
sbit_t spare[GSM_BURST_LEN];
-
memset(spare, 0, GSM_BURST_LEN);
+   /* We missed a couple of frame numbers (system 
overload?) and are now
+* substituting some zero-filled bursts for those 
bursts we missed */
+   LOGPFN(DL1P, LOGL_ERROR, fn, "Substituting all-zero 
burst (current_fn=%u, "
+   "elapsed=%u\n", current_fn, elapsed);
func(l1t, tn, fn, chan, bid, spare, GSM_BURST_LEN, 
-128, 0);
}
 

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

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


[PATCH] osmo-bts[master]: scheduler.c: Print message when burst substitution happens

2018-02-23 Thread Harald Welte

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

scheduler.c: Print message when burst substitution happens

Whenever we receive discontinuous frame numbers from the TRX socket,
osmo-bts-trx is substituting zero-filled bursts for those frame numbers
which we missed.  Don't just do this silently, but actually log about
it, as it is an error.

Note: This [currently] happens when using a virtual air interface with trxcon
as opposed to a real SDR receiver with osmo-trx.

Change-Id: If79eab37c80647c9ab64f399fa4676d97af3e9ad
---
M src/common/scheduler.c
1 file changed, 4 insertions(+), 1 deletion(-)


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

diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index 4e48160..e6e7eaf 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -1725,8 +1725,11 @@
func(l1t, tn, fn, chan, bid, bits, nbits, rssi, toa);
} else if (chan != TRXC_RACH && !l1cs->ho_rach_detect) {
sbit_t spare[GSM_BURST_LEN];
-
memset(spare, 0, GSM_BURST_LEN);
+   /* We missed a couple of frame numbers (system 
overload?) and are now
+* substituting some zero-filled bursts for those 
bursts we missed */
+   LOGPFN(DL1P, LOGL_ERROR, fn, "Substituting all-zero 
burst (current_fn=%u, "
+   "elapsed=%u\n", current_fn, elapsed);
func(l1t, tn, fn, chan, bid, spare, GSM_BURST_LEN, 
-128, 0);
}
 

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

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


Build failure of network:osmocom:nightly/osmo-trx in Debian_9.0/armv7l

2018-02-23 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_9.0/armv7l

Package network:osmocom:nightly/osmo-trx failed to build in Debian_9.0/armv7l

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-trx

Last lines of build log:
[  209s] #define HAVE_STDLIB_H 1
[  209s] #define HAVE_STRING_H 1
[  209s] #define HAVE_MEMORY_H 1
[  209s] #define HAVE_STRINGS_H 1
[  209s] #define HAVE_INTTYPES_H 1
[  209s] #define HAVE_STDINT_H 1
[  209s] #define HAVE_UNISTD_H 1
[  209s] #define HAVE_DLFCN_H 1
[  209s] #define LT_OBJDIR ".libs/"
[  209s] #define STDC_HEADERS 1
[  209s] #define HAVE_BYTESWAP_H 1
[  209s] #define TIME_WITH_SYS_TIME 1
[  209s] 
[  209s] configure: exit 1
[  209s] dh_auto_configure: ./configure --build=arm-linux-gnueabihf 
--prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man 
--infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--disable-silent-rules --libdir=${prefix}/lib/arm-linux-gnueabihf 
--libexecdir=${prefix}/lib/arm-linux-gnueabihf --disable-maintainer-mode 
--disable-dependency-tracking returned exit code 1
[  209s] debian/rules:6: recipe for target 'build' failed
[  209s] make: *** [build] Error 2
[  209s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  209s] 
[  209s] armbuild22 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
20:26:42 UTC 2018.
[  209s] 
[  209s] ### VM INTERACTION START ###
[  212s] [  200.352577] SysRq : Power Off
[  212s] [  200.353645] reboot: Power down
[  212s] qemu-system-aarch64: Failed to unlink socket 
/var/cache/obs/worker/root_4/root.monitor: Permission denied
[  212s] ### VM INTERACTION END ###
[  212s] 
[  212s] armbuild22 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
20:26:46 UTC 2018.
[  212s] 

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


Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.04/x86_64

2018-02-23 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_16.04/x86_64

Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_16.04/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-trx

Last lines of build log:
[  139s] #define HAVE_SYS_STAT_H 1
[  139s] #define HAVE_STDLIB_H 1
[  139s] #define HAVE_STRING_H 1
[  139s] #define HAVE_MEMORY_H 1
[  139s] #define HAVE_STRINGS_H 1
[  139s] #define HAVE_INTTYPES_H 1
[  139s] #define HAVE_STDINT_H 1
[  139s] #define HAVE_UNISTD_H 1
[  139s] #define HAVE_DLFCN_H 1
[  139s] #define LT_OBJDIR ".libs/"
[  139s] #define STDC_HEADERS 1
[  139s] #define HAVE_BYTESWAP_H 1
[  139s] #define TIME_WITH_SYS_TIME 1
[  139s] 
[  139s] configure: exit 1
[  139s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr 
--includedir=${prefix}/include --mandir=${prefix}/share/man 
--infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu 
--libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode 
--disable-dependency-tracking returned exit code 1
[  139s] debian/rules:6: recipe for target 'build' failed
[  139s] make: *** [build] Error 255
[  139s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  139s] 
[  139s] lamb14 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
20:05:35 UTC 2018.
[  139s] 
[  139s] ### VM INTERACTION START ###
[  142s] [  133.665486] reboot: Power down
[  142s] qemu-system-x86_64: Failed to unlink socket 
/var/cache/obs/worker/root_7/root.monitor: Permission denied
[  142s] ### VM INTERACTION END ###
[  142s] 
[  142s] lamb14 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
20:05:40 UTC 2018.
[  142s] 

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


Build failure of network:osmocom:nightly/osmo-trx in Debian_9.0/x86_64

2018-02-23 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_9.0/x86_64

Package network:osmocom:nightly/osmo-trx failed to build in Debian_9.0/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-trx

Last lines of build log:
[  144s] #define HAVE_SYS_STAT_H 1
[  144s] #define HAVE_STDLIB_H 1
[  144s] #define HAVE_STRING_H 1
[  144s] #define HAVE_MEMORY_H 1
[  144s] #define HAVE_STRINGS_H 1
[  144s] #define HAVE_INTTYPES_H 1
[  144s] #define HAVE_STDINT_H 1
[  144s] #define HAVE_UNISTD_H 1
[  144s] #define HAVE_DLFCN_H 1
[  144s] #define LT_OBJDIR ".libs/"
[  144s] #define STDC_HEADERS 1
[  144s] #define HAVE_BYTESWAP_H 1
[  144s] #define TIME_WITH_SYS_TIME 1
[  144s] 
[  144s] configure: exit 1
[  144s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr 
--includedir=${prefix}/include --mandir=${prefix}/share/man 
--infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu 
--libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode 
--disable-dependency-tracking returned exit code 1
[  144s] debian/rules:6: recipe for target 'build' failed
[  144s] make: *** [build] Error 2
[  144s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  144s] 
[  144s] lamb03 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
20:05:27 UTC 2018.
[  144s] 
[  144s] ### VM INTERACTION START ###
[  148s] [  137.892448] reboot: Power down
[  148s] qemu-system-x86_64: Failed to unlink socket 
/var/cache/obs/worker/root_2/root.monitor: Permission denied
[  148s] ### VM INTERACTION END ###
[  148s] 
[  148s] lamb03 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
20:05:31 UTC 2018.
[  148s] 

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


Build failure of network:osmocom:nightly/osmo-trx in Debian_8.0/x86_64

2018-02-23 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_8.0/x86_64

Package network:osmocom:nightly/osmo-trx failed to build in Debian_8.0/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-trx

Last lines of build log:
[  131s] #define HAVE_STDLIB_H 1
[  131s] #define HAVE_STRING_H 1
[  131s] #define HAVE_MEMORY_H 1
[  131s] #define HAVE_STRINGS_H 1
[  131s] #define HAVE_INTTYPES_H 1
[  131s] #define HAVE_STDINT_H 1
[  131s] #define HAVE_UNISTD_H 1
[  131s] #define HAVE_DLFCN_H 1
[  131s] #define LT_OBJDIR ".libs/"
[  131s] #define STDC_HEADERS 1
[  131s] #define HAVE_BYTESWAP_H 1
[  131s] #define TIME_WITH_SYS_TIME 1
[  131s] 
[  131s] configure: exit 1
[  131s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr 
--includedir=${prefix}/include --mandir=${prefix}/share/man 
--infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--libdir=${prefix}/lib/x86_64-linux-gnu 
--libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode 
--disable-dependency-tracking returned exit code 1
[  131s] debian/rules:6: recipe for target 'build' failed
[  131s] make: *** [build] Error 255
[  131s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  131s] 
[  131s] lamb20 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
20:05:25 UTC 2018.
[  131s] 
[  131s] ### VM INTERACTION START ###
[  132s] Powering off.
[  132s] [  123.932072] reboot: Power down
[  132s] qemu-system-x86_64: Failed to unlink socket 
/var/cache/obs/worker/root_3/root.monitor: Permission denied
[  132s] ### VM INTERACTION END ###
[  132s] 
[  132s] lamb20 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
20:05:26 UTC 2018.
[  132s] 

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


Build failure of network:osmocom:nightly/osmo-trx in Debian_9.0/i586

2018-02-23 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_9.0/i586

Package network:osmocom:nightly/osmo-trx failed to build in Debian_9.0/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-trx

Last lines of build log:
[  147s] #define HAVE_SYS_STAT_H 1
[  147s] #define HAVE_STDLIB_H 1
[  147s] #define HAVE_STRING_H 1
[  147s] #define HAVE_MEMORY_H 1
[  147s] #define HAVE_STRINGS_H 1
[  147s] #define HAVE_INTTYPES_H 1
[  147s] #define HAVE_STDINT_H 1
[  147s] #define HAVE_UNISTD_H 1
[  147s] #define HAVE_DLFCN_H 1
[  147s] #define LT_OBJDIR ".libs/"
[  147s] #define STDC_HEADERS 1
[  147s] #define HAVE_BYTESWAP_H 1
[  147s] #define TIME_WITH_SYS_TIME 1
[  147s] 
[  147s] configure: exit 1
[  147s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr 
--includedir=${prefix}/include --mandir=${prefix}/share/man 
--infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu 
--libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode 
--disable-dependency-tracking returned exit code 1
[  147s] debian/rules:6: recipe for target 'build' failed
[  147s] make: *** [build] Error 2
[  147s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  147s] 
[  147s] lamb09 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
20:03:57 UTC 2018.
[  147s] 
[  147s] ### VM INTERACTION START ###
[  150s] [  140.753738] reboot: Power down
[  150s] qemu-system-x86_64: Failed to unlink socket 
/var/cache/obs/worker/root_5/root.monitor: Permission denied
[  150s] ### VM INTERACTION END ###
[  150s] 
[  150s] lamb09 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
20:04:00 UTC 2018.
[  150s] 

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


Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_17.04/x86_64

2018-02-23 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_17.04/x86_64

Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_17.04/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-trx

Last lines of build log:
[  121s] #define HAVE_SYS_STAT_H 1
[  121s] #define HAVE_STDLIB_H 1
[  121s] #define HAVE_STRING_H 1
[  121s] #define HAVE_MEMORY_H 1
[  121s] #define HAVE_STRINGS_H 1
[  121s] #define HAVE_INTTYPES_H 1
[  121s] #define HAVE_STDINT_H 1
[  121s] #define HAVE_UNISTD_H 1
[  121s] #define HAVE_DLFCN_H 1
[  121s] #define LT_OBJDIR ".libs/"
[  121s] #define STDC_HEADERS 1
[  121s] #define HAVE_BYTESWAP_H 1
[  121s] #define TIME_WITH_SYS_TIME 1
[  121s] 
[  121s] configure: exit 1
[  121s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr 
--includedir=${prefix}/include --mandir=${prefix}/share/man 
--infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu 
--libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode 
--disable-dependency-tracking returned exit code 1
[  121s] debian/rules:6: recipe for target 'build' failed
[  121s] make: *** [build] Error 2
[  121s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  121s] 
[  121s] lamb15 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
20:02:16 UTC 2018.
[  121s] 
[  121s] ### VM INTERACTION START ###
[  124s] [  114.756981] reboot: Power down
[  124s] qemu-system-x86_64: Failed to unlink socket 
/var/cache/obs/worker/root_8/root.monitor: Permission denied
[  124s] ### VM INTERACTION END ###
[  124s] 
[  124s] lamb15 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
20:02:20 UTC 2018.
[  124s] 

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


Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.10/x86_64

2018-02-23 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_16.10/x86_64

Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_16.10/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-trx

Last lines of build log:
[  208s] #define HAVE_SYS_STAT_H 1
[  208s] #define HAVE_STDLIB_H 1
[  208s] #define HAVE_STRING_H 1
[  208s] #define HAVE_MEMORY_H 1
[  208s] #define HAVE_STRINGS_H 1
[  208s] #define HAVE_INTTYPES_H 1
[  208s] #define HAVE_STDINT_H 1
[  208s] #define HAVE_UNISTD_H 1
[  208s] #define HAVE_DLFCN_H 1
[  208s] #define LT_OBJDIR ".libs/"
[  208s] #define STDC_HEADERS 1
[  208s] #define HAVE_BYTESWAP_H 1
[  208s] #define TIME_WITH_SYS_TIME 1
[  208s] 
[  208s] configure: exit 1
[  208s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr 
--includedir=${prefix}/include --mandir=${prefix}/share/man 
--infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu 
--libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode 
--disable-dependency-tracking returned exit code 1
[  208s] debian/rules:6: recipe for target 'build' failed
[  208s] make: *** [build] Error 2
[  208s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  208s] 
[  208s] lamb57 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
20:02:31 UTC 2018.
[  208s] 
[  208s] ### VM INTERACTION START ###
[  211s] [  193.403192] reboot: Power down
[  211s] qemu-system-x86_64: Failed to unlink socket 
/var/cache/obs/worker/root_7/root.monitor: Permission denied
[  212s] ### VM INTERACTION END ###
[  212s] 
[  212s] lamb57 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
20:02:36 UTC 2018.
[  212s] 

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


Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.10/i586

2018-02-23 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_16.10/i586

Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_16.10/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-trx

Last lines of build log:
[  175s] #define HAVE_SYS_STAT_H 1
[  175s] #define HAVE_STDLIB_H 1
[  175s] #define HAVE_STRING_H 1
[  175s] #define HAVE_MEMORY_H 1
[  175s] #define HAVE_STRINGS_H 1
[  175s] #define HAVE_INTTYPES_H 1
[  175s] #define HAVE_STDINT_H 1
[  175s] #define HAVE_UNISTD_H 1
[  175s] #define HAVE_DLFCN_H 1
[  175s] #define LT_OBJDIR ".libs/"
[  175s] #define STDC_HEADERS 1
[  175s] #define HAVE_BYTESWAP_H 1
[  175s] #define TIME_WITH_SYS_TIME 1
[  175s] 
[  175s] configure: exit 1
[  175s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr 
--includedir=${prefix}/include --mandir=${prefix}/share/man 
--infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu 
--libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode 
--disable-dependency-tracking returned exit code 1
[  175s] debian/rules:6: recipe for target 'build' failed
[  175s] make: *** [build] Error 2
[  175s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  175s] 
[  175s] cloud122 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
20:01:42 UTC 2018.
[  175s] 
[  175s] ### VM INTERACTION START ###
[  178s] [  158.288312] reboot: Power down
[  178s] qemu-system-x86_64: Failed to unlink socket 
/var/cache/obs/worker/root_2/root.monitor: Permission denied
[  179s] ### VM INTERACTION END ###
[  179s] 
[  179s] cloud122 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
20:01:46 UTC 2018.
[  179s] 

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


Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.04/i586

2018-02-23 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_16.04/i586

Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_16.04/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-trx

Last lines of build log:
[  276s] #define HAVE_SYS_STAT_H 1
[  276s] #define HAVE_STDLIB_H 1
[  276s] #define HAVE_STRING_H 1
[  276s] #define HAVE_MEMORY_H 1
[  276s] #define HAVE_STRINGS_H 1
[  276s] #define HAVE_INTTYPES_H 1
[  276s] #define HAVE_STDINT_H 1
[  276s] #define HAVE_UNISTD_H 1
[  276s] #define HAVE_DLFCN_H 1
[  276s] #define LT_OBJDIR ".libs/"
[  276s] #define STDC_HEADERS 1
[  276s] #define HAVE_BYTESWAP_H 1
[  276s] #define TIME_WITH_SYS_TIME 1
[  276s] 
[  276s] configure: exit 1
[  276s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr 
--includedir=${prefix}/include --mandir=${prefix}/share/man 
--infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu 
--libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode 
--disable-dependency-tracking returned exit code 1
[  276s] debian/rules:6: recipe for target 'build' failed
[  276s] make: *** [build] Error 255
[  276s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  276s] 
[  276s] lamb59 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
20:01:31 UTC 2018.
[  276s] 
[  276s] ### VM INTERACTION START ###
[  278s] [  247.599051] reboot: Power down
[  278s] qemu-system-x86_64: Failed to unlink socket 
/var/cache/obs/worker/root_11/root.monitor: Permission denied
[  278s] ### VM INTERACTION END ###
[  278s] 
[  278s] lamb59 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
20:01:34 UTC 2018.
[  278s] 

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


Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_17.10/x86_64

2018-02-23 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_17.10/x86_64

Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_17.10/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-trx

Last lines of build log:
[  217s] #define HAVE_SYS_STAT_H 1
[  217s] #define HAVE_STDLIB_H 1
[  217s] #define HAVE_STRING_H 1
[  217s] #define HAVE_MEMORY_H 1
[  217s] #define HAVE_STRINGS_H 1
[  217s] #define HAVE_INTTYPES_H 1
[  217s] #define HAVE_STDINT_H 1
[  217s] #define HAVE_UNISTD_H 1
[  217s] #define HAVE_DLFCN_H 1
[  217s] #define LT_OBJDIR ".libs/"
[  217s] #define STDC_HEADERS 1
[  217s] #define HAVE_BYTESWAP_H 1
[  217s] #define TIME_WITH_SYS_TIME 1
[  217s] 
[  217s] configure: exit 1
[  217s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr 
--includedir=\${prefix}/include --mandir=\${prefix}/share/man 
--infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--disable-silent-rules --libdir=\${prefix}/lib/x86_64-linux-gnu 
--libexecdir=\${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode 
--disable-dependency-tracking returned exit code 1
[  217s] debian/rules:6: recipe for target 'build' failed
[  217s] make: *** [build] Error 2
[  217s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  217s] 
[  217s] lamb25 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
20:00:39 UTC 2018.
[  217s] 
[  217s] ### VM INTERACTION START ###
[  220s] [  204.987917] reboot: Power down
[  220s] qemu-system-x86_64: Failed to unlink socket 
/var/cache/obs/worker/root_9/root.monitor: Permission denied
[  220s] ### VM INTERACTION END ###
[  220s] 
[  220s] lamb25 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
20:00:42 UTC 2018.
[  220s] 

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


[MERGED] osmo-bts[master]: Revert "measurement: fix measurement computation"

2018-02-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Revert "measurement: fix measurement computation"
..


Revert "measurement: fix measurement computation"

This reverts commit d5fdcfe6d95f52fb76c4f4201969347a062fc9fd, which
introduces a new function lchan_meas_update_ordered_TA whose
functionality I still haven't yet managed to fully understand. It
appears to be adjusting the requested timing advance (lchan->rqd_ta) but
outside osmo-bts-trx/loops.c code. This is odd, as rqd_ta is a state
variable of that loops.c code.

So for one part, it is a failure of encapsulation. The TA loop code
should be self-contained, particularly as it is only used for
omso-bts-trx, and not for the other BTS models. The new
lchan_meas_update_ordered_TA() function is used from common code,
applicable to all BTS models.

The resulting interaction between loops.c code and this new (now
reverted) function cause the TA value to only ever grow, despite the MS
never moving at all.

Change-Id: I5a5adac6f18f94a5b51758a5ace8ef6ddfd23e80
Related: OS#2989
---
M src/common/measurement.c
M src/common/rsl.c
2 files changed, 1 insertion(+), 49 deletions(-)

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



diff --git a/src/common/measurement.c b/src/common/measurement.c
index e4b8720..4b486d3 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -240,50 +240,6 @@
return 7;
 }
 
-/* Update order  TA at end of meas period */
-static void lchan_meas_update_ordered_TA(struct gsm_lchan *lchan,
-int32_t taqb_sum)
-{
-   int32_t ms_timing_offset = 0;
-   uint8_t l1_info_valid;
-
-   l1_info_valid = lchan->meas.flags & LC_UL_M_F_L1_VALID;
-
-   if (l1_info_valid) {
-   DEBUGP(DMEAS,
-  "%s Update TA TimingOffset_Mean:%d, UL RX TA:%d, DL 
ordered TA:%d, flags:%d \n",
-  gsm_lchan_name(lchan), taqb_sum, lchan->meas.l1_info[1],
-  lchan->rqd_ta, lchan->meas.flags);
-
-   ms_timing_offset =
-   taqb_sum + (lchan->meas.l1_info[1] - lchan->rqd_ta);
-
-   if (ms_timing_offset > 0) {
-   if (lchan->rqd_ta < MEAS_MAX_TIMING_ADVANCE) {
-   /* MS is moving away from BTS.
-* So increment Ordered TA by 1 */
-   lchan->rqd_ta++;
-   }
-   } else if (ms_timing_offset < 0) {
-   if (lchan->rqd_ta > MEAS_MIN_TIMING_ADVANCE) {
-   /* MS is moving toward BTS. So decrement
-* Ordered TA by 1 */
-   lchan->rqd_ta--;
-   }
-   }
-
-   DEBUGP(DMEAS,
-  "%s New Update TA--> TimingOff_diff:%d, UL RX TA:%d, DL 
ordered TA:%d \n",
-  gsm_lchan_name(lchan), ms_timing_offset,
-  lchan->meas.l1_info[1], lchan->rqd_ta);
-   }
-
-   /* Clear L1 INFO valid flag at Meas period end */
-   lchan->meas.flags &= ~LC_UL_M_F_L1_VALID;
-
-   return;
-}
-
 int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn)
 {
struct gsm_meas_rep_unidir *mru;
@@ -338,9 +294,6 @@
taqb_sum, ber_full_sum/100,
ber_full_sum%100, irssi_full_sum, ber_sub_sum/100, 
ber_sub_sum%100,
irssi_sub_sum);
-
-   /* Update ordered TA for DL SACCH L1 Header */
-   lchan_meas_update_ordered_TA(lchan, taqb_sum);
 
/* store results */
mru = >meas.ul_res;
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 5bbd61a..8448925 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -2376,8 +2376,7 @@
msgb_tv_put(msg, RSL_IE_BS_POWER, lchan->meas.bts_tx_pwr);
if (lchan->meas.flags & LC_UL_M_F_L1_VALID) {
msgb_tv_fixed_put(msg, RSL_IE_L1_INFO, 2, lchan->meas.l1_info);
-   /* Note: L1 info valid flag is cleared by function
-* lchan_meas_update_ordered_TA() in measurement.c */
+   lchan->meas.flags &= ~LC_UL_M_F_L1_VALID;
}
msgb_tl16v_put(msg, RSL_IE_L3_INFO, l3_len, l3);
if (ms_to_valid(lchan)) {

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

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


[MERGED] osmo-bts[master]: osmo-bts-trx: Add missing frame number to l1if_process_meas_...

2018-02-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: osmo-bts-trx: Add missing frame number to 
l1if_process_meas_res()
..


osmo-bts-trx: Add missing frame number to l1if_process_meas_res()

Change-Id: I7f1322b025ce733f78ae2b958c7a2bb38b6aa6f5
---
M src/osmo-bts-trx/l1_if.c
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index 6d798d0..a5fbf5c 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -509,7 +509,7 @@
/* 100% BER is n_bits_total is 0 */
float ber = n_bits_total==0 ? 1.0 : (float)n_errors / 
(float)n_bits_total;
 
-   LOGP(DMEAS, LOGL_DEBUG, "RX L1 frame %s fn=%u chan_nr=0x%02x MS 
pwr=%ddBm rssi=%.1f dBFS "
+   LOGPFN(DMEAS, LOGL_DEBUG, fn, "RX L1 frame %s fn=%u chan_nr=0x%02x MS 
pwr=%ddBm rssi=%.1f dBFS "
"ber=%.2f%% (%d/%d bits) L1_ta=%d rqd_ta=%d toa=%.2f\n",
gsm_lchan_name(lchan), fn, chan_nr, 
ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power_ctrl.current),
rssi, ber*100, n_errors, n_bits_total, lchan->meas.l1_info[1], 
lchan->rqd_ta, toa);

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

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


[MERGED] osmo-bts[master]: l1sap: Pass is_sub from L1 primitive into the Uplink Measure...

2018-02-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: l1sap: Pass is_sub from L1 primitive into the Uplink Measurement
..


l1sap: Pass is_sub from L1 primitive into the Uplink Measurement

info_meas_ind on the L1SAP always allowed the lower layers to pass
in whether a given measurement is part of the "SUB", or not.

However, the existing l1sap code before this patch simply drops this
information, despite the measurement.c code also having "is_sub" state.

Let's make sure this state is passed from L1SAP into measurement
processing as intended.

Fact is, none of our current lower-layers actually set this is_sub flag
for their primitives passed up in L1SAP, but at least now *if* they
would set that flag, the measurement code would process it as intended.

Related: OS#2978
Change-Id: Ibed2e8d7563b471c6b5dd2214ac4765caf31ed2a
---
M src/common/l1sap.c
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index f6a04ea..3580a73 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -525,6 +525,7 @@
ulm.ta_offs_qbits = info_meas_ind->ta_offs_qbits;
ulm.ber10k = info_meas_ind->ber10k;
ulm.inv_rssi = info_meas_ind->inv_rssi;
+   ulm.is_sub = info_meas_ind->is_sub;
 
/* we assume that symbol period is 1 bit: */
set_ms_to_data(lchan, info_meas_ind->ta_offs_qbits / 4, true);

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

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


[MERGED] osmo-bts[master]: measurement.c: Hand Frame Number into measurement computation

2018-02-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: measurement.c: Hand Frame Number into measurement computation
..


measurement.c: Hand Frame Number into measurement computation

This is currently only used for logging, but will be needed for proper
RX{LEV,QUAL}-SUB reporting in upcoming patches.

Related: OS#2978
Change-Id: I07fd06e8a379cab7c0c2eb111c3f5600037d3c9e
---
M include/osmo-bts/measurement.h
M src/common/l1sap.c
M src/common/measurement.c
3 files changed, 6 insertions(+), 6 deletions(-)

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



diff --git a/include/osmo-bts/measurement.h b/include/osmo-bts/measurement.h
index 47b31a2..e32c8e8 100644
--- a/include/osmo-bts/measurement.h
+++ b/include/osmo-bts/measurement.h
@@ -4,7 +4,7 @@
 #define MEAS_MAX_TIMING_ADVANCE 63
 #define MEAS_MIN_TIMING_ADVANCE 0
 
-int lchan_new_ul_meas(struct gsm_lchan *lchan, struct bts_ul_meas *ulm);
+int lchan_new_ul_meas(struct gsm_lchan *lchan, struct bts_ul_meas *ulm, 
uint32_t fn);
 
 int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn);
 
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 01b454c..f6a04ea 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -529,7 +529,7 @@
/* we assume that symbol period is 1 bit: */
set_ms_to_data(lchan, info_meas_ind->ta_offs_qbits / 4, true);
 
-   lchan_new_ul_meas(lchan, );
+   lchan_new_ul_meas(lchan, , info_meas_ind->fn);
 
/* Check measurement period end and prepare the UL measurment
 * report at Meas period End*/
diff --git a/src/common/measurement.c b/src/common/measurement.c
index 4b486d3..69fbd94 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -181,20 +181,20 @@
 }
 
 /* receive a L1 uplink measurement from L1 */
-int lchan_new_ul_meas(struct gsm_lchan *lchan, struct bts_ul_meas *ulm)
+int lchan_new_ul_meas(struct gsm_lchan *lchan, struct bts_ul_meas *ulm, 
uint32_t fn)
 {
-   DEBUGP(DMEAS, "%s adding measurement, num_ul_meas=%d\n",
+   DEBUGPFN(DMEAS, fn, "%s adding measurement, num_ul_meas=%d\n",
gsm_lchan_name(lchan), lchan->meas.num_ul_meas);
 
if (lchan->state != LCHAN_S_ACTIVE) {
-   LOGP(DMEAS, LOGL_NOTICE,
+   LOGPFN(DMEAS, LOGL_NOTICE, fn,
 "%s measurement during state: %s, num_ul_meas=%d\n",
 gsm_lchan_name(lchan), gsm_lchans_name(lchan->state),
 lchan->meas.num_ul_meas);
}
 
if (lchan->meas.num_ul_meas >= ARRAY_SIZE(lchan->meas.uplink)) {
-   LOGP(DMEAS, LOGL_NOTICE,
+   LOGPFN(DMEAS, LOGL_NOTICE, fn,
 "%s no space for uplink measurement, num_ul_meas=%d\n",
 gsm_lchan_name(lchan), lchan->meas.num_ul_meas);
return -ENOSPC;

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

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


Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_17.04/i586

2018-02-23 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_17.04/i586

Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_17.04/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-trx

Last lines of build log:
[  125s] #define HAVE_SYS_STAT_H 1
[  125s] #define HAVE_STDLIB_H 1
[  125s] #define HAVE_STRING_H 1
[  125s] #define HAVE_MEMORY_H 1
[  125s] #define HAVE_STRINGS_H 1
[  125s] #define HAVE_INTTYPES_H 1
[  125s] #define HAVE_STDINT_H 1
[  125s] #define HAVE_UNISTD_H 1
[  125s] #define HAVE_DLFCN_H 1
[  125s] #define LT_OBJDIR ".libs/"
[  125s] #define STDC_HEADERS 1
[  125s] #define HAVE_BYTESWAP_H 1
[  125s] #define TIME_WITH_SYS_TIME 1
[  125s] 
[  125s] configure: exit 1
[  125s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr 
--includedir=${prefix}/include --mandir=${prefix}/share/man 
--infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu 
--libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode 
--disable-dependency-tracking returned exit code 1
[  125s] debian/rules:6: recipe for target 'build' failed
[  125s] make: *** [build] Error 2
[  125s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  125s] 
[  125s] lamb04 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
19:59:02 UTC 2018.
[  125s] 
[  125s] ### VM INTERACTION START ###
[  127s] [  118.404186] reboot: Power down
[  127s] qemu-system-x86_64: Failed to unlink socket 
/var/cache/obs/worker/root_3/root.monitor: Permission denied
[  127s] ### VM INTERACTION END ###
[  127s] 
[  127s] lamb04 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
19:59:06 UTC 2018.
[  127s] 

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


Build failure of network:osmocom:nightly/osmo-trx in Debian_8.0/i586

2018-02-23 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_8.0/i586

Package network:osmocom:nightly/osmo-trx failed to build in Debian_8.0/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-trx

Last lines of build log:
[  236s] #define HAVE_STDLIB_H 1
[  236s] #define HAVE_STRING_H 1
[  236s] #define HAVE_MEMORY_H 1
[  236s] #define HAVE_STRINGS_H 1
[  236s] #define HAVE_INTTYPES_H 1
[  236s] #define HAVE_STDINT_H 1
[  236s] #define HAVE_UNISTD_H 1
[  236s] #define HAVE_DLFCN_H 1
[  236s] #define LT_OBJDIR ".libs/"
[  236s] #define STDC_HEADERS 1
[  236s] #define HAVE_BYTESWAP_H 1
[  236s] #define TIME_WITH_SYS_TIME 1
[  236s] 
[  236s] configure: exit 1
[  236s] dh_auto_configure: ./configure --build=i586-linux-gnu --prefix=/usr 
--includedir=${prefix}/include --mandir=${prefix}/share/man 
--infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu 
--disable-maintainer-mode --disable-dependency-tracking returned exit code 1
[  236s] debian/rules:6: recipe for target 'build' failed
[  236s] make: *** [build] Error 255
[  236s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  236s] 
[  236s] lamb24 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
19:58:54 UTC 2018.
[  236s] 
[  236s] ### VM INTERACTION START ###
[  237s] Powering off.
[  237s] [  216.873463] reboot: Power down
[  237s] qemu-system-x86_64: Failed to unlink socket 
/var/cache/obs/worker/root_4/root.monitor: Permission denied
[  237s] ### VM INTERACTION END ###
[  237s] 
[  237s] lamb24 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
19:58:56 UTC 2018.
[  237s] 

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


Build failure of network:osmocom:nightly/osmo-trx in Debian_9.0/aarch64

2018-02-23 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_9.0/aarch64

Package network:osmocom:nightly/osmo-trx failed to build in Debian_9.0/aarch64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-trx

Last lines of build log:
[  268s] #define HAVE_STDLIB_H 1
[  268s] #define HAVE_STRING_H 1
[  268s] #define HAVE_MEMORY_H 1
[  268s] #define HAVE_STRINGS_H 1
[  268s] #define HAVE_INTTYPES_H 1
[  268s] #define HAVE_STDINT_H 1
[  268s] #define HAVE_UNISTD_H 1
[  268s] #define HAVE_DLFCN_H 1
[  268s] #define LT_OBJDIR ".libs/"
[  268s] #define STDC_HEADERS 1
[  268s] #define HAVE_BYTESWAP_H 1
[  268s] #define TIME_WITH_SYS_TIME 1
[  268s] 
[  268s] configure: exit 1
[  268s] dh_auto_configure: ./configure --build=aarch64-linux-gnu --prefix=/usr 
--includedir=${prefix}/include --mandir=${prefix}/share/man 
--infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--disable-silent-rules --libdir=${prefix}/lib/aarch64-linux-gnu 
--libexecdir=${prefix}/lib/aarch64-linux-gnu --disable-maintainer-mode 
--disable-dependency-tracking returned exit code 1
[  268s] debian/rules:6: recipe for target 'build' failed
[  268s] make: *** [build] Error 2
[  268s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  268s] 
[  268s] obs-arm-1 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
19:55:52 UTC 2018.
[  268s] 
[  268s] ### VM INTERACTION START ###
[  271s] [  248.160347] sysrq: SysRq : Power Off
[  271s] [  248.163443] reboot: Power down
[  271s] qemu-system-aarch64: Failed to unlink socket 
/var/cache/obs/worker/root_11/root.monitor: Permission denied
[  271s] ### VM INTERACTION END ###
[  271s] 
[  271s] obs-arm-1 failed "build osmo-trx_0.2.0.20180223.dsc" at Fri Feb 23 
19:55:57 UTC 2018.
[  271s] 

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


osmo-bts[master]: split scheduler_mframe.c from scheduler.c

2018-02-23 Thread Vadim Yanitskiy

Patch Set 3:

Seems, the libl1sched should be linked against libbts this way.
This would solve the problem.

But in general, I am wondering about moving the multiframe
structures to libosmogsm...

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I6a501e66c47809ae3cdc55bef2cb6390ee0096b1
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


osmo-bts[master]: osmo-bts-trx: Add missing frame number to l1if_process_meas_...

2018-02-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-bts[master]: Revert "measurement: fix measurement computation"

2018-02-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[PATCH] osmo-bts[master]: Revert "measurement: fix measurement computation"

2018-02-23 Thread Harald Welte

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

Revert "measurement: fix measurement computation"

This reverts commit d5fdcfe6d95f52fb76c4f4201969347a062fc9fd, which
introduces a new function lchan_meas_update_ordered_TA whose
functionality I still haven't yet managed to fully understand. It
appears to be adjusting the requested timing advance (lchan->rqd_ta) but
outside osmo-bts-trx/loops.c code. This is odd, as rqd_ta is a state
variable of that loops.c code.

So for one part, it is a failure of encapsulation. The TA loop code
should be self-contained, particularly as it is only used for
omso-bts-trx, and not for the other BTS models. The new
lchan_meas_update_ordered_TA() function is used from common code,
applicable to all BTS models.

The resulting interaction between loops.c code and this new (now
reverted) function cause the TA value to only ever grow, despite the MS
never moving at all.

Change-Id: I5a5adac6f18f94a5b51758a5ace8ef6ddfd23e80
Related: OS#2989
---
M src/common/measurement.c
M src/common/rsl.c
2 files changed, 1 insertion(+), 49 deletions(-)


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

diff --git a/src/common/measurement.c b/src/common/measurement.c
index e4b8720..4b486d3 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -240,50 +240,6 @@
return 7;
 }
 
-/* Update order  TA at end of meas period */
-static void lchan_meas_update_ordered_TA(struct gsm_lchan *lchan,
-int32_t taqb_sum)
-{
-   int32_t ms_timing_offset = 0;
-   uint8_t l1_info_valid;
-
-   l1_info_valid = lchan->meas.flags & LC_UL_M_F_L1_VALID;
-
-   if (l1_info_valid) {
-   DEBUGP(DMEAS,
-  "%s Update TA TimingOffset_Mean:%d, UL RX TA:%d, DL 
ordered TA:%d, flags:%d \n",
-  gsm_lchan_name(lchan), taqb_sum, lchan->meas.l1_info[1],
-  lchan->rqd_ta, lchan->meas.flags);
-
-   ms_timing_offset =
-   taqb_sum + (lchan->meas.l1_info[1] - lchan->rqd_ta);
-
-   if (ms_timing_offset > 0) {
-   if (lchan->rqd_ta < MEAS_MAX_TIMING_ADVANCE) {
-   /* MS is moving away from BTS.
-* So increment Ordered TA by 1 */
-   lchan->rqd_ta++;
-   }
-   } else if (ms_timing_offset < 0) {
-   if (lchan->rqd_ta > MEAS_MIN_TIMING_ADVANCE) {
-   /* MS is moving toward BTS. So decrement
-* Ordered TA by 1 */
-   lchan->rqd_ta--;
-   }
-   }
-
-   DEBUGP(DMEAS,
-  "%s New Update TA--> TimingOff_diff:%d, UL RX TA:%d, DL 
ordered TA:%d \n",
-  gsm_lchan_name(lchan), ms_timing_offset,
-  lchan->meas.l1_info[1], lchan->rqd_ta);
-   }
-
-   /* Clear L1 INFO valid flag at Meas period end */
-   lchan->meas.flags &= ~LC_UL_M_F_L1_VALID;
-
-   return;
-}
-
 int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn)
 {
struct gsm_meas_rep_unidir *mru;
@@ -338,9 +294,6 @@
taqb_sum, ber_full_sum/100,
ber_full_sum%100, irssi_full_sum, ber_sub_sum/100, 
ber_sub_sum%100,
irssi_sub_sum);
-
-   /* Update ordered TA for DL SACCH L1 Header */
-   lchan_meas_update_ordered_TA(lchan, taqb_sum);
 
/* store results */
mru = >meas.ul_res;
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 5bbd61a..8448925 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -2376,8 +2376,7 @@
msgb_tv_put(msg, RSL_IE_BS_POWER, lchan->meas.bts_tx_pwr);
if (lchan->meas.flags & LC_UL_M_F_L1_VALID) {
msgb_tv_fixed_put(msg, RSL_IE_L1_INFO, 2, lchan->meas.l1_info);
-   /* Note: L1 info valid flag is cleared by function
-* lchan_meas_update_ordered_TA() in measurement.c */
+   lchan->meas.flags &= ~LC_UL_M_F_L1_VALID;
}
msgb_tl16v_put(msg, RSL_IE_L3_INFO, l3_len, l3);
if (ms_to_valid(lchan)) {

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

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


[PATCH] osmo-bts[master]: osmo-bts-trx: Add missing frame number to l1if_process_meas_...

2018-02-23 Thread Harald Welte

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

osmo-bts-trx: Add missing frame number to l1if_process_meas_res()

Change-Id: I7f1322b025ce733f78ae2b958c7a2bb38b6aa6f5
---
M src/osmo-bts-trx/l1_if.c
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index 6d798d0..a5fbf5c 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -509,7 +509,7 @@
/* 100% BER is n_bits_total is 0 */
float ber = n_bits_total==0 ? 1.0 : (float)n_errors / 
(float)n_bits_total;
 
-   LOGP(DMEAS, LOGL_DEBUG, "RX L1 frame %s fn=%u chan_nr=0x%02x MS 
pwr=%ddBm rssi=%.1f dBFS "
+   LOGPFN(DMEAS, LOGL_DEBUG, fn, "RX L1 frame %s fn=%u chan_nr=0x%02x MS 
pwr=%ddBm rssi=%.1f dBFS "
"ber=%.2f%% (%d/%d bits) L1_ta=%d rqd_ta=%d toa=%.2f\n",
gsm_lchan_name(lchan), fn, chan_nr, 
ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power_ctrl.current),
rssi, ber*100, n_errors, n_bits_total, lchan->meas.l1_info[1], 
lchan->rqd_ta, toa);

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

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


osmo-bsc[master]: paging: page all bts when no cell is associated

2018-02-23 Thread Harald Welte

Patch Set 1:

would be great to include a spec reference in the commit log and possibly even 
in the code/comment. thanks!

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id85e3a7540bdc13cd0e780e7870f16c35c6a6a50
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: BSC: Add CCHAN_PT recently introduced in RSL_Emulation

2018-02-23 Thread Harald Welte

Patch Set 2: Code-Review+2

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

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


[MERGED] osmo-ttcn3-hacks[master]: L1CTL: Increase FBSB timeout to ~1s

2018-02-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: L1CTL: Increase FBSB timeout to ~1s
..


L1CTL: Increase FBSB timeout to ~1s

Change-Id: Id2bb23ae966bd9aa5fc36bfa8ba41d7f136ac88f
---
M library/L1CTL_Types.ttcn
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/library/L1CTL_Types.ttcn b/library/L1CTL_Types.ttcn
index d49f37d..f9b4fe8 100644
--- a/library/L1CTL_Types.ttcn
+++ b/library/L1CTL_Types.ttcn
@@ -366,7 +366,7 @@
payload := {
fbsb_req := {
arfcn := arfcn,
-   timeout_tdma_frames := 10,
+   timeout_tdma_frames := 250, /* about 1s */
freq_err_thresh1 := 1,
freq_err_thresh2 := 800,
num_freqerr_avg := 3,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id2bb23ae966bd9aa5fc36bfa8ba41d7f136ac88f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-ttcn3-hacks[master]: bsc: fix TC_paging_imsi_a_reset

2018-02-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: bsc: fix TC_paging_imsi_a_reset
..


bsc: fix TC_paging_imsi_a_reset

The testcase TC_paging_imsi_a_reset sends a paging request that
causes pagings on all cells. Then it performs a BSSMAP reset and
checks if the paging has stopped. In order to be sure that paging
requests from before the reset procedure are not mistakenly
detected as after-reset-pagings the RSL queue is cleared. However
this is only done for IPA_RSL[0], which means IPA_RSL[1] and
IPA_RSL[2] still contain old paging requests, which lets the test
fail.

- Clear IPA_RSL[1] and IPA_RSL[2] as well.

Change-Id: If0cdc0325fd0e1dcf3e4ce52e4de27adb4d9cf48
---
M bsc/BSC_Tests.ttcn
1 file changed, 3 insertions(+), 1 deletion(-)

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



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 52ecc1e..d94faad 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1201,7 +1201,9 @@
}
 
/* Clear the queue, it might still contain stuff like BCCH FILLING */
-   IPA_RSL[0].clear;
+   for (var integer i := 0; i < sizeof(IPA_RSL); i := i+1) {
+   IPA_RSL[i].clear;
+   }
 
/* Wait for 3 seconds if any more PAGING CMD are received on RSL */
T.start;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If0cdc0325fd0e1dcf3e4ce52e4de27adb4d9cf48
Gerrit-PatchSet: 3
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 


[MERGED] osmo-ttcn3-hacks[master]: L1CTL: Quickly fail in case of non-successful FBSB.resp

2018-02-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: L1CTL: Quickly fail in case of non-successful FBSB.resp
..


L1CTL: Quickly fail in case of non-successful FBSB.resp

Change-Id: I9d1fdb196eee7b3b06f2d3622e59d58f402dcd0d
---
M library/L1CTL_PortType.ttcn
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/library/L1CTL_PortType.ttcn b/library/L1CTL_PortType.ttcn
index dd5abc9..b82419e 100644
--- a/library/L1CTL_PortType.ttcn
+++ b/library/L1CTL_PortType.ttcn
@@ -26,6 +26,9 @@
T.start
alt {
[] pt.receive(t_L1CTL_FBSB_CONF(0)) {};
+   [] pt.receive(t_L1CTL_FBSB_CONF(?)) {
+   setverdict(fail, "FBSB Failed with non-zero 
return code");
+   };
[] pt.receive { repeat; };
[] T.timeout { setverdict(fail, "Timeout in FBSB") };
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9d1fdb196eee7b3b06f2d3622e59d58f402dcd0d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-ttcn3-hacks[master]: bsc: fix TC_paging_imsi_a_reset

2018-02-23 Thread Harald Welte

Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: If0cdc0325fd0e1dcf3e4ce52e4de27adb4d9cf48
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-HasComments: No


[MERGED] osmo-ttcn3-hacks[master]: GSM_RR_Types: Fix inverted "valid" logic in measurement report

2018-02-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: GSM_RR_Types: Fix inverted "valid" logic in measurement report
..


GSM_RR_Types: Fix inverted "valid" logic in measurement report

Change-Id: I3ebdd30639b45ba1a9c0fbda7bf2775035833300
---
M library/GSM_RR_Types.ttcn
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/library/GSM_RR_Types.ttcn b/library/GSM_RR_Types.ttcn
index 2625a1f..4d1efd7 100644
--- a/library/GSM_RR_Types.ttcn
+++ b/library/GSM_RR_Types.ttcn
@@ -695,7 +695,7 @@
dtx_used := '0'B,
rxlev_full_srv_cell := rxl_f,
threeg_ba_used := '0'B,
-   meas_valid := bool2bit(valid),
+   meas_valid := bool2bit(not valid),
rxlev_sub_srv_cell := rxl_s,
si23_ba_used := '0'B,
rxqual_full_srv_cell := rxq_f,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3ebdd30639b45ba1a9c0fbda7bf2775035833300
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-ttcn3-hacks[master]: BSC: Add CCHAN_PT recently introduced in RSL_Emulation

2018-02-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: BSC: Add CCHAN_PT recently introduced in RSL_Emulation
..


BSC: Add CCHAN_PT recently introduced in RSL_Emulation

RSL_Emulation has recently gained a port for the common channel
management messages, but BSC_Tests was not updated with this port,
resulting in RSL_Emulation enqueuing messages to the port which then
creates dynamic test case failures.

Let's simply connect to the port, even though we currently are not
interested in any of the messages received there (mainly
RSL_MT_BCCH_INFO during startup).

Change-Id: Id8a3c4409599783ca4cd0b49f2570bcb3bb34952
---
M bsc/BSC_Tests.ttcn
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 347380a..52ecc1e 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -63,6 +63,8 @@
 type component test_CT extends CTRL_Adapter_CT {
/* Array of per-BTS state */
var BTS_State bts[NUM_BTS];
+   /* RSL common Channel Port (for RSL_Emulation) */
+   port RSL_CCHAN_PT RSL_CCHAN[NUM_BTS];
/* array of per-BTS RSL test ports */
port IPA_RSL_PT IPA_RSL[NUM_BTS];
port IPA_CODEC_PT IPA; /* Required for compilation of 
TC_rsl_unknown_unit_id() */
@@ -154,6 +156,7 @@
clnt.ccm_pars.unit_id := int2str(1234+i) & "/0/0";
if (handler_mode) {
clnt.vc_RSL := RSL_Emulation_CT.create(clnt.id & "-RSL");
+   connect(clnt.vc_RSL:CCHAN_PT, self:RSL_CCHAN[i]);
}
 
map(clnt.vc_IPA:IPA_PORT, system:IPA_CODEC_PT);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id8a3c4409599783ca4cd0b49f2570bcb3bb34952
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-ttcn3-hacks[master]: RSL: Add definitions for RSL MEAS REP parsing/encoding

2018-02-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: RSL: Add definitions for RSL MEAS REP parsing/encoding
..


RSL: Add definitions for RSL MEAS REP parsing/encoding

Change-Id: Ib04b81891def2c15a62767a29b53c0fb605d45be
---
M library/RSL_Types.ttcn
1 file changed, 32 insertions(+), 0 deletions(-)

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



diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn
index b1716fd..c9fcfab 100644
--- a/library/RSL_Types.ttcn
+++ b/library/RSL_Types.ttcn
@@ -423,6 +423,19 @@
frame_nr := tr_RSL_IE_FrameNumber(frame_nr)
}
 
+   /* 9.3.25 */
+   type record RSL_IE_UplinkMeas {
+   uint8_t len,
+   BIT1 rfu,
+   boolean dtx_d,
+   uint6_t rxlev_f_u,
+   BIT2 reserved1,
+   uint6_t rxlev_s_u,
+   BIT2 reserved2,
+   uint3_t rxq_f_u,
+   uint3_t rxq_s_u,
+   octetstring supp_meas_info optional
+   } with { variant (len) 
"LENGTHTO(rfu,dtx_d,rxlev_f_u,reserved1,rxlev_s_u,reserved2,rxq_f_u,rxq_s_u,supp_meas_info)"
 };
 
/* 9.3.26 */
type enumerated RSL_Cause {
@@ -589,6 +602,8 @@
uint8_t access_delay,
RSL_IE_RachLoad rach_load,
uint8_t meas_res_nr,
+   uint8_t ms_timing_offset,
+   RSL_IE_UplinkMeas   uplink_meas,
RSL_IE_L1Info   l1_info,
RSL_IE_SysinfoType  sysinfo_type,
uint16_tpaging_load,
@@ -635,6 +650,8 @@
access_delay, iei = RSL_IE_ACCESS_DELAY;
rach_load, iei = RSL_IE_RACH_LOAD;
meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
+   ms_timing_offset, iei = 
RSL_IE_MS_TIMING_OFFSET;
+   uplink_meas, iei = RSL_IE_UPLINK_MEAS;
l1_info, iei = RSL_IE_L1_INFO;
sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
paging_load, iei = RSL_IE_PAGING_LOAD;
@@ -1007,6 +1024,21 @@
}
}
 
+   template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
+template uint8_t meas_res_nr := ?,
+template RSL_IE_UplinkMeas ul_meas 
:= ?,
+template RSL_IE_BS_Power bs_power 
:= ?) := {
+   msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+   msg_type := RSL_MT_MEAS_RES,
+   ies := {
+   tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+   tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
+   tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
+   tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
+   *
+   }
+   }
+
/* 8.4.10 BTS -> BSC */
template RSL_Message ts_RSL_MODE_MODIFY_ACK(RslChannelNr chan_nr) := {
msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib04b81891def2c15a62767a29b53c0fb605d45be
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-ttcn3-hacks[master]: RSL_Types: Add tr_RSL_MEAS_RES_OSMO()

2018-02-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: RSL_Types: Add tr_RSL_MEAS_RES_OSMO()
..


RSL_Types: Add tr_RSL_MEAS_RES_OSMO()

This is a template that goes beyond the 3GPP specs, as it expects
presence of certain optional IEs which we know are always present
in the OsmoBTS case.

Change-Id: Ibf37565ab4fe70515b598a2757953628aa780241
---
M library/RSL_Types.ttcn
1 file changed, 22 insertions(+), 0 deletions(-)

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



diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn
index c9fcfab..2cd5bd5 100644
--- a/library/RSL_Types.ttcn
+++ b/library/RSL_Types.ttcn
@@ -1039,6 +1039,28 @@
}
}
 
+   /* Osmocom specific template, require lots of optional fields to be 
present */
+   template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
+template uint8_t meas_res_nr := ?,
+template RSL_IE_UplinkMeas ul_meas 
:= ?,
+template RSL_IE_BS_Power bs_power 
:= ?,
+template RSL_IE_L1Info l1_info := 
?,
+template octetstring l3_info := ?,
+template uint8_t ms_to := ?) := {
+   msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+   msg_type := RSL_MT_MEAS_RES,
+   ies := {
+   tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+   tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
+   tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
+   tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
+   tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
+   tr_RSL_IE(RSL_IE_Body:{l3_info := 
tr_RSL_L16V(l3_info)}),
+   tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
+   }
+   }
+
+
/* 8.4.10 BTS -> BSC */
template RSL_Message ts_RSL_MODE_MODIFY_ACK(RslChannelNr chan_nr) := {
msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibf37565ab4fe70515b598a2757953628aa780241
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-bsc[master]: paging: fix paging attemt rate counter

2018-02-23 Thread Harald Welte

Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/6860/1/src/osmo-bsc/osmo_bsc_bssap.c
File src/osmo-bsc/osmo_bsc_bssap.c:

Line 463:   
rate_ctr_inc(>network->bsc_ctrs->ctr[BSC_CTR_PAGING_ATTEMPTED]);
it's called PAGING_ATTEMPTED and we should only increment it if we actually 
have attempted paging.  If mandatory IEs ar emissing (see below), we didn't 
attempt anything.

Moving it just above the "switch (cell_ident)" makes sense.  There's still some 
code paths below where we might fail before attempting to page, but I guess 
this location is a good compromise: Keep counter incremenet in shared code (and 
thus only called once) but avoid increments in the most obvious error paths.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iec3eb6724bc655806c3ce3c28448069590d99f91
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: Yes


osmo-bsc[master]: bsc_api: drop unknown RR messages.

2018-02-23 Thread Harald Welte

Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/6861/1/src/libbsc/bsc_api.c
File src/libbsc/bsc_api.c:

Line 778:"BSC: Dropping %s 04.08 RR message\n",
I think yo want the lchan->name or some other identity/context of the 
subscr-conn on *where* that message was received before it got dropped?


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0a4d311f6939a4fcee59129daa18da4a2ab510ae
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: Yes


osmo-ttcn3-hacks[master]: L1CTL: Quickly fail in case of non-successful FBSB.resp

2018-02-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9d1fdb196eee7b3b06f2d3622e59d58f402dcd0d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: RSL_Types: Add tr_RSL_MEAS_RES_OSMO()

2018-02-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibf37565ab4fe70515b598a2757953628aa780241
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: L1CTL: Increase FBSB timeout to ~1s

2018-02-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id2bb23ae966bd9aa5fc36bfa8ba41d7f136ac88f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: RSL: Add definitions for RSL MEAS REP parsing/encoding

2018-02-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib04b81891def2c15a62767a29b53c0fb605d45be
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: GSM_RR_Types: Fix inverted "valid" logic in measurement report

2018-02-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I3ebdd30639b45ba1a9c0fbda7bf2775035833300
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] osmo-ttcn3-hacks[master]: L1CTL: Increase FBSB timeout to ~1s

2018-02-23 Thread Harald Welte

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

L1CTL: Increase FBSB timeout to ~1s

Change-Id: Id2bb23ae966bd9aa5fc36bfa8ba41d7f136ac88f
---
M library/L1CTL_Types.ttcn
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/65/6865/1

diff --git a/library/L1CTL_Types.ttcn b/library/L1CTL_Types.ttcn
index d49f37d..f9b4fe8 100644
--- a/library/L1CTL_Types.ttcn
+++ b/library/L1CTL_Types.ttcn
@@ -366,7 +366,7 @@
payload := {
fbsb_req := {
arfcn := arfcn,
-   timeout_tdma_frames := 10,
+   timeout_tdma_frames := 250, /* about 1s */
freq_err_thresh1 := 1,
freq_err_thresh2 := 800,
num_freqerr_avg := 3,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id2bb23ae966bd9aa5fc36bfa8ba41d7f136ac88f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmo-ttcn3-hacks[master]: L1CTL: Quickly fail in case of non-successful FBSB.resp

2018-02-23 Thread Harald Welte

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

L1CTL: Quickly fail in case of non-successful FBSB.resp

Change-Id: I9d1fdb196eee7b3b06f2d3622e59d58f402dcd0d
---
M library/L1CTL_PortType.ttcn
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/66/6866/1

diff --git a/library/L1CTL_PortType.ttcn b/library/L1CTL_PortType.ttcn
index dd5abc9..b82419e 100644
--- a/library/L1CTL_PortType.ttcn
+++ b/library/L1CTL_PortType.ttcn
@@ -26,6 +26,9 @@
T.start
alt {
[] pt.receive(t_L1CTL_FBSB_CONF(0)) {};
+   [] pt.receive(t_L1CTL_FBSB_CONF(?)) {
+   setverdict(fail, "FBSB Failed with non-zero 
return code");
+   };
[] pt.receive { repeat; };
[] T.timeout { setverdict(fail, "Timeout in FBSB") };
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9d1fdb196eee7b3b06f2d3622e59d58f402dcd0d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmo-ttcn3-hacks[master]: RSL_Types: Add tr_RSL_MEAS_RES_OSMO()

2018-02-23 Thread Harald Welte

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

RSL_Types: Add tr_RSL_MEAS_RES_OSMO()

This is a template that goes beyond the 3GPP specs, as it expects
presence of certain optional IEs which we know are always present
in the OsmoBTS case.

Change-Id: Ibf37565ab4fe70515b598a2757953628aa780241
---
M library/RSL_Types.ttcn
1 file changed, 22 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/67/6867/1

diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn
index c9fcfab..2cd5bd5 100644
--- a/library/RSL_Types.ttcn
+++ b/library/RSL_Types.ttcn
@@ -1039,6 +1039,28 @@
}
}
 
+   /* Osmocom specific template, require lots of optional fields to be 
present */
+   template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
+template uint8_t meas_res_nr := ?,
+template RSL_IE_UplinkMeas ul_meas 
:= ?,
+template RSL_IE_BS_Power bs_power 
:= ?,
+template RSL_IE_L1Info l1_info := 
?,
+template octetstring l3_info := ?,
+template uint8_t ms_to := ?) := {
+   msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+   msg_type := RSL_MT_MEAS_RES,
+   ies := {
+   tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+   tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
+   tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
+   tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
+   tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
+   tr_RSL_IE(RSL_IE_Body:{l3_info := 
tr_RSL_L16V(l3_info)}),
+   tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
+   }
+   }
+
+
/* 8.4.10 BTS -> BSC */
template RSL_Message ts_RSL_MODE_MODIFY_ACK(RslChannelNr chan_nr) := {
msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf37565ab4fe70515b598a2757953628aa780241
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmo-ttcn3-hacks[master]: GSM_RR_Types: Fix inverted "valid" logic in measurement report

2018-02-23 Thread Harald Welte

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

GSM_RR_Types: Fix inverted "valid" logic in measurement report

Change-Id: I3ebdd30639b45ba1a9c0fbda7bf2775035833300
---
M library/GSM_RR_Types.ttcn
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/64/6864/1

diff --git a/library/GSM_RR_Types.ttcn b/library/GSM_RR_Types.ttcn
index 2625a1f..4d1efd7 100644
--- a/library/GSM_RR_Types.ttcn
+++ b/library/GSM_RR_Types.ttcn
@@ -695,7 +695,7 @@
dtx_used := '0'B,
rxlev_full_srv_cell := rxl_f,
threeg_ba_used := '0'B,
-   meas_valid := bool2bit(valid),
+   meas_valid := bool2bit(not valid),
rxlev_sub_srv_cell := rxl_s,
si23_ba_used := '0'B,
rxqual_full_srv_cell := rxq_f,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ebdd30639b45ba1a9c0fbda7bf2775035833300
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmo-ttcn3-hacks[master]: RSL: Add definitions for RSL MEAS REP parsing/encoding

2018-02-23 Thread Harald Welte

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

RSL: Add definitions for RSL MEAS REP parsing/encoding

Change-Id: Ib04b81891def2c15a62767a29b53c0fb605d45be
---
M library/RSL_Types.ttcn
1 file changed, 32 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/63/6863/1

diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn
index b1716fd..c9fcfab 100644
--- a/library/RSL_Types.ttcn
+++ b/library/RSL_Types.ttcn
@@ -423,6 +423,19 @@
frame_nr := tr_RSL_IE_FrameNumber(frame_nr)
}
 
+   /* 9.3.25 */
+   type record RSL_IE_UplinkMeas {
+   uint8_t len,
+   BIT1 rfu,
+   boolean dtx_d,
+   uint6_t rxlev_f_u,
+   BIT2 reserved1,
+   uint6_t rxlev_s_u,
+   BIT2 reserved2,
+   uint3_t rxq_f_u,
+   uint3_t rxq_s_u,
+   octetstring supp_meas_info optional
+   } with { variant (len) 
"LENGTHTO(rfu,dtx_d,rxlev_f_u,reserved1,rxlev_s_u,reserved2,rxq_f_u,rxq_s_u,supp_meas_info)"
 };
 
/* 9.3.26 */
type enumerated RSL_Cause {
@@ -589,6 +602,8 @@
uint8_t access_delay,
RSL_IE_RachLoad rach_load,
uint8_t meas_res_nr,
+   uint8_t ms_timing_offset,
+   RSL_IE_UplinkMeas   uplink_meas,
RSL_IE_L1Info   l1_info,
RSL_IE_SysinfoType  sysinfo_type,
uint16_tpaging_load,
@@ -635,6 +650,8 @@
access_delay, iei = RSL_IE_ACCESS_DELAY;
rach_load, iei = RSL_IE_RACH_LOAD;
meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
+   ms_timing_offset, iei = 
RSL_IE_MS_TIMING_OFFSET;
+   uplink_meas, iei = RSL_IE_UPLINK_MEAS;
l1_info, iei = RSL_IE_L1_INFO;
sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
paging_load, iei = RSL_IE_PAGING_LOAD;
@@ -1007,6 +1024,21 @@
}
}
 
+   template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
+template uint8_t meas_res_nr := ?,
+template RSL_IE_UplinkMeas ul_meas 
:= ?,
+template RSL_IE_BS_Power bs_power 
:= ?) := {
+   msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+   msg_type := RSL_MT_MEAS_RES,
+   ies := {
+   tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+   tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
+   tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
+   tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
+   *
+   }
+   }
+
/* 8.4.10 BTS -> BSC */
template RSL_Message ts_RSL_MODE_MODIFY_ACK(RslChannelNr chan_nr) := {
msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib04b81891def2c15a62767a29b53c0fb605d45be
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmo-ttcn3-hacks[master]: BSC: Add CCHAN_PT recently introduced in RSL_Emulation

2018-02-23 Thread Harald Welte

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

BSC: Add CCHAN_PT recently introduced in RSL_Emulation

RSL_Emulation has recently gained a port for the common channel
management messages, but BSC_Tests was not updated with this port,
resulting in RSL_Emulation enqueuing messages to the port which then
creates dynamic test case failures.

Let's simply connect to the port, even though we currently are not
interested in any of the messages received there (mainly
RSL_MT_BCCH_INFO during startup).

Change-Id: Id8a3c4409599783ca4cd0b49f2570bcb3bb34952
---
M bsc/BSC_Tests.ttcn
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/62/6862/1

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index cc7294a..d602771 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -63,6 +63,8 @@
 type component test_CT extends CTRL_Adapter_CT {
/* Array of per-BTS state */
var BTS_State bts[NUM_BTS];
+   /* RSL common Channel Port (for RSL_Emulation) */
+   port RSL_CCHAN_PT RSL_CCHAN[NUM_BTS];
/* array of per-BTS RSL test ports */
port IPA_RSL_PT IPA_RSL[NUM_BTS];
port IPA_CODEC_PT IPA; /* Required for compilation of 
TC_rsl_unknown_unit_id() */
@@ -154,6 +156,7 @@
clnt.ccm_pars.unit_id := int2str(1234+i) & "/0/0";
if (handler_mode) {
clnt.vc_RSL := RSL_Emulation_CT.create(clnt.id & "-RSL");
+   connect(clnt.vc_RSL:CCHAN_PT, self:RSL_CCHAN[i]);
}
 
map(clnt.vc_IPA:IPA_PORT, system:IPA_CODEC_PT);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8a3c4409599783ca4cd0b49f2570bcb3bb34952
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[MERGED] osmo-gsm-tester[master]: pcap_recorder: log printing pcap file name as dbg

2018-02-23 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged.

Change subject: pcap_recorder: log printing pcap file name as dbg
..


pcap_recorder: log printing pcap file name as dbg

The log message is quite long and makes it difficult to read the log
even with debug disabled.

Change-Id: I593c0ce02bf7a3a9d26cf1fcc7d523a313cb72eb
---
M src/osmo_gsm_tester/pcap_recorder.py
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_gsm_tester/pcap_recorder.py 
b/src/osmo_gsm_tester/pcap_recorder.py
index 398ec6c..98dea8b 100644
--- a/src/osmo_gsm_tester/pcap_recorder.py
+++ b/src/osmo_gsm_tester/pcap_recorder.py
@@ -37,7 +37,7 @@
 self.start()
 
 def start(self):
-self.log('Recording pcap', self.run_dir, self.filters)
+self.dbg('Recording pcap', self.run_dir, self.filters)
 dumpfile = os.path.join(os.path.abspath(self.run_dir), self.name() + 
".pcap")
 self.process = process.Process(self.name(), self.run_dir,
('tcpdump', '-n',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I593c0ce02bf7a3a9d26cf1fcc7d523a313cb72eb
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 


osmo-gsm-tester[master]: pcap_recorder: log printing pcap file name as dbg

2018-02-23 Thread Pau Espin Pedrol

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I593c0ce02bf7a3a9d26cf1fcc7d523a313cb72eb
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[PATCH] osmo-bsc[master]: bsc_api: drop unknown RR messages.

2018-02-23 Thread dexter

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

bsc_api: drop unknown RR messages.

Radio Resource (RR) handling is entirely done inside the BSC. However,
the current implementation forwards unknown RR messages to the MSC.
This is not compliant to the specification.

- Remove the forwarding and drop any unknown RR message.

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


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

diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c
index 2dc7b9a..1dbda78 100644
--- a/src/libbsc/bsc_api.c
+++ b/src/libbsc/bsc_api.c
@@ -773,14 +773,10 @@
api->dtap(conn, link_id, msg);
break;
default:
-   /* Normally, a MSC should never receive RR
-* messages, but we'd rather forward what we
-* don't know than drop it... */
+   /* Drop unknown RR message */
LOGP(DRR, LOGL_NOTICE,
-"BSC: Passing %s 04.08 RR message to MSC\n",
+"BSC: Dropping %s 04.08 RR message\n",
 gsm48_rr_msg_name(msg_type));
-   if (api->dtap)
-   api->dtap(conn, link_id, msg);
}
break;
default:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a4d311f6939a4fcee59129daa18da4a2ab510ae
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] osmo-bsc[master]: paging: fix paging attemt rate counter

2018-02-23 Thread dexter

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

paging: fix paging attemt rate counter

The rate counter BSC_CTR_PAGING_ATTEMPTED does not increment when
a paging request is sent to the BSC. The reson for this is that the
function call to rate_ctr_inc() is located in a dead code section.

- Move the function call to rate_ctr_inc() to osmo_bsc_bssmap.c.
  incremanet on any paging attempt (valid or not) that is recived
  on the A-Interface.

- Remove dead code from paging.c

Change-Id: Iec3eb6724bc655806c3ce3c28448069590d99f91
---
M src/libbsc/paging.c
M src/osmo-bsc/osmo_bsc_bssap.c
2 files changed, 3 insertions(+), 38 deletions(-)


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

diff --git a/src/libbsc/paging.c b/src/libbsc/paging.c
index 825d31e..43532d1 100644
--- a/src/libbsc/paging.c
+++ b/src/libbsc/paging.c
@@ -345,44 +345,6 @@
return 1;
 }
 
-/*! Receive a new PAGING request from the MSC
- * \param network gsm_network we operate in
- * \param[in] bsub subscriber we want to page
- * \param[in] type type of radio channel we're requirign
- * \param[in] msc MSC which has issue this paging
- * \returns number of BTSs on which we issued the paging */
-int paging_request(struct gsm_network *network, struct bsc_subscr *bsub, int 
type,
-  struct bsc_msc_data *msc)
-{
-   struct gsm_bts *bts = NULL;
-   int num_pages = 0;
-
-   rate_ctr_inc(>bsc_ctrs->ctr[BSC_CTR_PAGING_ATTEMPTED]);
-
-   /* start paging subscriber on all BTS within Location Area */
-   do {
-   int rc;
-
-   bts = gsm_bts_by_lac(network, bsub->lac, bts);
-   if (!bts)
-   break;
-
-   rc = paging_request_bts(bts, bsub, type, msc);
-   if (rc < 0) {
-   paging_request_stop(>bts_list, NULL, bsub,
-   NULL, NULL);
-   return rc;
-   }
-   num_pages += rc;
-   } while (1);
-
-   if (num_pages == 0)
-   rate_ctr_inc(>bsc_ctrs->ctr[BSC_CTR_PAGING_DETACHED]);
-
-   return num_pages;
-}
-
-
 /*! Stop paging a given subscriber on a given BTS.
  *  If \a conn is non-NULL, we also call the paging call-back function
  *  to notify the paging originator that paging has completed.
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 573625e..17a72d4 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -459,6 +459,9 @@
uint8_t chan_needed = RSL_CHANNEED_ANY;
uint8_t cell_ident;
 
+   /* Any received BSSMAP paging will count as a paging attempt */
+   rate_ctr_inc(>network->bsc_ctrs->ctr[BSC_CTR_PAGING_ATTEMPTED]);
+
tlv_parse(, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 
0, 0);
remain = payload_length - 1;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec3eb6724bc655806c3ce3c28448069590d99f91
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] osmo-gsm-tester[master]: pcap_recorder: log printing pcap file name as dbg

2018-02-23 Thread Pau Espin Pedrol

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

pcap_recorder: log printing pcap file name as dbg

The log message is quite long and makes it difficult to read the log
even with debug disabled.

Change-Id: I593c0ce02bf7a3a9d26cf1fcc7d523a313cb72eb
---
M src/osmo_gsm_tester/pcap_recorder.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/59/6859/1

diff --git a/src/osmo_gsm_tester/pcap_recorder.py 
b/src/osmo_gsm_tester/pcap_recorder.py
index 398ec6c..98dea8b 100644
--- a/src/osmo_gsm_tester/pcap_recorder.py
+++ b/src/osmo_gsm_tester/pcap_recorder.py
@@ -37,7 +37,7 @@
 self.start()
 
 def start(self):
-self.log('Recording pcap', self.run_dir, self.filters)
+self.dbg('Recording pcap', self.run_dir, self.filters)
 dumpfile = os.path.join(os.path.abspath(self.run_dir), self.name() + 
".pcap")
 self.process = process.Process(self.name(), self.run_dir,
('tcpdump', '-n',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I593c0ce02bf7a3a9d26cf1fcc7d523a313cb72eb
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[MERGED] osmo-gsm-tester[master]: modem: Identify modems by sysfs path instead of ofono dbus path

2018-02-23 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged.

Change subject: modem: Identify modems by sysfs path instead of ofono dbus path
..


modem: Identify modems by sysfs path instead of ofono dbus path

ofono dbus paths are non-deterministic and can change over time for a
given modem. For instance when ofono is restartd or if a modem crashes
and the object is destroyed and re-announced by udev.

Requires at least ofono 1df92289d4e09a1e2db0b189b5153a4c238f98f1, which
implemented the feature to export the sysfs path to modem properties.

Related: OS#2509

Change-Id: Ibc45a196abadded2706dc9d57b6a3a796b43a201
---
M example/resources.conf
M src/osmo_gsm_tester/modem.py
2 files changed, 19 insertions(+), 9 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/example/resources.conf b/example/resources.conf
index ce370a6..fb2ac9f 100644
--- a/example/resources.conf
+++ b/example/resources.conf
@@ -67,16 +67,16 @@
 band: GSM-1900
 
 modem:
-- label: sierra_1
-  path: '/sierra_1'
+- label: sierra_1st
+  path: '/sys/devices/pci:00/:00:12.2/usb1/1-1/1-1.2'
   imsi: '90170009031'
   ki: '80A37E6FDEA931EAC92FFA5F671EFEAD'
   auth_algo: 'comp128v1'
   ciphers: [a5_0, a5_1]
   features: ['sms', 'voice', 'ussd', 'gprs']
 
-- label: sierra_2
-  path: '/sierra_2'
+- label: sierra_2nd
+  path: '/sys/devices/pci:00/:00:12.2/usb1/1-1/1-1.3'
   imsi: '90170009029'
   ki: '00969E283349D354A8239E877F2E0866'
   auth_algo: 'comp128v1'
@@ -84,7 +84,7 @@
   features: ['sms', 'voice', 'ussd', 'gprs']
 
 - label: ec20
-  path: '/gobi_0'
+  path: '/sys/devices/pci:00/:00:12.2/usb1/1-1/1-1.6'
   imsi: '90170009030'
   ki: 'BB70807226393CDBAC8DD3439FF54252'
   auth_algo: 'comp128v1'
@@ -92,7 +92,7 @@
   features: ['sms', 'ussd', 'gprs']
 
 - label: gobi2k
-  path: '/gobi_3'
+  path: '/sys/devices/pci:00/:00:12.2/usb1/1-1/1-1.5'
   imsi: '90170009032'
   ki: '2F70DCA43C45ACB97E947FDD0C7CA30A'
   auth_algo: 'comp128v1'
diff --git a/src/osmo_gsm_tester/modem.py b/src/osmo_gsm_tester/modem.py
index 5afd2d1..96b65d8 100644
--- a/src/osmo_gsm_tester/modem.py
+++ b/src/osmo_gsm_tester/modem.py
@@ -92,6 +92,14 @@
 root = systembus_get('/')
 return sorted(root.GetModems())
 
+def get_dbuspath_from_syspath(syspath):
+modems = list_modems()
+for dbuspath, props in modems:
+if props.get('SystemPath', '') == syspath:
+return dbuspath
+raise ValueError('could not find %s in modem list: %s' % (syspath, modems))
+
+
 def _async_result_handler(obj, result, user_data):
 '''Generic callback dispatcher called from glib loop when an async method
 call has returned. This callback is set up by method dbus_async_call.'''
@@ -341,10 +349,12 @@
 
 def __init__(self, conf):
 self.conf = conf
-self.path = conf.get('path')
-super().__init__(log.C_TST, self.path)
+self.syspath = conf.get('path')
+self.dbuspath = get_dbuspath_from_syspath(self.syspath)
+super().__init__(log.C_TST, self.dbuspath)
+self.dbg('creating from syspath %s', self.syspath)
 self.sms_received_list = []
-self.dbus = ModemDbusInteraction(self.path)
+self.dbus = ModemDbusInteraction(self.dbuspath)
 self.register_attempts = 0
 self.call_list = []
 # one Cancellable can handle several concurrent methods.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibc45a196abadded2706dc9d57b6a3a796b43a201
Gerrit-PatchSet: 4
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 


osmo-gsm-tester[master]: modem: Identify modems by sysfs path instead of ofono dbus path

2018-02-23 Thread Pau Espin Pedrol

Patch Set 4: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibc45a196abadded2706dc9d57b6a3a796b43a201
Gerrit-PatchSet: 4
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[PATCH] osmo-gsm-tester[master]: modem: Identify modems by sysfs path instead of ofono dbus path

2018-02-23 Thread Pau Espin Pedrol
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/6858

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

modem: Identify modems by sysfs path instead of ofono dbus path

ofono dbus paths are non-deterministic and can change over time for a
given modem. For instance when ofono is restartd or if a modem crashes
and the object is destroyed and re-announced by udev.

Requires at least ofono 1df92289d4e09a1e2db0b189b5153a4c238f98f1, which
implemented the feature to export the sysfs path to modem properties.

Related: OS#2509

Change-Id: Ibc45a196abadded2706dc9d57b6a3a796b43a201
---
M example/resources.conf
M src/osmo_gsm_tester/modem.py
2 files changed, 19 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/58/6858/4

diff --git a/example/resources.conf b/example/resources.conf
index ce370a6..fb2ac9f 100644
--- a/example/resources.conf
+++ b/example/resources.conf
@@ -67,16 +67,16 @@
 band: GSM-1900
 
 modem:
-- label: sierra_1
-  path: '/sierra_1'
+- label: sierra_1st
+  path: '/sys/devices/pci:00/:00:12.2/usb1/1-1/1-1.2'
   imsi: '90170009031'
   ki: '80A37E6FDEA931EAC92FFA5F671EFEAD'
   auth_algo: 'comp128v1'
   ciphers: [a5_0, a5_1]
   features: ['sms', 'voice', 'ussd', 'gprs']
 
-- label: sierra_2
-  path: '/sierra_2'
+- label: sierra_2nd
+  path: '/sys/devices/pci:00/:00:12.2/usb1/1-1/1-1.3'
   imsi: '90170009029'
   ki: '00969E283349D354A8239E877F2E0866'
   auth_algo: 'comp128v1'
@@ -84,7 +84,7 @@
   features: ['sms', 'voice', 'ussd', 'gprs']
 
 - label: ec20
-  path: '/gobi_0'
+  path: '/sys/devices/pci:00/:00:12.2/usb1/1-1/1-1.6'
   imsi: '90170009030'
   ki: 'BB70807226393CDBAC8DD3439FF54252'
   auth_algo: 'comp128v1'
@@ -92,7 +92,7 @@
   features: ['sms', 'ussd', 'gprs']
 
 - label: gobi2k
-  path: '/gobi_3'
+  path: '/sys/devices/pci:00/:00:12.2/usb1/1-1/1-1.5'
   imsi: '90170009032'
   ki: '2F70DCA43C45ACB97E947FDD0C7CA30A'
   auth_algo: 'comp128v1'
diff --git a/src/osmo_gsm_tester/modem.py b/src/osmo_gsm_tester/modem.py
index 5afd2d1..96b65d8 100644
--- a/src/osmo_gsm_tester/modem.py
+++ b/src/osmo_gsm_tester/modem.py
@@ -92,6 +92,14 @@
 root = systembus_get('/')
 return sorted(root.GetModems())
 
+def get_dbuspath_from_syspath(syspath):
+modems = list_modems()
+for dbuspath, props in modems:
+if props.get('SystemPath', '') == syspath:
+return dbuspath
+raise ValueError('could not find %s in modem list: %s' % (syspath, modems))
+
+
 def _async_result_handler(obj, result, user_data):
 '''Generic callback dispatcher called from glib loop when an async method
 call has returned. This callback is set up by method dbus_async_call.'''
@@ -341,10 +349,12 @@
 
 def __init__(self, conf):
 self.conf = conf
-self.path = conf.get('path')
-super().__init__(log.C_TST, self.path)
+self.syspath = conf.get('path')
+self.dbuspath = get_dbuspath_from_syspath(self.syspath)
+super().__init__(log.C_TST, self.dbuspath)
+self.dbg('creating from syspath %s', self.syspath)
 self.sms_received_list = []
-self.dbus = ModemDbusInteraction(self.path)
+self.dbus = ModemDbusInteraction(self.dbuspath)
 self.register_attempts = 0
 self.call_list = []
 # one Cancellable can handle several concurrent methods.

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibc45a196abadded2706dc9d57b6a3a796b43a201
Gerrit-PatchSet: 4
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmo-gsm-tester[master]: modem: Identify modems by sysfs path instead of ofono dbus path

2018-02-23 Thread Pau Espin Pedrol
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/6858

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

modem: Identify modems by sysfs path instead of ofono dbus path

ofono dbus paths are non-deterministic and can change over time for a
given modem. For instance when ofono is restartd or if a modem crashes
and the object is destroyed and re-announced by udev.

Requires at least ofono 1df92289d4e09a1e2db0b189b5153a4c238f98f1, which
implemented the feature to export the sysfs path to modem properties.

Related: OS#2509

Change-Id: Ibc45a196abadded2706dc9d57b6a3a796b43a201
---
M example/resources.conf
M src/osmo_gsm_tester/modem.py
2 files changed, 20 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/58/6858/3

diff --git a/example/resources.conf b/example/resources.conf
index ce370a6..fb2ac9f 100644
--- a/example/resources.conf
+++ b/example/resources.conf
@@ -67,16 +67,16 @@
 band: GSM-1900
 
 modem:
-- label: sierra_1
-  path: '/sierra_1'
+- label: sierra_1st
+  path: '/sys/devices/pci:00/:00:12.2/usb1/1-1/1-1.2'
   imsi: '90170009031'
   ki: '80A37E6FDEA931EAC92FFA5F671EFEAD'
   auth_algo: 'comp128v1'
   ciphers: [a5_0, a5_1]
   features: ['sms', 'voice', 'ussd', 'gprs']
 
-- label: sierra_2
-  path: '/sierra_2'
+- label: sierra_2nd
+  path: '/sys/devices/pci:00/:00:12.2/usb1/1-1/1-1.3'
   imsi: '90170009029'
   ki: '00969E283349D354A8239E877F2E0866'
   auth_algo: 'comp128v1'
@@ -84,7 +84,7 @@
   features: ['sms', 'voice', 'ussd', 'gprs']
 
 - label: ec20
-  path: '/gobi_0'
+  path: '/sys/devices/pci:00/:00:12.2/usb1/1-1/1-1.6'
   imsi: '90170009030'
   ki: 'BB70807226393CDBAC8DD3439FF54252'
   auth_algo: 'comp128v1'
@@ -92,7 +92,7 @@
   features: ['sms', 'ussd', 'gprs']
 
 - label: gobi2k
-  path: '/gobi_3'
+  path: '/sys/devices/pci:00/:00:12.2/usb1/1-1/1-1.5'
   imsi: '90170009032'
   ki: '2F70DCA43C45ACB97E947FDD0C7CA30A'
   auth_algo: 'comp128v1'
diff --git a/src/osmo_gsm_tester/modem.py b/src/osmo_gsm_tester/modem.py
index 5afd2d1..7c6a57d 100644
--- a/src/osmo_gsm_tester/modem.py
+++ b/src/osmo_gsm_tester/modem.py
@@ -92,6 +92,15 @@
 root = systembus_get('/')
 return sorted(root.GetModems())
 
+def get_modem_by_syspath(syspath):
+root = systembus_get('/')
+modems = root.GetModems()
+for modem in modems:
+if modem.get('SystemPath', '') == syspath:
+return modem
+raise ValueError('could not find %s in modem list: %s' % (syspath, modems))
+
+
 def _async_result_handler(obj, result, user_data):
 '''Generic callback dispatcher called from glib loop when an async method
 call has returned. This callback is set up by method dbus_async_call.'''
@@ -341,10 +350,12 @@
 
 def __init__(self, conf):
 self.conf = conf
-self.path = conf.get('path')
-super().__init__(log.C_TST, self.path)
+self.syspath = conf.get('path')
+self.dbuspath = get_modem_by_syspath(self.syspath)
+super().__init__(log.C_TST, self.dbuspath)
+self.dbg('creating from syspath %s', self.syspath)
 self.sms_received_list = []
-self.dbus = ModemDbusInteraction(self.path)
+self.dbus = ModemDbusInteraction(self.dbuspath)
 self.register_attempts = 0
 self.call_list = []
 # one Cancellable can handle several concurrent methods.

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibc45a196abadded2706dc9d57b6a3a796b43a201
Gerrit-PatchSet: 3
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmo-gsm-tester[master]: modem: Identify modems by sysfs path instead of ofono dbus path

2018-02-23 Thread Pau Espin Pedrol
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/6858

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

modem: Identify modems by sysfs path instead of ofono dbus path

ofono dbus paths are non-deterministic and can change over time for a
given modem. For instance when ofono is restartd or if a modem crashes
and the object is destroyed and re-announced by udev.

Requires at least ofono 1df92289d4e09a1e2db0b189b5153a4c238f98f1, which
implemented the feature to export the sysfs path to modem properties.

Related: OS#2509

Change-Id: Ibc45a196abadded2706dc9d57b6a3a796b43a201
---
M example/resources.conf
M src/osmo_gsm_tester/modem.py
2 files changed, 19 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/58/6858/2

diff --git a/example/resources.conf b/example/resources.conf
index ce370a6..fb2ac9f 100644
--- a/example/resources.conf
+++ b/example/resources.conf
@@ -67,16 +67,16 @@
 band: GSM-1900
 
 modem:
-- label: sierra_1
-  path: '/sierra_1'
+- label: sierra_1st
+  path: '/sys/devices/pci:00/:00:12.2/usb1/1-1/1-1.2'
   imsi: '90170009031'
   ki: '80A37E6FDEA931EAC92FFA5F671EFEAD'
   auth_algo: 'comp128v1'
   ciphers: [a5_0, a5_1]
   features: ['sms', 'voice', 'ussd', 'gprs']
 
-- label: sierra_2
-  path: '/sierra_2'
+- label: sierra_2nd
+  path: '/sys/devices/pci:00/:00:12.2/usb1/1-1/1-1.3'
   imsi: '90170009029'
   ki: '00969E283349D354A8239E877F2E0866'
   auth_algo: 'comp128v1'
@@ -84,7 +84,7 @@
   features: ['sms', 'voice', 'ussd', 'gprs']
 
 - label: ec20
-  path: '/gobi_0'
+  path: '/sys/devices/pci:00/:00:12.2/usb1/1-1/1-1.6'
   imsi: '90170009030'
   ki: 'BB70807226393CDBAC8DD3439FF54252'
   auth_algo: 'comp128v1'
@@ -92,7 +92,7 @@
   features: ['sms', 'ussd', 'gprs']
 
 - label: gobi2k
-  path: '/gobi_3'
+  path: '/sys/devices/pci:00/:00:12.2/usb1/1-1/1-1.5'
   imsi: '90170009032'
   ki: '2F70DCA43C45ACB97E947FDD0C7CA30A'
   auth_algo: 'comp128v1'
diff --git a/src/osmo_gsm_tester/modem.py b/src/osmo_gsm_tester/modem.py
index 5afd2d1..301fc29 100644
--- a/src/osmo_gsm_tester/modem.py
+++ b/src/osmo_gsm_tester/modem.py
@@ -92,6 +92,14 @@
 root = systembus_get('/')
 return sorted(root.GetModems())
 
+def get_modem_by_syspath(syspath):
+modems = list_modems()
+for modem in modems:
+if modem.get('SystemPath', '') == syspath:
+return modem
+raise ValueError('could not find %s in modem list: %s' % (syspath, modems))
+
+
 def _async_result_handler(obj, result, user_data):
 '''Generic callback dispatcher called from glib loop when an async method
 call has returned. This callback is set up by method dbus_async_call.'''
@@ -341,10 +349,12 @@
 
 def __init__(self, conf):
 self.conf = conf
-self.path = conf.get('path')
-super().__init__(log.C_TST, self.path)
+self.syspath = conf.get('path')
+self.dbuspath = get_modem_by_syspath(self.syspath)
+super().__init__(log.C_TST, self.dbuspath)
+self.dbg('creating from syspath %s', self.syspath)
 self.sms_received_list = []
-self.dbus = ModemDbusInteraction(self.path)
+self.dbus = ModemDbusInteraction(self.dbuspath)
 self.register_attempts = 0
 self.call_list = []
 # one Cancellable can handle several concurrent methods.

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibc45a196abadded2706dc9d57b6a3a796b43a201
Gerrit-PatchSet: 2
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmo-gsm-tester[master]: modem: Identify modems by sysfs path instead of ofono dbus path

2018-02-23 Thread Pau Espin Pedrol

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

modem: Identify modems by sysfs path instead of ofono dbus path

ofono dbus paths are non-deterministic and can change over time for a
given modem. For instance when ofono is restartd or if a modem crashes
and the object is destroyed and re-announced by udev.

Requires at least ofono 1df92289d4e09a1e2db0b189b5153a4c238f98f1, which
implemented the feature to export the sysfs path to modem properties.

Related: OS#2509

Change-Id: Ibc45a196abadded2706dc9d57b6a3a796b43a201
---
M example/resources.conf
M src/osmo_gsm_tester/modem.py
2 files changed, 19 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/58/6858/1

diff --git a/example/resources.conf b/example/resources.conf
index ce370a6..fb2ac9f 100644
--- a/example/resources.conf
+++ b/example/resources.conf
@@ -67,16 +67,16 @@
 band: GSM-1900
 
 modem:
-- label: sierra_1
-  path: '/sierra_1'
+- label: sierra_1st
+  path: '/sys/devices/pci:00/:00:12.2/usb1/1-1/1-1.2'
   imsi: '90170009031'
   ki: '80A37E6FDEA931EAC92FFA5F671EFEAD'
   auth_algo: 'comp128v1'
   ciphers: [a5_0, a5_1]
   features: ['sms', 'voice', 'ussd', 'gprs']
 
-- label: sierra_2
-  path: '/sierra_2'
+- label: sierra_2nd
+  path: '/sys/devices/pci:00/:00:12.2/usb1/1-1/1-1.3'
   imsi: '90170009029'
   ki: '00969E283349D354A8239E877F2E0866'
   auth_algo: 'comp128v1'
@@ -84,7 +84,7 @@
   features: ['sms', 'voice', 'ussd', 'gprs']
 
 - label: ec20
-  path: '/gobi_0'
+  path: '/sys/devices/pci:00/:00:12.2/usb1/1-1/1-1.6'
   imsi: '90170009030'
   ki: 'BB70807226393CDBAC8DD3439FF54252'
   auth_algo: 'comp128v1'
@@ -92,7 +92,7 @@
   features: ['sms', 'ussd', 'gprs']
 
 - label: gobi2k
-  path: '/gobi_3'
+  path: '/sys/devices/pci:00/:00:12.2/usb1/1-1/1-1.5'
   imsi: '90170009032'
   ki: '2F70DCA43C45ACB97E947FDD0C7CA30A'
   auth_algo: 'comp128v1'
diff --git a/src/osmo_gsm_tester/modem.py b/src/osmo_gsm_tester/modem.py
index 5afd2d1..d37a358 100644
--- a/src/osmo_gsm_tester/modem.py
+++ b/src/osmo_gsm_tester/modem.py
@@ -92,6 +92,14 @@
 root = systembus_get('/')
 return sorted(root.GetModems())
 
+def get_modem_by_syspath(syspath):
+modems = list_modems()
+for modem in modems:
+if modem.get('SystemPath', '') == syspath:
+return modem
+raise ValueError('could not find %s in modem list: %s' % (syspath, modems))
+
+
 def _async_result_handler(obj, result, user_data):
 '''Generic callback dispatcher called from glib loop when an async method
 call has returned. This callback is set up by method dbus_async_call.'''
@@ -341,10 +349,12 @@
 
 def __init__(self, conf):
 self.conf = conf
-self.path = conf.get('path')
-super().__init__(log.C_TST, self.path)
+self.syspath = conf.get('path')
+self.dbuspath = get_modem_by_syspath(syspath)
+super().__init__(log.C_TST, self.dbuspath)
+self.dbg('creating from syspath %s', self.syspath)
 self.sms_received_list = []
-self.dbus = ModemDbusInteraction(self.path)
+self.dbus = ModemDbusInteraction(self.dbuspath)
 self.register_attempts = 0
 self.call_list = []
 # one Cancellable can handle several concurrent methods.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibc45a196abadded2706dc9d57b6a3a796b43a201
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[MERGED] osmo-bts[master]: scheduler: add trx_sched_is_sacch_fn() function

2018-02-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: scheduler: add trx_sched_is_sacch_fn() function
..


scheduler: add trx_sched_is_sacch_fn() function

For proper measurement processing of RX{LEV,QUAL}-SUB, we will
need this information.

Related: OS#2978
Change-Id: I768fde62452a74dce471ebf946e56eb1e4de1abc
---
M include/osmo-bts/scheduler.h
M src/common/scheduler.c
2 files changed, 43 insertions(+), 0 deletions(-)

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



diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index 9dbc946..11a30fd 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -188,4 +188,7 @@
 /* \brief close all logical channels and reset timeslots */
 void trx_sched_reset(struct l1sched_trx *l1t);
 
+/*! Determine if given frame number contains SACCH (true) or other (false) 
burst */
+bool trx_sched_is_sacch_fn(struct gsm_bts_trx_ts *ts, uint32_t fn, bool 
uplink);
+
 #endif /* TRX_SCHEDULER_H */
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index 41b5d7a..4e48160 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -1340,6 +1340,46 @@
return -1;
 }
 
+/* Determine if given frame number contains SACCH (true) or other (false) 
burst */
+bool trx_sched_is_sacch_fn(struct gsm_bts_trx_ts *ts, uint32_t fn, bool uplink)
+{
+   int i;
+   const struct trx_sched_multiframe *sched;
+   const struct trx_sched_frame *frame;
+   enum trx_chan_type ch_type;
+
+   i = find_sched_mframe_idx(ts->pchan, ts->nr);
+   if (i < 0)
+   return -EINVAL;
+   sched = _sched_multiframes[i];
+   frame = >frames[fn % sched->period];
+   if (uplink)
+   ch_type = frame->ul_chan;
+   else
+   ch_type = frame->dl_chan;
+
+   switch (ch_type) {
+   case TRXC_SACCH4_0:
+   case TRXC_SACCH4_1:
+   case TRXC_SACCH4_2:
+   case TRXC_SACCH4_3:
+   case TRXC_SACCH8_0:
+   case TRXC_SACCH8_1:
+   case TRXC_SACCH8_2:
+   case TRXC_SACCH8_3:
+   case TRXC_SACCH8_4:
+   case TRXC_SACCH8_5:
+   case TRXC_SACCH8_6:
+   case TRXC_SACCH8_7:
+   case TRXC_SACCHTF:
+   case TRXC_SACCHTH_0:
+   case TRXC_SACCHTH_1:
+   return true;
+   default:
+   return false;
+   }
+}
+
 /* set multiframe scheduler to given pchan */
 int trx_sched_set_pchan(struct l1sched_trx *l1t, uint8_t tn,
enum gsm_phys_chan_config pchan)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I768fde62452a74dce471ebf946e56eb1e4de1abc
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 


[MERGED] osmo-bts[master]: scheduler.c: Factor out find_sched_mframe_idx() function

2018-02-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: scheduler.c: Factor out find_sched_mframe_idx() function
..


scheduler.c: Factor out find_sched_mframe_idx() function

Let's split the look-up of the multiframe scheduler from the asignment
to a given l1ts in trx_sched_set_pchan.

Related: OS#2978
Change-Id: I79548b25aae647ce993a9d83c771d22b08cb1c74
---
M src/common/scheduler.c
1 file changed, 24 insertions(+), 17 deletions(-)

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



diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index efd7666..41b5d7a 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -1327,6 +1327,19 @@
  * scheduler functions
  */
 
+static int find_sched_mframe_idx(enum gsm_phys_chan_config pchan, uint8_t tn)
+{
+   int i;
+
+   for (i = 0; i < ARRAY_SIZE(trx_sched_multiframes); i++) {
+   if (trx_sched_multiframes[i].pchan == pchan
+&& (trx_sched_multiframes[i].slotmask & (1 << tn))) {
+   return i;
+   }
+   }
+   return -1;
+}
+
 /* set multiframe scheduler to given pchan */
 int trx_sched_set_pchan(struct l1sched_trx *l1t, uint8_t tn,
enum gsm_phys_chan_config pchan)
@@ -1334,24 +1347,18 @@
struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn);
int i;
 
-   for (i = 0; i < ARRAY_SIZE(trx_sched_multiframes); i++) {
-   if (trx_sched_multiframes[i].pchan == pchan
-&& (trx_sched_multiframes[i].slotmask & (1 << tn))) {
-   l1ts->mf_index = i;
-   l1ts->mf_period = trx_sched_multiframes[i].period;
-   l1ts->mf_frames = trx_sched_multiframes[i].frames;
-   LOGP(DL1C, LOGL_NOTICE, "Configuring multiframe with "
-   "%s trx=%d ts=%d\n",
-   trx_sched_multiframes[i].name,
-   l1t->trx->nr, tn);
-   return 0;
-   }
+   i = find_sched_mframe_idx(pchan, tn);
+   if (i < 0) {
+   LOGP(DL1C, LOGL_NOTICE, "Failed to configure multiframe "
+   "trx=%d ts=%d\n", l1t->trx->nr, tn);
+   return -ENOTSUP;
}
-
-   LOGP(DL1C, LOGL_NOTICE, "Failed to configure multiframe "
-   "trx=%d ts=%d\n", l1t->trx->nr, tn);
-
-   return -ENOTSUP;
+   l1ts->mf_index = i;
+   l1ts->mf_period = trx_sched_multiframes[i].period;
+   l1ts->mf_frames = trx_sched_multiframes[i].frames;
+   LOGP(DL1C, LOGL_NOTICE, "Configuring multiframe with %s trx=%d ts=%d\n",
+   trx_sched_multiframes[i].name, l1t->trx->nr, tn);
+   return 0;
 }
 
 /* setting all logical channels given attributes to active/inactive */

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I79548b25aae647ce993a9d83c771d22b08cb1c74
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 


[MERGED] osmo-bts[master]: osmo-bts-virtual: Make sure PRIM_INFO_MEAS have non-zero fra...

2018-02-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: osmo-bts-virtual: Make sure PRIM_INFO_MEAS have non-zero frame 
number
..


osmo-bts-virtual: Make sure PRIM_INFO_MEAS have non-zero frame number

Measurement reports fed into L1SAP so far had their frame number always
set to zero, resulting in higher-layer common code above L1SAP to never
detect the end of the measurement period, which in turn caused no RSL
MEAS REP to be sent.

Related: OS#2978
Change-Id: I67837d19515ea335614928570c12dd5027104c6b
---
M src/osmo-bts-virtual/l1_if.c
1 file changed, 3 insertions(+), 2 deletions(-)

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



diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c
index 01314fa..6904fe6 100644
--- a/src/osmo-bts-virtual/l1_if.c
+++ b/src/osmo-bts-virtual/l1_if.c
@@ -296,7 +296,7 @@
 
 
 static void l1if_fill_meas_res(struct osmo_phsap_prim *l1sap, uint8_t chan_nr, 
float ta,
-   float ber, float rssi)
+   float ber, float rssi, uint32_t fn)
 {
memset(l1sap, 0, sizeof(*l1sap));
osmo_prim_init(>oph, SAP_GSM_PH, PRIM_MPH_INFO,
@@ -306,6 +306,7 @@
l1sap->u.info.u.meas_ind.ta_offs_qbits = (int16_t)(ta*4);
l1sap->u.info.u.meas_ind.ber10k = (unsigned int) (ber * 1);
l1sap->u.info.u.meas_ind.inv_rssi = (uint8_t) (rssi * -1);
+   l1sap->u.info.u.meas_ind.fn = fn;
 }
 
 static int l1if_process_meas_res(struct gsm_bts_trx *trx, uint8_t tn, uint32_t 
fn, uint8_t chan_nr,
@@ -321,7 +322,7 @@
gsm_lchan_name(lchan), chan_nr, 
ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power),
rssi, ber*100, n_errors, n_bits_total, lchan->meas.l1_info[1], 
lchan->rqd_ta, toa);
 
-   l1if_fill_meas_res(, chan_nr, lchan->rqd_ta + toa, ber, rssi);
+   l1if_fill_meas_res(, chan_nr, lchan->rqd_ta + toa, ber, rssi, fn);
 
return l1sap_up(trx, );
 }

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

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


osmo-bts[master]: osmo-bts-virtual: Make sure PRIM_INFO_MEAS have non-zero fra...

2018-02-23 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


osmo-bts[master]: scheduler: add trx_sched_is_sacch_fn() function

2018-02-23 Thread Vadim Yanitskiy

Patch Set 1: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I768fde62452a74dce471ebf946e56eb1e4de1abc
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


osmo-bts[master]: scheduler.c: Factor out find_sched_mframe_idx() function

2018-02-23 Thread Vadim Yanitskiy

Patch Set 1: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I79548b25aae647ce993a9d83c771d22b08cb1c74
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: bsc: fix TC_paging_imsi_a_reset

2018-02-23 Thread dexter

Patch Set 1:

I have changed it now, but the altstep will still cover only three BTSs. Looks 
like there is no way to do this in a for-loop as well...

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

Gerrit-MessageType: comment
Gerrit-Change-Id: If0cdc0325fd0e1dcf3e4ce52e4de27adb4d9cf48
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-HasComments: No


[PATCH] osmo-bts[master]: osmo-bts-virtual: Make sure PRIM_INFO_MEAS have non-zero fra...

2018-02-23 Thread Vadim Yanitskiy
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/6678

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

osmo-bts-virtual: Make sure PRIM_INFO_MEAS have non-zero frame number

Measurement reports fed into L1SAP so far had their frame number always
set to zero, resulting in higher-layer common code above L1SAP to never
detect the end of the measurement period, which in turn caused no RSL
MEAS REP to be sent.

Related: OS#2978
Change-Id: I67837d19515ea335614928570c12dd5027104c6b
---
M src/osmo-bts-virtual/l1_if.c
1 file changed, 3 insertions(+), 2 deletions(-)


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

diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c
index 01314fa..6904fe6 100644
--- a/src/osmo-bts-virtual/l1_if.c
+++ b/src/osmo-bts-virtual/l1_if.c
@@ -296,7 +296,7 @@
 
 
 static void l1if_fill_meas_res(struct osmo_phsap_prim *l1sap, uint8_t chan_nr, 
float ta,
-   float ber, float rssi)
+   float ber, float rssi, uint32_t fn)
 {
memset(l1sap, 0, sizeof(*l1sap));
osmo_prim_init(>oph, SAP_GSM_PH, PRIM_MPH_INFO,
@@ -306,6 +306,7 @@
l1sap->u.info.u.meas_ind.ta_offs_qbits = (int16_t)(ta*4);
l1sap->u.info.u.meas_ind.ber10k = (unsigned int) (ber * 1);
l1sap->u.info.u.meas_ind.inv_rssi = (uint8_t) (rssi * -1);
+   l1sap->u.info.u.meas_ind.fn = fn;
 }
 
 static int l1if_process_meas_res(struct gsm_bts_trx *trx, uint8_t tn, uint32_t 
fn, uint8_t chan_nr,
@@ -321,7 +322,7 @@
gsm_lchan_name(lchan), chan_nr, 
ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power),
rssi, ber*100, n_errors, n_bits_total, lchan->meas.l1_info[1], 
lchan->rqd_ta, toa);
 
-   l1if_fill_meas_res(, chan_nr, lchan->rqd_ta + toa, ber, rssi);
+   l1if_fill_meas_res(, chan_nr, lchan->rqd_ta + toa, ber, rssi, fn);
 
return l1sap_up(trx, );
 }

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I67837d19515ea335614928570c12dd5027104c6b
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmo-ttcn3-hacks[master]: bsc: fix TC_paging_imsi_a_reset

2018-02-23 Thread dexter
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/6855

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

bsc: fix TC_paging_imsi_a_reset

The testcase TC_paging_imsi_a_reset sends a paging request that
causes pagings on all cells. Then it performs a BSSMAP reset and
checks if the paging has stopped. In order to be sure that paging
requests from before the reset procedure are not mistakenly
detected as after-reset-pagings the RSL queue is cleared. However
this is only done for IPA_RSL[0], which means IPA_RSL[1] and
IPA_RSL[2] still contain old paging requests, which lets the test
fail.

- Clear IPA_RSL[1] and IPA_RSL[2] as well.

Change-Id: If0cdc0325fd0e1dcf3e4ce52e4de27adb4d9cf48
---
M bsc/BSC_Tests.ttcn
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/55/6855/2

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 347380a..7ba053a 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1198,7 +1198,9 @@
}
 
/* Clear the queue, it might still contain stuff like BCCH FILLING */
-   IPA_RSL[0].clear;
+   for (var integer i := 0; i < sizeof(IPA_RSL); i := i+1) {
+   IPA_RSL[i].clear;
+   }
 
/* Wait for 3 seconds if any more PAGING CMD are received on RSL */
T.start;

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If0cdc0325fd0e1dcf3e4ce52e4de27adb4d9cf48
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-ttcn3-hacks[master]: bsc: fix testcase TC_paging_imsi_nochan

2018-02-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: bsc: fix testcase TC_paging_imsi_nochan
..


bsc: fix testcase TC_paging_imsi_nochan

The testcase TC_paging_imsi_nochan assumes that a paging for no
channel, with no specifc cell associated and without TMSI is
illegal. This is not correct. All these fields have legal values
and the TMSI field is optional.

- Replace the testcase implementation, use f_pageing_helper() to
  create the paging.

Change-Id: I6a56fb0ee06ae7e72a7ac2b6b058ad54f94127ab
---
M bsc/BSC_Tests.ttcn
1 file changed, 1 insertion(+), 25 deletions(-)

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



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index cc7294a..347380a 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1007,31 +1007,7 @@
 testcase TC_paging_imsi_nochan() runs on test_CT {
var BSSMAP_FIELD_CellIdentificationList cid_list;
cid_list := valueof(ts_BSSMAP_CIL_noCell);
-   var integer i;
-
-   f_init();
-
-   /* Clear the queue, it might still contain stuff like BCCH FILLING */
-   for (i := 0; i < NUM_BTS; i := i + 1) {
-   IPA_RSL[i].clear;
-   }
-
-   f_bssap_tx_ud(ts_BSSMAP_Paging('001010123456789'H, cid_list, omit, 
omit));
-
-   /* wait for some time until when paging messages would appear */
-   f_sleep(3.0);
-
-   for (i := 0; i < NUM_BTS; i := i + 1) {
-   timer T := 0.01;
-   T.start;
-   alt {
-   [] IPA_RSL[i].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, 
tr_RSL_PAGING_CMD(?))) {
-   setverdict(fail, "Received unexpected paging");
-   }
-   [] T.timeout {}
-   }
-   }
-   setverdict(pass);
+   f_pageing_helper('00101010001'H, cid_list, c_BtsId_all, omit, omit);
 }
 
 /* PAGING by IMSI + TMSI */

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6a56fb0ee06ae7e72a7ac2b6b058ad54f94127ab
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-ttcn3-hacks[master]: bsc: fix testcase TC_paging_imsi_nochan

2018-02-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I6a56fb0ee06ae7e72a7ac2b6b058ad54f94127ab
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: bsc: fix TC_paging_imsi_a_reset

2018-02-23 Thread Harald Welte

Patch Set 1:

Nice catch!

n order to make the patch more future-proof, it would be better to iterate over 
the array using "for (var integer i := 0; i < sizeof(IPA_RSL); i := i+1)".

This way, even if we have more than 3 BTSs in the future, the code will remain 
to work.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: If0cdc0325fd0e1dcf3e4ce52e4de27adb4d9cf48
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-bts[master]: l1sap: Pass is_sub from L1 primitive into the Uplink Measure...

2018-02-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-bts[master]: measurement: Compute RX{LEV, QUAL}-SUB for SDCCH and non-AMR TCH

2018-02-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-bts[master]: measurement.c: Hand Frame Number into measurement computation

2018-02-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-bts[master]: measurement.c: Don't silently copy "FULL" measurements to "SUB"

2018-02-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-bts[master]: osmo-bts-virtual: Make sure PRIM_INFO_MEAS have non-zero fra...

2018-02-23 Thread Harald Welte

Patch Set 2: Code-Review+2

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

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


osmo-bts[master]: scheduler.c: Factor out find_sched_mframe_idx() function

2018-02-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-bts[master]: scheduler: add trx_sched_is_sacch_fn() function

2018-02-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[PATCH] osmo-bts[master]: measurement.c: Don't silently copy "FULL" measurements to "SUB"

2018-02-23 Thread Harald Welte

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

measurement.c: Don't silently copy "FULL" measurements to "SUB"

The existing code contained an ugly hack that if we didn't have any
"SUB" measurements we would simply use the "FULL" values.  That's wrong
as TS 45.008 contains quite detailed rules on how the "SUB" values are
to be computed.  In some cases, they are identical to "FULL", but in
most they are not.

Let's remove the hack and replace it with an ERROR message, as clearly
something is wrong if we ever encounter a measurement period end in
which no single "SUB" measurement was received.  The only situation in
which this can occur is if the related uplink burst/block was missing,
so let's set BER to 100% and level to lowest possible.

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


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

diff --git a/src/common/measurement.c b/src/common/measurement.c
index 1406fef..85c5515 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -425,8 +425,11 @@
ber_sub_sum = ber_sub_sum / num_meas_sub;
irssi_sub_sum = irssi_sub_sum / num_meas_sub;
} else {
-   ber_sub_sum = ber_full_sum;
-   irssi_sub_sum = irssi_full_sum;
+   LOGP(DMEAS, LOGL_ERROR, "%s No measurements for SUB!!!\n", 
gsm_lchan_name(lchan));
+   /* The only situation in which this can occur is if the related 
uplink burst/block was
+* missing, so let's set BER to 100% and level to lowest 
possible. */
+   ber_sub_sum = 1; /* 100% */
+   irssi_sub_sum = 120; /* -120 dBm */
}
 
LOGP(DMEAS, LOGL_INFO, "%s Computed TA(% 4dqb) BER-FULL(%2u.%02u%%), 
RSSI-FULL(-%3udBm), "

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

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


[PATCH] osmo-bts[master]: measurement: Compute RX{LEV, QUAL}-SUB for SDCCH and non-AMR TCH

2018-02-23 Thread Harald Welte

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

measurement: Compute RX{LEV,QUAL}-SUB for SDCCH and non-AMR TCH

The rules on how to compute RX{LEV,QUAL}-SUB are rather convoluted, and
depend on the detailed channel type and mode.

For SDCCH and TCH/H in signalling mode, it's easy: No DTX is allowed,
and all measurements are used in SUB.

For non-AMR (TCH/F and TCH/H in non-signalling mode), we need to count
the SACCH block measurements, as well as any
SID/SID_UPDATE/L3_FILL/DUMMY blocks received in the blocks of table
8.3 of TS 45.008.

Only AMR (TCH/AFS + TCH/AHS) are more difficult, as there are no fixed
blocks/bursts/frames that always contain uplink messages, but the L1
will have to determine if a valid SID_UPDATE was received or not.

This patch implements the above rules (except AMR related) in the common
part of OsmoBTS.  The AMR specific bits will have to follow as a later
patch, likely in a BTS specific way, i.e. separate changes to
sysmo/lc15/octphy/trx code.

Related: OS#2978
Change-Id: I16eb3747a1c23df935a4c50dafe46abce512a474
---
M src/common/measurement.c
1 file changed, 99 insertions(+), 3 deletions(-)


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

diff --git a/src/common/measurement.c b/src/common/measurement.c
index 4e9a534..1406fef 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -7,6 +7,97 @@
 #include 
 #include 
 #include 
+#include 
+
+/* Tables as per TS 45.008 Section 8.3 */
+static const uint8_t ts45008_83_tch_f[] = { 52, 53, 54, 55, 56, 57, 58, 59 };
+static const uint8_t ts45008_83_tch_hs0[] = { 0, 2, 4, 6, 52, 54, 56, 58 };
+static const uint8_t ts45008_83_tch_hs1[] = { 14, 16, 18, 29, 66, 68, 70, 72 };
+
+/* find out if an array contains a given key as element */
+#define ARRAY_CONTAINS(arr, val) array_contains(arr, ARRAY_SIZE(arr), val)
+static bool array_contains(const uint8_t *arr, unsigned int len, uint8_t val) {
+   int i;
+   for (i = 0; i < len; i++) {
+   if (arr[i] == val)
+   return true;
+   }
+   return false;
+}
+
+/* Decide if a given frame number is part of the "-SUB" measurements (true) or 
not (false) */
+static bool ts45008_83_is_sub(struct gsm_lchan *lchan, uint32_t fn, bool 
is_amr_sid_update)
+{
+   uint32_t fn104 = fn % 104;
+
+   /* See TS 45.008 Sections 8.3 and 8.4 for a detailed descriptions of 
the rules
+* implemented here. We only implement the logic for Voice, not CSD */
+
+   switch (lchan->type) {
+   case GSM_LCHAN_TCH_F:
+   switch (lchan->tch_mode) {
+   case GSM48_CMODE_SIGN:
+   case GSM48_CMODE_SPEECH_V1:
+   case GSM48_CMODE_SPEECH_EFR:
+   if (trx_sched_is_sacch_fn(lchan->ts, fn, true))
+   return true;
+   if (ARRAY_CONTAINS(ts45008_83_tch_f, fn104))
+   return true;
+   break;
+   case GSM48_CMODE_SPEECH_AMR:
+   if (trx_sched_is_sacch_fn(lchan->ts, fn, true))
+   return true;
+   if (is_amr_sid_update)
+   return true;
+   break;
+   default:
+   LOGPFN(DMEAS, LOGL_ERROR, fn, "%s: Unsupported 
lchan->tch_mode %u\n",
+   gsm_lchan_name(lchan), lchan->tch_mode);
+   break;
+   }
+   break;
+   case GSM_LCHAN_TCH_H:
+   switch (lchan->tch_mode) {
+   case GSM48_CMODE_SPEECH_V1:
+   if (trx_sched_is_sacch_fn(lchan->ts, fn, true))
+   return true;
+   switch (lchan->nr) {
+   case 0:
+   if (ARRAY_CONTAINS(ts45008_83_tch_hs0, fn104))
+   return true;
+   break;
+   case 1:
+   if (ARRAY_CONTAINS(ts45008_83_tch_hs1, fn104))
+   return true;
+   break;
+   default:
+   OSMO_ASSERT(0);
+   }
+   break;
+   case GSM48_CMODE_SPEECH_AMR:
+   if (trx_sched_is_sacch_fn(lchan->ts, fn, true))
+   return true;
+   if (is_amr_sid_update)
+   return true;
+   break;
+   case GSM48_CMODE_SIGN:
+   /* No DTX allowed; SUB=FULL, therefore measurements at 
all frame numbers are
+* SUB */
+   return true;
+   default:
+   LOGPFN(DMEAS, LOGL_ERROR, fn, "%s: Unsupported 
lchan->tch_mode %u\n",
+  

[PATCH] osmo-ttcn3-hacks[master]: bsc: fix TC_paging_imsi_a_reset

2018-02-23 Thread dexter

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

bsc: fix TC_paging_imsi_a_reset

The testcase TC_paging_imsi_a_reset sends a paging request that
causes pagings on all cells. Then it performs a BSSMAP reset and
checks if the paging has stopped. In order to be sure that paging
requests from before the reset procedure are not mistakenly
detected as after-reset-pagings the RSL queue is cleared. However
this is only done for IPA_RSL[0], which means IPA_RSL[1] and
IPA_RSL[2] still contain old paging requests, which lets the test
fail.

- Clear IPA_RSL[1] and IPA_RSL[2] as well.

Change-Id: If0cdc0325fd0e1dcf3e4ce52e4de27adb4d9cf48
---
M bsc/BSC_Tests.ttcn
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/55/6855/1

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 347380a..391a793 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1199,6 +1199,8 @@
 
/* Clear the queue, it might still contain stuff like BCCH FILLING */
IPA_RSL[0].clear;
+   IPA_RSL[1].clear;
+   IPA_RSL[2].clear;
 
/* Wait for 3 seconds if any more PAGING CMD are received on RSL */
T.start;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If0cdc0325fd0e1dcf3e4ce52e4de27adb4d9cf48
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] osmo-bts[master]: l1sap: Pass is_sub from L1 primitive into the Uplink Measure...

2018-02-23 Thread Harald Welte

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

l1sap: Pass is_sub from L1 primitive into the Uplink Measurement

info_meas_ind on the L1SAP always allowed the lower layers to pass
in whether a given measurement is part of the "SUB", or not.

However, the existing l1sap code before this patch simply drops this
information, despite the measurement.c code also having "is_sub" state.

Let's make sure this state is passed from L1SAP into measurement
processing as intended.

Fact is, none of our current lower-layers actually set this is_sub flag
for their primitives passed up in L1SAP, but at least now *if* they
would set that flag, the measurement code would process it as intended.

Related: OS#2978
Change-Id: Ibed2e8d7563b471c6b5dd2214ac4765caf31ed2a
---
M src/common/l1sap.c
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index f6a04ea..3580a73 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -525,6 +525,7 @@
ulm.ta_offs_qbits = info_meas_ind->ta_offs_qbits;
ulm.ber10k = info_meas_ind->ber10k;
ulm.inv_rssi = info_meas_ind->inv_rssi;
+   ulm.is_sub = info_meas_ind->is_sub;
 
/* we assume that symbol period is 1 bit: */
set_ms_to_data(lchan, info_meas_ind->ta_offs_qbits / 4, true);

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

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


  1   2   >