Change in osmo-bsc[master]: vty: reassign: add missing check for valid target lchan

2021-06-14 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/24664 )

Change subject: vty: reassign: add missing check for valid target lchan
..

vty: reassign: add missing check for valid target lchan

Make sure that the target lchan has been initialized before attempting
to reassign.

I ran into this in the VAMOS tests, forgetting to set the BTS_FEAT_VAMOS
in osmo-bts-omldummy: the vty command from ttcn attempts to reassign to
a non-initialized lchan, and aborts osmo-bsc.

Change-Id: Ia77a3312dde0e4b8df9ad2f9266bae06439d
---
M src/osmo-bsc/bsc_vty.c
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  neels: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 430863b..880bd94 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -6657,6 +6657,10 @@
vty_out(vty, "cannot re-assign, source lchan is not in 
ESTABLISHED state%s", VTY_NEWLINE);
return CMD_WARNING;
}
+   if (!to_lchan->fi) {
+   vty_out(vty, "cannot re-assign, target lchan is not 
initialized%s", VTY_NEWLINE);
+   return CMD_WARNING;
+   }
if (!lchan_state_is(to_lchan, LCHAN_ST_UNUSED)) {
vty_out(vty, "cannot re-assign, target lchan is already in 
use%s", VTY_NEWLINE);
return CMD_WARNING;

--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24664
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ia77a3312dde0e4b8df9ad2f9266bae06439d
Gerrit-Change-Number: 24664
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels 
Gerrit-MessageType: merged


Change in osmo-bsc[master]: fixup for vamos: fix wrong cbits in rsl_lchan_lookup()

2021-06-14 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/24663 )

Change subject: fixup for vamos: fix wrong cbits in rsl_lchan_lookup()
..

fixup for vamos: fix wrong cbits in rsl_lchan_lookup()

The RSL_CHAN_OSMO_VAMOS_MASK mask applies to the chan_nr,
but the cbits variable in rsl_lchan_lookup() is chan_nr >> 3.
So the mask didn't do its job. Now it does.

A bit embarrassing how i took the suggestion to use this mask and put it
into code without testing it. It looked good enough...

Change-Id: I005c5f319bb6f14651aeb613cdff52e79f761913
---
M src/osmo-bsc/bts_trx.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  neels: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bsc/bts_trx.c b/src/osmo-bsc/bts_trx.c
index f183742..edd52be 100644
--- a/src/osmo-bsc/bts_trx.c
+++ b/src/osmo-bsc/bts_trx.c
@@ -170,7 +170,7 @@
case ABIS_RSL_CHAN_NR_CBITS_OSMO_VAMOS_Bm_ACCHs:
case ABIS_RSL_CHAN_NR_CBITS_OSMO_VAMOS_Lm_ACCHs(0):
case ABIS_RSL_CHAN_NR_CBITS_OSMO_VAMOS_Lm_ACCHs(1):
-   cbits &= ~RSL_CHAN_OSMO_VAMOS_MASK;
+   cbits = (chan_nr & ~RSL_CHAN_OSMO_VAMOS_MASK) >> 3;
vamos = true;
break;
default:

--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24663
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I005c5f319bb6f14651aeb613cdff52e79f761913
Gerrit-Change-Number: 24663
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels 
Gerrit-MessageType: merged


Change in osmo-bsc[master]: vty: reassign: add missing check for valid target lchan

2021-06-14 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/24664 )

Change subject: vty: reassign: add missing check for valid target lchan
..


Patch Set 1: Code-Review+2

let me merge this fix


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24664
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ia77a3312dde0e4b8df9ad2f9266bae06439d
Gerrit-Change-Number: 24664
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: neels 
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Mon, 14 Jun 2021 22:33:02 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: fixup for vamos: fix wrong cbits in rsl_lchan_lookup()

2021-06-14 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/24663 )

Change subject: fixup for vamos: fix wrong cbits in rsl_lchan_lookup()
..


Patch Set 1: Code-Review+2

let me just merge this


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24663
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I005c5f319bb6f14651aeb613cdff52e79f761913
Gerrit-Change-Number: 24663
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: neels 
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Mon, 14 Jun 2021 22:32:12 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmocom-bb[master]: trxcon/scheduler: introduce and use struct sched_burst_req

2021-06-14 Thread fixeria
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/c/osmocom-bb/+/24661

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

Change subject: trxcon/scheduler: introduce and use struct sched_burst_req
..

trxcon/scheduler: introduce and use struct sched_burst_req

Similar to what we do in osmo-bts-trx, group everything related to
a to be transmitted burst into a structure.  Pass a pointer to this
structure to the logical channel handlers.  Thus makes the code
easier to read, and facilitates sending NOPE indications to the
transceiver (will be introduced in the upcoming patch).

Get rid of sched_trx_handle_tx_burst(), and instead just call
sched_trx_a5_burst_enc() directly from sched_frame_clck_cb().

Change-Id: Id45b27180c233fdc42ae1ef0b195554dd299a056
Related: SYS#5313, OS#1569
---
M src/host/trxcon/sched_lchan_desc.c
M src/host/trxcon/sched_lchan_pdtch.c
M src/host/trxcon/sched_lchan_rach.c
M src/host/trxcon/sched_lchan_tchf.c
M src/host/trxcon/sched_lchan_tchh.c
M src/host/trxcon/sched_lchan_xcch.c
M src/host/trxcon/sched_trx.c
M src/host/trxcon/sched_trx.h
M src/host/trxcon/trx_if.c
M src/host/trxcon/trx_if.h
10 files changed, 146 insertions(+), 162 deletions(-)


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Id45b27180c233fdc42ae1ef0b195554dd299a056
Gerrit-Change-Number: 24661
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in osmo-bsc[master]: vty: reassign: add missing check for valid target lchan

2021-06-14 Thread neels
neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/24664 )


Change subject: vty: reassign: add missing check for valid target lchan
..

vty: reassign: add missing check for valid target lchan

Make sure that the target lchan has been initialized before attempting
to reassign.

I ran into this in the VAMOS tests, forgetting to set the BTS_FEAT_VAMOS
in osmo-bts-omldummy: the vty command from ttcn attempts to reassign to
a non-initialized lchan, and aborts osmo-bsc.

Change-Id: Ia77a3312dde0e4b8df9ad2f9266bae06439d
---
M src/osmo-bsc/bsc_vty.c
1 file changed, 4 insertions(+), 0 deletions(-)



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

diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 430863b..880bd94 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -6657,6 +6657,10 @@
vty_out(vty, "cannot re-assign, source lchan is not in 
ESTABLISHED state%s", VTY_NEWLINE);
return CMD_WARNING;
}
+   if (!to_lchan->fi) {
+   vty_out(vty, "cannot re-assign, target lchan is not 
initialized%s", VTY_NEWLINE);
+   return CMD_WARNING;
+   }
if (!lchan_state_is(to_lchan, LCHAN_ST_UNUSED)) {
vty_out(vty, "cannot re-assign, target lchan is already in 
use%s", VTY_NEWLINE);
return CMD_WARNING;

--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24664
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ia77a3312dde0e4b8df9ad2f9266bae06439d
Gerrit-Change-Number: 24664
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-MessageType: newchange


Change in osmo-bsc[master]: fixup for vamos: fix wrong cbits in rsl_lchan_lookup()

2021-06-14 Thread neels
neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/24663 )


Change subject: fixup for vamos: fix wrong cbits in rsl_lchan_lookup()
..

fixup for vamos: fix wrong cbits in rsl_lchan_lookup()

The RSL_CHAN_OSMO_VAMOS_MASK mask applies to the chan_nr,
but the cbits variable in rsl_lchan_lookup() is chan_nr >> 3.
So the mask didn't do its job. Now it does.

A bit embarrassing how i took the suggestion to use this mask and put it
into code without testing it. It looked good enough...

Change-Id: I005c5f319bb6f14651aeb613cdff52e79f761913
---
M src/osmo-bsc/bts_trx.c
1 file changed, 1 insertion(+), 1 deletion(-)



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

diff --git a/src/osmo-bsc/bts_trx.c b/src/osmo-bsc/bts_trx.c
index f183742..edd52be 100644
--- a/src/osmo-bsc/bts_trx.c
+++ b/src/osmo-bsc/bts_trx.c
@@ -170,7 +170,7 @@
case ABIS_RSL_CHAN_NR_CBITS_OSMO_VAMOS_Bm_ACCHs:
case ABIS_RSL_CHAN_NR_CBITS_OSMO_VAMOS_Lm_ACCHs(0):
case ABIS_RSL_CHAN_NR_CBITS_OSMO_VAMOS_Lm_ACCHs(1):
-   cbits &= ~RSL_CHAN_OSMO_VAMOS_MASK;
+   cbits = (chan_nr & ~RSL_CHAN_OSMO_VAMOS_MASK) >> 3;
vamos = true;
break;
default:

--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24663
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I005c5f319bb6f14651aeb613cdff52e79f761913
Gerrit-Change-Number: 24663
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-MessageType: newchange


Change in osmocom-bb[master]: trxcon/trx_if: send NOPE indications if there is no burst

2021-06-14 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/24662 )


Change subject: trxcon/trx_if: send NOPE indications if there is no burst
..

trxcon/trx_if: send NOPE indications if there is no burst

In a typical setup operating on the real radio interface, it's
the duty of the transceiver (e.g. osmo-trx) to send NOPE.ind to
the L1 implementation (e.g. osmo-bts-trx).  However, in a
virtual environment for ttcn3-bts-test we use a fake transceiver,
which due to its simplicity cannot send NOPE indications itself.

The lack of queues and buffering does not allow us to implement
NOPE indications in fake_trx.py, so the easiest approach is to
generate them from trxcon.  Send TRXD PDUs without the burst bits,
and fake_trx.py will tranform them info NOPE.ind for us.

Change-Id: I1c7f1315b8ef44f651efd6a22fb5b854f65c0946
Related: SYS#5313, OS#1569
---
M src/host/trxcon/trx_if.c
1 file changed, 4 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/62/24662/1

diff --git a/src/host/trxcon/trx_if.c b/src/host/trxcon/trx_if.c
index c4561ce..8dbbd12 100644
--- a/src/host/trxcon/trx_if.c
+++ b/src/host/trxcon/trx_if.c
@@ -635,9 +635,6 @@
uint8_t buf[TRXD_BUF_SIZE];
size_t length;

-   if (br->burst_len == 0)
-   return 0;
-
/**
 * We must be sure that we have clock,
 * and we have sent all control data
@@ -662,8 +659,10 @@
length = 6;

/* Copy ubits {0,1} */
-   memcpy(buf + 6, br->burst, br->burst_len);
-   length += br->burst_len;
+   if (br->burst_len != 0) {
+   memcpy(buf + 6, br->burst, br->burst_len);
+   length += br->burst_len;
+   }

/* Send data to transceiver */
send(trx->trx_ofd_data.fd, buf, length, 0);

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I1c7f1315b8ef44f651efd6a22fb5b854f65c0946
Gerrit-Change-Number: 24662
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Change in osmocom-bb[master]: trx_toolkit/transceiver.py: allow NOPE.ind on inactive timeslots

2021-06-14 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/24659 )


Change subject: trx_toolkit/transceiver.py: allow NOPE.ind on inactive timeslots
..

trx_toolkit/transceiver.py: allow NOPE.ind on inactive timeslots

Change-Id: I27a3c8897cb82f6c264d34702c4ec64561bb9809
Related: SYS#5313, OS#1569
---
M src/target/trx_toolkit/transceiver.py
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/59/24659/1

diff --git a/src/target/trx_toolkit/transceiver.py 
b/src/target/trx_toolkit/transceiver.py
index d041070..f6b0551 100644
--- a/src/target/trx_toolkit/transceiver.py
+++ b/src/target/trx_toolkit/transceiver.py
@@ -269,7 +269,7 @@
return None

# Make sure that indicated timeslot is configured
-   if msg.tn not in self.ts_list:
+   if msg.tn not in self.ts_list and msg.burst:
log.warning("(%s) RX TRXD message (%s), but timeslot is 
not "
"configured => dropping..." % (self, 
msg.desc_hdr()))
return None

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I27a3c8897cb82f6c264d34702c4ec64561bb9809
Gerrit-Change-Number: 24659
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Change in osmocom-bb[master]: trxcon/scheduler: introduce and use struct sched_burst_req

2021-06-14 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/24661 )


Change subject: trxcon/scheduler: introduce and use struct sched_burst_req
..

trxcon/scheduler: introduce and use struct sched_burst_req

Similar to what we do in osmo-bts-trx, group everything related to
a to be transmitted burst into a structure.  Pass a pointer to this
structure to the logical channel handlers.  Thus makes the code
easier to read, and facilitates sending NOPE indications to the
transceiver (will be introduced in the upcoming patch).

Get rid of sched_trx_handle_tx_burst(), and instead just call
sched_trx_a5_burst_enc() directly from sched_frame_clck_cb().

Change-Id: Id45b27180c233fdc42ae1ef0b195554dd299a056
Related: SYS#5313, OS#1569
---
M src/host/trxcon/sched_lchan_desc.c
M src/host/trxcon/sched_lchan_pdtch.c
M src/host/trxcon/sched_lchan_rach.c
M src/host/trxcon/sched_lchan_tchf.c
M src/host/trxcon/sched_lchan_tchh.c
M src/host/trxcon/sched_lchan_xcch.c
M src/host/trxcon/sched_trx.c
M src/host/trxcon/sched_trx.h
M src/host/trxcon/trx_if.c
M src/host/trxcon/trx_if.h
10 files changed, 146 insertions(+), 162 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/61/24661/1

diff --git a/src/host/trxcon/sched_lchan_desc.c 
b/src/host/trxcon/sched_lchan_desc.c
index 2c3c3b2..b6a72b3 100644
--- a/src/host/trxcon/sched_lchan_desc.c
+++ b/src/host/trxcon/sched_lchan_desc.c
@@ -34,35 +34,40 @@
const sbit_t *bits, const struct trx_meas_set *meas);

 int tx_data_fn(struct trx_instance *trx, struct trx_ts *ts,
-   struct trx_lchan_state *lchan, uint32_t fn, uint8_t bid);
+  struct trx_lchan_state *lchan,
+  struct sched_burst_req *br);

 int rx_sch_fn(struct trx_instance *trx, struct trx_ts *ts,
struct trx_lchan_state *lchan, uint32_t fn, uint8_t bid,
const sbit_t *bits, const struct trx_meas_set *meas);

 int tx_rach_fn(struct trx_instance *trx, struct trx_ts *ts,
-   struct trx_lchan_state *lchan, uint32_t fn, uint8_t bid);
+  struct trx_lchan_state *lchan,
+  struct sched_burst_req *br);

 int rx_tchf_fn(struct trx_instance *trx, struct trx_ts *ts,
struct trx_lchan_state *lchan, uint32_t fn, uint8_t bid,
const sbit_t *bits, const struct trx_meas_set *meas);

 int tx_tchf_fn(struct trx_instance *trx, struct trx_ts *ts,
-   struct trx_lchan_state *lchan, uint32_t fn, uint8_t bid);
+  struct trx_lchan_state *lchan,
+  struct sched_burst_req *br);

 int rx_tchh_fn(struct trx_instance *trx, struct trx_ts *ts,
struct trx_lchan_state *lchan, uint32_t fn, uint8_t bid,
const sbit_t *bits, const struct trx_meas_set *meas);

 int tx_tchh_fn(struct trx_instance *trx, struct trx_ts *ts,
-   struct trx_lchan_state *lchan, uint32_t fn, uint8_t bid);
+  struct trx_lchan_state *lchan,
+  struct sched_burst_req *br);

 int rx_pdtch_fn(struct trx_instance *trx, struct trx_ts *ts,
struct trx_lchan_state *lchan, uint32_t fn, uint8_t bid,
const sbit_t *bits, const struct trx_meas_set *meas);

 int tx_pdtch_fn(struct trx_instance *trx, struct trx_ts *ts,
-   struct trx_lchan_state *lchan, uint32_t fn, uint8_t bid);
+   struct trx_lchan_state *lchan,
+   struct sched_burst_req *br);

 const struct trx_lchan_desc trx_lchan_desc[_TRX_CHAN_MAX] = {
[TRXC_IDLE] = {
diff --git a/src/host/trxcon/sched_lchan_pdtch.c 
b/src/host/trxcon/sched_lchan_pdtch.c
index 6a68489..abbd480 100644
--- a/src/host/trxcon/sched_lchan_pdtch.c
+++ b/src/host/trxcon/sched_lchan_pdtch.c
@@ -2,7 +2,8 @@
  * OsmocomBB <-> SDR connection bridge
  * TDMA scheduler: handlers for DL / UL bursts on logical channels
  *
- * (C) 2018-2020 by Vadim Yanitskiy 
+ * (C) 2018-2021 by Vadim Yanitskiy 
+ * Contributions by sysmocom - s.f.m.c. GmbH
  *
  * All Rights Reserved
  *
@@ -117,10 +118,10 @@


 int tx_pdtch_fn(struct trx_instance *trx, struct trx_ts *ts,
-   struct trx_lchan_state *lchan, uint32_t fn, uint8_t bid)
+   struct trx_lchan_state *lchan,
+   struct sched_burst_req *br)
 {
const struct trx_lchan_desc *lchan_desc;
-   ubit_t burst[GSM_BURST_LEN];
ubit_t *buffer, *offset;
const uint8_t *tsc;
uint8_t *mask;
@@ -131,7 +132,7 @@
mask = &lchan->tx_burst_mask;
buffer = lchan->tx_bursts;

-   if (bid > 0) {
+   if (br->bid > 0) {
/* If we have encoded bursts */
if (*mask)
goto send_burst;
@@ -155,40 +156,29 @@

 send_burst:
/* Determine which burst should be sent */
-   offset = buffer + bid * 116;
+   offset = buffer + br->bid * 116;

/* Update mask */
-   *mask |= (1 << bid);
+   *mask |= (1 << br->bid);

/* Choose proper TSC */
tsc = sched_nb_train

Change in osmocom-bb[master]: trxcon/scheduler: cosmetic: move TDMA frame number calculation

2021-06-14 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/24660 )


Change subject: trxcon/scheduler: cosmetic: move TDMA frame number calculation
..

trxcon/scheduler: cosmetic: move TDMA frame number calculation

Change-Id: I79efdfa543d37889dc6749eb25aab4e1639749c6
---
M src/host/trxcon/sched_trx.c
1 file changed, 5 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/60/24660/1

diff --git a/src/host/trxcon/sched_trx.c b/src/host/trxcon/sched_trx.c
index 0025e0c..91310c0 100644
--- a/src/host/trxcon/sched_trx.c
+++ b/src/host/trxcon/sched_trx.c
@@ -50,9 +50,13 @@
enum trx_lchan_type chan;
uint8_t offset, bid;
struct trx_ts *ts;
-   uint32_t fn;
int i;

+   /* Advance TDMA frame number in order to give the transceiver
+* more time to handle the burst before the actual transmission. */
+   const uint32_t fn = GSM_TDMA_FN_SUM(sched->fn_counter_proc,
+   sched->fn_counter_advance);
+
/* Iterate over timeslot list */
for (i = 0; i < TRX_TS_COUNT; i++) {
/* Timeslot is not allocated */
@@ -64,12 +68,6 @@
if (ts->mf_layout == NULL)
continue;

-   /**
-* Advance frame number, giving the transceiver more
-* time until a burst must be transmitted...
-*/
-   fn = GSM_TDMA_FN_SUM(sched->fn_counter_proc, 
sched->fn_counter_advance);
-
/* Get frame from multiframe */
offset = fn % ts->mf_layout->period;
frame = ts->mf_layout->frames + offset;

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I79efdfa543d37889dc6749eb25aab4e1639749c6
Gerrit-Change-Number: 24660
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Change in osmo-bsc[master]: handover_ctrl: add control interface for handover settings

2021-06-14 Thread dexter
dexter has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/24600 )

Change subject: handover_ctrl: add control interface for handover settings
..


Patch Set 1:

(7 comments)

Thanks for reviewing this.

I have fixed the easy parts. Unfortunately I did not notice the handover 
commands on network level. I will have another look at this tomorrow.

https://gerrit.osmocom.org/c/osmo-bsc/+/24600/1/doc/manuals/chapters/control.adoc
File doc/manuals/chapters/control.adoc:

https://gerrit.osmocom.org/c/osmo-bsc/+/24600/1/doc/manuals/chapters/control.adoc@41
PS1, Line 41: |handover_ho_active|RW|No|"0","1","default"|Enable/disable 
handover.
> be aware that (almost?) all handover, handover1 and handover2 vty commands 
> exist on the 'network' no […]
I did not notice that. This probably means that I have dig a bit deeper. I only 
noticed the handover commands on network level.


https://gerrit.osmocom.org/c/osmo-bsc/+/24600/1/src/osmo-bsc/handover_ctrl.c
File src/osmo-bsc/handover_ctrl.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/24600/1/src/osmo-bsc/handover_ctrl.c@33
PS1, Line 33: bool verify_vty_cmd_arg(void *ctx, const char *range, const char 
*value)
> i understand: the macros that were invented for VTY are now used for CTRL. […]
The function cmd_match is a bit strange, I could not make it work, but I from 
the code I can see that it uses cmd_range_match() to match the range. This 
works fine for me. However, even in cmd_match, I did not see any code that 
matches the choice strings ("test1|test2|test3").


https://gerrit.osmocom.org/c/osmo-bsc/+/24600/1/src/osmo-bsc/handover_ctrl.c@88
PS1, Line 88:   cmd->reply = talloc_asprintf(cmd, VTY_WRITE_FMT, 
VTY_WRITE_CONV(val)); \
> the HO_CFG_ONE_MEMBER() has arguments called VTY_WRITE_FMT and 
> VTY_WRITE_CONV. […]
I think putting a comment might sufficient.


https://gerrit.osmocom.org/c/osmo-bsc/+/24600/1/src/osmo-bsc/handover_ctrl.c@98
PS1, Line 98:   if (strcmp(cmd->value, "default") == 0) \
> (before '\' should be space, not tab)
Done


https://gerrit.osmocom.org/c/osmo-bsc/+/24600/1/src/osmo-bsc/handover_ctrl.c@114
PS1, Line 114: #undef HO_CFG_ONE_MEMBER
> please insert spacing here. […]
Done


https://gerrit.osmocom.org/c/osmo-bsc/+/24600/1/src/osmo-bsc/handover_ctrl.c@161
PS1, Line 161:  rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_##NAME);\
> (usually no '\' on last line; if you want to keep it maybe add a space before 
> it)
Done


https://gerrit.osmocom.org/c/osmo-bsc/+/24600/1/src/osmo-bsc/handover_ctrl.c@163
PS1, Line 163: HO_CFG_ALL_MEMBERS
> @pespin i don't understand what you mean […]
Probably we should list the manually defined commands first and then proceed 
with the auto generated commands.



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24600
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I12f143906818fd6b16e8783157cbb1eb51e49ffc
Gerrit-Change-Number: 24600
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Assignee: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 14 Jun 2021 20:15:03 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels 
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in libosmocore[master]: gprs_ns2_sns: implement outbound SNS DEL procedures

2021-06-14 Thread dexter
dexter has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/24591 )

Change subject: gprs_ns2_sns: implement outbound SNS DEL procedures
..


Patch Set 4: Code-Review+1

(2 comments)

https://gerrit.osmocom.org/c/libosmocore/+/24591/4/src/gb/gprs_ns2_sns.c
File src/gb/gprs_ns2_sns.c:

https://gerrit.osmocom.org/c/libosmocore/+/24591/4/src/gb/gprs_ns2_sns.c@a1907
PS4, Line 1907:
WS


https://gerrit.osmocom.org/c/libosmocore/+/24591/4/src/gb/gprs_ns2_sns.c@2103
PS4, Line 2103: LOGPFSML(fi, LOGL_ERROR, "NSE 
%d: weight become invalid because of removing bind %s. Resetting the 
configuration\n",
Maybe "became", or "has become" is better?



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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I53cd54dfd262c70c425c3f13dad3b29526daa523
Gerrit-Change-Number: 24591
Gerrit-PatchSet: 4
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 14 Jun 2021 16:32:36 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmocom-bb[master]: trx_toolkit/data_msg.py: enable TRXDv2 protocol support

2021-06-14 Thread dexter
dexter has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/24020 )

Change subject: trx_toolkit/data_msg.py: enable TRXDv2 protocol support
..


Patch Set 2: Code-Review+1

This looks good, but the jenkins build failed, however the jenkins URL leads to 
a "HTTP ERROR 404 Not Found". Probably the build info has expired or something. 
Can you resubmit the patch so that it gets built once more?


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ib76138ec6523970fca43a4d69919c178f5a4b411
Gerrit-Change-Number: 24020
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 14 Jun 2021 16:14:11 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: paging: prioritize CS related paging over PS related pagings.

2021-06-14 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/24658 )

Change subject: paging: prioritize CS related paging over PS related pagings.
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/c/osmo-bts/+/24658/2/src/common/paging.c
File src/common/paging.c:

https://gerrit.osmocom.org/c/osmo-bts/+/24658/2/src/common/paging.c@277
PS2, Line 277:  LOGP(DPAG, LOGL_NOTICE, "Dropping paging for PS, queue 
congested (%u)\n",
Why dropping instead of simply prioritizing during Um scheduling time?
AFAIU we are already dropping pagings which are queued for too long right?



--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24658
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I30f97672d7a0c369c4a656e878ab8cbbd83e31ea
Gerrit-Change-Number: 24658
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Mon, 14 Jun 2021 16:11:02 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: sgsn a54 tests

2021-06-14 Thread dexter
dexter has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24629 )

Change subject: sgsn a54 tests
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24629
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iad65cbf9840aa883cb34e53554b94a4142c82638
Gerrit-Change-Number: 24629
Gerrit-PatchSet: 1
Gerrit-Owner: Hoernchen 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: pespin 
Gerrit-CC: laforge 
Gerrit-Comment-Date: Mon, 14 Jun 2021 16:05:59 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: paging: prioritize CS related paging over PS related pagings.

2021-06-14 Thread dexter
dexter has uploaded a new patch set (#2). ( 
https://gerrit.osmocom.org/c/osmo-bts/+/24658 )

Change subject: paging: prioritize CS related paging over PS related pagings.
..

paging: prioritize CS related paging over PS related pagings.

When the paging queue is filled up to a critical level, pagings from the
PCU should be dropped as each immediate assignment paging from the PCU
is worth 4 normal CS pagings. Also the PCU may still issue pagings if the
paginging queue is already full and CS pagings are dropped. In a
congestion situation it is more important to get the CS rather than PS
pagings through.

Change-Id: I30f97672d7a0c369c4a656e878ab8cbbd83e31ea
Related: SYS#5306
---
M src/common/paging.c
1 file changed, 41 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/58/24658/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24658
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I30f97672d7a0c369c4a656e878ab8cbbd83e31ea
Gerrit-Change-Number: 24658
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-CC: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in osmo-bts[master]: paging: prioritize ps related paging over cs related pagings.

2021-06-14 Thread dexter
dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/24658 )


Change subject: paging: prioritize ps related paging over cs related pagings.
..

paging: prioritize ps related paging over cs related pagings.

When the paging queue is filled up to a critical level, pagings from the
PCU should be dropped as each immediate assignment paging from the PCU
is worth 4 CS pagings. Also the PCU may still issue pagings if the
paginging queue is already full and CS pagings are dropped. In a
congestion situation it is more important to get the CS rather than PS
pagings through.

Change-Id: I30f97672d7a0c369c4a656e878ab8cbbd83e31ea
Related: SYS#5306
---
M src/common/paging.c
1 file changed, 41 insertions(+), 0 deletions(-)



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

diff --git a/src/common/paging.c b/src/common/paging.c
index 2973141..8924471 100644
--- a/src/common/paging.c
+++ b/src/common/paging.c
@@ -80,8 +80,33 @@
/* total number of currently active paging records in queue */
unsigned int num_paging;
struct llist_head paging_queue[MAX_PAGING_BLOCKS_CCCH*MAX_BS_PA_MFRMS];
+
+   /* prioritization of cs pagings will automatically become
+* active on congestions (queue almost full) */
+   bool cs_priority_active;
 };

+/* Upper queue fill level in %, when execeeed prioritization is turned on */
+#define THRESHOLD_CONGESTED 66
+/* Lower queue fill level in %, when reached prioritization is turned off 
again */
+#define THRESHOLD_CLEAR 50
+
+/* Check the queue fill status and decide if prioritization of CS pagings
+ * must be turned on to flatten the negative effects of the congestion
+ * situation on the CS domain. */
+static void check_congestion(struct paging_state *ps)
+{
+   int pag_queue_len = paging_queue_length(ps);
+   int pag_queue_max = paging_get_queue_max(ps);
+   unsigned int treshold_upper = pag_queue_max * THRESHOLD_CONGESTED / 100;
+   unsigned int treshold_lower = pag_queue_max * THRESHOLD_CLEAR / 100;
+
+   if (pag_queue_len > treshold_upper)
+   ps->cs_priority_active = true;
+   else if (pag_queue_len < treshold_lower)
+   ps->cs_priority_active = false;
+}
+
 unsigned int paging_get_lifetime(struct paging_state *ps)
 {
return ps->paging_lifetime;
@@ -181,6 +206,8 @@
int blocks = gsm48_number_of_paging_subchannels(&ps->chan_desc);
struct paging_record *pr;

+   check_congestion(ps);
+
rate_ctr_inc2(ps->bts->ctrs, BTS_CTR_PAGING_RCVD);

if (paging_group >= blocks) {
@@ -244,6 +271,15 @@
struct paging_record *pr;
uint16_t imsi, paging_group;

+   check_congestion(ps);
+
+   if (ps->cs_priority_active) {
+   LOGP(DPAG, LOGL_NOTICE, "Dropping paging for PS, queue 
congested (%u)\n",
+   ps->num_paging);
+   rate_ctr_inc2(ps->bts->ctrs, BTS_CTR_PAGING_DROP);
+   return -ENOSPC;
+   }
+
if (len != GSM_MACBLOCK_LEN + 3) {
LOGP(DPAG, LOGL_ERROR, "IMM.ASS invalid length %d\n", len);
return -EINVAL;
@@ -530,6 +566,10 @@
int group;
int len;

+   /* This will have no effect on behavior of this function, we just need
+* need to check the congestion status of the queue from time to time. 
*/
+   check_congestion(ps);
+
*is_empty = 0;
bts->load.ccch.pch_total += 1;

@@ -711,6 +751,7 @@
ps->bts = bts;
ps->paging_lifetime = paging_lifetime;
ps->num_paging_max = num_paging_max;
+   ps->cs_priority_active = false;

for (i = 0; i < ARRAY_SIZE(ps->paging_queue); i++)
INIT_LLIST_HEAD(&ps->paging_queue[i]);

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24658
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I30f97672d7a0c369c4a656e878ab8cbbd83e31ea
Gerrit-Change-Number: 24658
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-MessageType: newchange


Change in osmo-bsc[master]: handover_ctrl: add control interface for handover settings

2021-06-14 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/24600 )

Change subject: handover_ctrl: add control interface for handover settings
..


Patch Set 1:

(8 comments)

https://gerrit.osmocom.org/c/osmo-bsc/+/24600/1/doc/manuals/chapters/control.adoc
File doc/manuals/chapters/control.adoc:

https://gerrit.osmocom.org/c/osmo-bsc/+/24600/1/doc/manuals/chapters/control.adoc@41
PS1, Line 41: |handover_ho_active|RW|No|"0","1","default"|Enable/disable 
handover.
be aware that (almost?) all handover, handover1 and handover2 vty commands 
exist on the 'network' node *as well as* on each 'bts' node. (These are 
overlayed; a BTS that has no value set uses the 'network' node's defaults)

So to be complete there should also be bts.N.handover* nodes


https://gerrit.osmocom.org/c/osmo-bsc/+/24600/1/src/osmo-bsc/handover_ctrl.c
File src/osmo-bsc/handover_ctrl.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/24600/1/src/osmo-bsc/handover_ctrl.c@33
PS1, Line 33: bool verify_vty_cmd_arg(void *ctx, const char *range, const char 
*value)
> Ack
i understand: the macros that were invented for VTY are now used for CTRL. Now 
we have argument descriptions in string literals, like "<0-255>" or "fr|hr", 
because those can be conveniently dropped in place in the vty code, and we get 
validation for free from vty.c.

For CTRL arguments, there is no implicit argument range checking. pmaier's 
implementation parses the string literal that is describing the argument in vty 
syntax, in order to validate that the CTRL user passed valid arguments. 
Essentially this is a duplication of the argument validation code in 
vty/command.c cmd_match().

I would prefer to expose that cmd_match() as public API and use that here 
instead of re-implementing the parser. Can you try whether that works out?


https://gerrit.osmocom.org/c/osmo-bsc/+/24600/1/src/osmo-bsc/handover_ctrl.c@80
PS1, Line 80: CTRL_CMD_DEFINE(NAME, "handover_"#NAME); \
The vty command name is in VTY_CMD;
NAME is the name used in C code.
The difference by some examples:

NAME  VTY0 VTY_CMD
algorithm ""   handover algorithm
hodec1_pwr_interval   handover1power budget interval
hodec2_rxlev_avg_win  handover2window rxlev averaging

it's a neat trick to just use the C name on the CTRL interface, because then we 
are guaranteed to use an unambiguous keyword without special characters.

However what I don't like that much is that now the naming on the CTRL is quite 
different from on the VTY.
The discrepancy in naming I think came from legacy code and it was acceptable 
as long as it was hidden in the code.
But on the public CTRL, it would be nicer to use CTRL cmd names that are 
exactly like VTY_CMD, just with underscores for spaces.
I see these ways:

1) adjust the #NAME strings to more exactly match the VTY command string.
for that we need to also replace the strings in the handover C code (where 
osmo-bsc queries the config).

2) add another argument to HO_CFG_ONE_MEMBER that is exactly the CTRL command.

I prefer 1).

Also I would like to see scoping as: handover.* , handover1.* and handover2.*

So for example, instead of

 handover_hodec2_rxlev_avg_win

I would like to see

 handover2.window_rxlev_averaging
 bts.N.handover2.window_rxlev_averaging


https://gerrit.osmocom.org/c/osmo-bsc/+/24600/1/src/osmo-bsc/handover_ctrl.c@88
PS1, Line 88:   cmd->reply = talloc_asprintf(cmd, VTY_WRITE_FMT, 
VTY_WRITE_CONV(val)); \
> why are we using VTY stuff here? Are these fmts safe for ctrl interface? […]
the HO_CFG_ONE_MEMBER() has arguments called VTY_WRITE_FMT and VTY_WRITE_CONV.
That's because the macro scheme was invented to avoid code dup and copy paste 
errors in the handover VTY configuration.
Now the same are being used for CTRL.

We maybe could rename the macro arguments to be more general, like just drop 
all the VTY_ prefixes across handover_cfg.*?
Anyway, that would be cosmetic noise, not really harmful if we keep the names 
and drop a comment above for others wondering the same thing


https://gerrit.osmocom.org/c/osmo-bsc/+/24600/1/src/osmo-bsc/handover_ctrl.c@98
PS1, Line 98:   if (strcmp(cmd->value, "default") == 0) \
(before '\' should be space, not tab)


https://gerrit.osmocom.org/c/osmo-bsc/+/24600/1/src/osmo-bsc/handover_ctrl.c@114
PS1, Line 114: #undef HO_CFG_ONE_MEMBER
please insert spacing here. The above two lines belong with the 
HO_CFG_ONE_MEMBER() definition above.
Below CTRL_CMD_DEFINE is unrelated.


https://gerrit.osmocom.org/c/osmo-bsc/+/24600/1/src/osmo-bsc/handover_ctrl.c@161
PS1, Line 161:  rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_##NAME);\
(usually no '\' on last line; if you want to keep it maybe add a space before 
it)


https://gerrit.osmocom.org/c/osmo-bsc/+/24600/1/src/osmo-bsc/handover_ctrl.c@163
PS1, Line 163: HO_CFG_ALL_MEMBERS
> For improved readability it may make sense to move HO_CFG_ALL_ME

Change in osmo-bsc[master]: Introduce ANR support

2021-06-14 Thread pespin
Hello Jenkins Builder, laforge,

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

https://gerrit.osmocom.org/c/osmo-bsc/+/24550

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

Change subject: Introduce ANR support
..

Introduce ANR support

See doc/manuals/chapters/anr.adoc introduced in this commit for a full
description.

Related: SYS#5303
Change-Id: I21beb4e5c101157cd0977fd9a607c2fe5350befe
---
A doc/manuals/chapters/anr.adoc
M doc/manuals/osmobsc-usermanual.adoc
M include/osmocom/bsc/Makefile.am
A include/osmocom/bsc/abis_osmo.h
M include/osmocom/bsc/bts.h
M include/osmocom/bsc/gsm_04_08_rr.h
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/neighbor_ident.h
M include/osmocom/bsc/pcuif_proto.h
M include/osmocom/bsc/vty.h
M src/ipaccess/Makefile.am
M src/ipaccess/ipaccess-config.c
M src/ipaccess/ipaccess-proxy.c
M src/osmo-bsc/Makefile.am
A src/osmo-bsc/abis_osmo.c
M src/osmo-bsc/bsc_init.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts.c
M src/osmo-bsc/bts_ipaccess_nanobts.c
M src/osmo-bsc/gsm_04_08_rr.c
M src/osmo-bsc/neighbor_ident_vty.c
M src/osmo-bsc/osmo_bsc_main.c
M src/utils/Makefile.am
M src/utils/bs11_config.c
M src/utils/meas_json.c
M tests/abis/Makefile.am
M tests/abis/abis_test.c
M tests/acc/Makefile.am
M tests/acc/acc_test.c
M tests/bsc/Makefile.am
M tests/gsm0408/Makefile.am
M tests/handover/Makefile.am
M tests/nanobts_omlattr/Makefile.am
M tests/nanobts_omlattr/nanobts_omlattr_test.c
34 files changed, 705 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/50/24550/5
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24550
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I21beb4e5c101157cd0977fd9a607c2fe5350befe
Gerrit-Change-Number: 24550
Gerrit-PatchSet: 5
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: newpatchset


Change in osmo-bsc[master]: Introduce ANR support

2021-06-14 Thread pespin
Hello Jenkins Builder, laforge,

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

https://gerrit.osmocom.org/c/osmo-bsc/+/24550

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

Change subject: Introduce ANR support
..

Introduce ANR support

See doc/manuals/chapters/anr.adoc introduced in this commit for a full
description.

Related: SYS#5303
Change-Id: I21beb4e5c101157cd0977fd9a607c2fe5350befe
---
A doc/manuals/chapters/anr.adoc
M doc/manuals/osmobsc-usermanual.adoc
M include/osmocom/bsc/Makefile.am
A include/osmocom/bsc/abis_osmo.h
M include/osmocom/bsc/bts.h
M include/osmocom/bsc/gsm_04_08_rr.h
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/neighbor_ident.h
M include/osmocom/bsc/pcuif_proto.h
M include/osmocom/bsc/vty.h
M src/ipaccess/Makefile.am
M src/ipaccess/ipaccess-config.c
M src/ipaccess/ipaccess-proxy.c
M src/osmo-bsc/Makefile.am
A src/osmo-bsc/abis_osmo.c
M src/osmo-bsc/bsc_init.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts.c
M src/osmo-bsc/bts_ipaccess_nanobts.c
M src/osmo-bsc/gsm_04_08_rr.c
M src/osmo-bsc/neighbor_ident_vty.c
M src/osmo-bsc/osmo_bsc_main.c
M src/utils/Makefile.am
M src/utils/bs11_config.c
M src/utils/meas_json.c
M tests/abis/Makefile.am
M tests/abis/abis_test.c
M tests/acc/Makefile.am
M tests/acc/acc_test.c
M tests/bsc/Makefile.am
M tests/gsm0408/Makefile.am
M tests/handover/Makefile.am
M tests/nanobts_omlattr/Makefile.am
M tests/nanobts_omlattr/nanobts_omlattr_test.c
34 files changed, 705 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/50/24550/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24550
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I21beb4e5c101157cd0977fd9a607c2fe5350befe
Gerrit-Change-Number: 24550
Gerrit-PatchSet: 4
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: newpatchset


Change in osmo-bts[master]: Support forwarding proto IPAC_PROTO_EXT_PCU BSC<->PCU

2021-06-14 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/24619 )

Change subject: Support forwarding proto IPAC_PROTO_EXT_PCU BSC<->PCU
..


Patch Set 3:

> Patch Set 2:
>
> I think using "osmo" is misleading here. Everything we do is osmo.
>
> So I think it's better to come up with some random acronym or other term that 
> is unique for this use case.  like AOE (abis osmocom extensions) or OPAE 
> (osmocom private abis extension) or whatever else you see fit

Can you point me to which parts should I change in your opinion?


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24619
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I73fdb17107494ade9263a62d1f729e67303fce87
Gerrit-Change-Number: 24619
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Mon, 14 Jun 2021 11:54:51 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bts[master]: Support forwarding proto IPAC_PROTO_EXT_PCU BSC<->PCU

2021-06-14 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/24619 )

Change subject: Support forwarding proto IPAC_PROTO_EXT_PCU BSC<->PCU
..


Patch Set 3:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24619
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I73fdb17107494ade9263a62d1f729e67303fce87
Gerrit-Change-Number: 24619
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Mon, 14 Jun 2021 11:53:19 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bts[master]: pcuif_proto.h: Introduce anr_{req, cnf} messages

2021-06-14 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/24618 )

Change subject: pcuif_proto.h: Introduce anr_{req,cnf} messages
..


Patch Set 3:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24618
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I8deef11f9ec191475c99133629cd5cd9048c4bcb
Gerrit-Change-Number: 24618
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-CC: laforge 
Gerrit-Comment-Date: Mon, 14 Jun 2021 11:53:16 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bts[master]: pcu_sock: Transmit SI2

2021-06-14 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/24617 )

Change subject: pcu_sock: Transmit SI2
..


Patch Set 3:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24617
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: If70c64f941f621a9a68aef2c846639b5c7f2f74b
Gerrit-Change-Number: 24617
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Comment-Date: Mon, 14 Jun 2021 11:53:09 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: Introduce ANR support

2021-06-14 Thread pespin
Hello Jenkins Builder, laforge,

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

https://gerrit.osmocom.org/c/osmo-bsc/+/24550

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

Change subject: Introduce ANR support
..

Introduce ANR support

See doc/manuals/chapters/anr.adoc introduced in this commit for a full
description.

Related: SYS#5303
Change-Id: I21beb4e5c101157cd0977fd9a607c2fe5350befe
---
A doc/manuals/chapters/anr.adoc
M doc/manuals/osmobsc-usermanual.adoc
M include/osmocom/bsc/Makefile.am
A include/osmocom/bsc/abis_osmo.h
M include/osmocom/bsc/bts.h
M include/osmocom/bsc/gsm_04_08_rr.h
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/neighbor_ident.h
M include/osmocom/bsc/pcuif_proto.h
M include/osmocom/bsc/vty.h
M src/ipaccess/Makefile.am
M src/ipaccess/ipaccess-config.c
M src/ipaccess/ipaccess-proxy.c
M src/osmo-bsc/Makefile.am
A src/osmo-bsc/abis_osmo.c
M src/osmo-bsc/bsc_init.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts.c
M src/osmo-bsc/bts_ipaccess_nanobts.c
M src/osmo-bsc/gsm_04_08_rr.c
M src/osmo-bsc/neighbor_ident_vty.c
M src/osmo-bsc/osmo_bsc_main.c
M src/utils/Makefile.am
M src/utils/bs11_config.c
M src/utils/meas_json.c
M tests/abis/Makefile.am
M tests/abis/abis_test.c
M tests/acc/Makefile.am
M tests/acc/acc_test.c
M tests/bsc/Makefile.am
M tests/gsm0408/Makefile.am
M tests/handover/Makefile.am
M tests/nanobts_omlattr/Makefile.am
M tests/nanobts_omlattr/nanobts_omlattr_test.c
34 files changed, 706 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/50/24550/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24550
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I21beb4e5c101157cd0977fd9a607c2fe5350befe
Gerrit-Change-Number: 24550
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: newpatchset


Change in osmo-bsc[master]: Introduce ANR support

2021-06-14 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/24550 )

Change subject: Introduce ANR support
..


Patch Set 2:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24550
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I21beb4e5c101157cd0977fd9a607c2fe5350befe
Gerrit-Change-Number: 24550
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Mon, 14 Jun 2021 11:52:22 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: bts: Test forwarding PCUIF<->IPA/OSMO/PCU

2021-06-14 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24657 )


Change subject: bts: Test forwarding PCUIF<->IPA/OSMO/PCU
..

bts: Test forwarding PCUIF<->IPA/OSMO/PCU

Related: SYS#5303
Change-Id: Ib3012ce612f78e661fd46b608a0bf67e038e136f
---
M bts/BTS_Tests.cfg
M bts/BTS_Tests.ttcn
M bts/BTS_Tests_OML.ttcn
M library/AbisOML_Types.ttcn
M library/PCUIF_Types.ttcn
5 files changed, 229 insertions(+), 8 deletions(-)



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

diff --git a/bts/BTS_Tests.cfg b/bts/BTS_Tests.cfg
index aaffbf6..36d81e2 100644
--- a/bts/BTS_Tests.cfg
+++ b/bts/BTS_Tests.cfg
@@ -31,6 +31,7 @@
 #BTS_Tests.mp_tolerance_rxlev := 10;
 #BTS_Tests.mp_tolerance_rxqual := 1;

+BTS_Tests_OML.mp_pcu_socket := "/tmp/pcu_sock"

 [MAIN_CONTROLLER]

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 547ada2..9dd4027 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -70,6 +70,7 @@
 friend module BTS_Tests_virtphy;
 friend module BTS_Tests_LAPDm;
 friend module BTS_Tests_perf;
+friend module BTS_Tests_OML;

 /* The tests assume a BTS with the following timeslot configuration:
  * TS0 : Combined CCCH + SDCCH/4
@@ -429,7 +430,7 @@
 }

 /* PCU socket may at any time receive a new INFO.ind */
-private altstep as_pcu_info_ind(PCUIF_CODEC_PT pt, integer pcu_conn_id,
+friend altstep as_pcu_info_ind(PCUIF_CODEC_PT pt, integer pcu_conn_id,
out PCUIF_Message pcu_last_info) {
var PCUIF_send_data sd;
[] pt.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(0, ?))) -> 
value sd {
diff --git a/bts/BTS_Tests_OML.ttcn b/bts/BTS_Tests_OML.ttcn
index ddeb139..e37805e 100644
--- a/bts/BTS_Tests_OML.ttcn
+++ b/bts/BTS_Tests_OML.ttcn
@@ -16,6 +16,13 @@
 import from AbisOML_Types all;
 import from IPA_Emulation all;
 import from IPA_Types all;
+import from Misc_Helpers all;
+
+import from PCUIF_Types all;
+import from PCUIF_CodecPort all;
+import from PCUIF_CodecPort all;
+
+import from BTS_Tests all;

 const integer NUM_TRX := 8;

@@ -43,6 +50,8 @@
uint8_t mp_air_timer := 100;
uint8_t mp_ny1 := 10;
uint8_t mp_bsic := 63;
+
+   charstring mp_pcu_socket := PCU_SOCK_DEFAULT;
 };

 /* BSC side OML component */
@@ -52,8 +61,17 @@
/* Port for OML */
port IPA_OML_PT OML;
var uint8_t g_bts_nr := 0;
+
/* Port for Abis/Osmo/PCU */
port IPA_OSMO_PCU_PT IPA_OSMO_PCU;
+   /* PCU Interface of BTS */
+   port PCUIF_CODEC_PT PCU;
+   var integer g_pcu_conn_id;
+   /* Last PCU INFO IND we received */
+   var PCUIF_Message g_pcu_last_info;
+
+   /* As rxed by Get Attributes Response NM_ATT_MANUF_ID IE, see 
f_oml_getattr() */
+   var bitstring g_bts_features;

/* global test case guard timer */
timer T_oml_guard := 60.0;
@@ -112,6 +130,27 @@
activate(as_IPA_evt());
 }

+private function f_init_pcu(PCUIF_CODEC_PT pt, charstring id,
+   out integer pcu_conn_id, out PCUIF_Message 
pcu_last_info) {
+   timer T := 2.0;
+   var PCUIF_send_data sd;
+
+   if (mp_pcu_socket == "") {
+   pcu_conn_id := -1;
+   return;
+   }
+   map(self:PCU, system:PCU);
+   pcu_conn_id := f_pcuif_connect(pt, mp_pcu_socket);
+
+   T.start;
+   alt {
+   [] as_pcu_info_ind(pt, pcu_conn_id, pcu_last_info);
+   [] T.timeout {
+   Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout 
waiting for PCU INFO_IND");
+   }
+   }
+   pt.send(t_SD_PCUIF(pcu_conn_id, ts_PCUIF_TXT_IND(0, PCU_VERSION, 
testcasename(;
+}

 /* Perform an "OPSTART" procedure with the speciifed MO" */
 private function f_oml_opstart(template (value) OML_FOM_ObjectClass obj_class,
@@ -232,7 +271,7 @@
 }

 /* Perform a "SET BTS ATTRIBUTES" procedure with the BTS */
-private function f_oml_bts_attr()
+private function f_oml_bts_setattr()
 runs on BSC_OML_CT {
var OML_FOM_ObjectInstance obj_inst := 
valueof(ts_OML_ObjectInstance(g_bts_nr, 255, 255));
var template (value) OML_FOM_IE_List ies := {
@@ -290,12 +329,15 @@
}
 }

-private function f_oml_exp_rx(template OML_PDU exp_rx, charstring err_msg) 
runs on BSC_OML_CT
+private function f_oml_exp_rx(template OML_PDU exp_rx, charstring err_msg)
+   runs on BSC_OML_CT return OML_PDU
 {
+   var OML_PDU rx;
timer T := 5.0;
+
T.start;
alt {
-   [] OML.receive(exp_rx) {
+   [] OML.receive(exp_rx) -> value rx {
setverdict(pass);
}
[] OML.receive { repeat; }
@@ -303,6 +345,7 @@
setverdict(fail, "Timeout waiting for ", err_msg);
}
}
+   return rx;
 }

 /* Send an OML message and expect a failure event report in response */
@@ -351,7 +394,23 @@
 }


+private function f_oml_g

Change in osmo-ttcn3-hacks[master]: OML: Add types/templates for GetAttributesResponse

2021-06-14 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24655 )


Change subject: OML: Add types/templates for GetAttributesResponse
..

OML: Add types/templates for GetAttributesResponse

Change-Id: Iec7198cc164b6e33e708d59c3f214efb3e1ac33b
---
M library/AbisOML_Types.ttcn
1 file changed, 27 insertions(+), 0 deletions(-)



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

diff --git a/library/AbisOML_Types.ttcn b/library/AbisOML_Types.ttcn
index 0a562ae..5997543 100644
--- a/library/AbisOML_Types.ttcn
+++ b/library/AbisOML_Types.ttcn
@@ -616,6 +616,15 @@
uint8_t sacch_rch_sapi3_10ms
 };

+/* Section 9.4.64 */
+type record OML_FOM_ARI {
+   uint16_tlen,
+   uint8_t non_reported_attr_len,
+   set of uint8_t  non_reported_attr optional,
+   OML_FOM_IE_List ies optional
+} with { variant (len) "LENGTHTO(non_reported_attr_len,non_reported_attr,ies)"
+   variant (non_reported_attr_len) "LENGTHTO(non_reported_attr)" };
+
 type union OML_FOM_IE_Body {
OML_FOM_AbisChannel abis_channel,
OML_FOM_AdministrativeState adm_state,
@@ -669,6 +678,8 @@
uint16_tpaging_cfg,
OCT2freq_ctrl,

+   OML_FOM_ARI ari,
+
OML_IE_L16V other
 };

@@ -728,6 +739,8 @@
paging_cfg, iei = NM_ATT_IPACC_PAGING_CFG;
freq_ctrl, iei = NM_ATT_IPACC_FREQ_CTRL;

+   ari, iei = NM_ATT_GET_ARI;
+
other, OTHERWISE;
)" };

@@ -1124,6 +1137,20 @@
tr_OML_IE(NM_ATT_LIST_REQ_ATTR, OML_FOM_IE_Body:{other := 
tr_OML_IE_L16V(?, req_attr)})
});

+/* 8.11.3 Get Attribute Responses */
+template (value) OML_PDU ts_OML_GetAttributesResponse(template (value) 
OML_FOM_ObjectClass obj_class,
+ template (value) 
OML_FOM_ObjectInstance obj_inst,
+ template (value) octetstring 
req_attr) :=
+   ts_OML_MsgType(NM_MT_GET_ATTR_RESP, obj_class, obj_inst, {
+   ts_OML_IE(NM_ATT_GET_ARI, OML_FOM_IE_Body:{other := 
ts_OML_IE_L16V(0, req_attr)})
+   });
+template OML_PDU tr_OML_GetAttributesResponse(template OML_FOM_ObjectClass 
obj_class,
+ template OML_FOM_ObjectInstance obj_inst,
+ template OML_FOM_ARI ari := ?) :=
+   tr_OML_MsgType(NM_MT_GET_ATTR_RESP, obj_class, obj_inst, {
+   tr_OML_IE(NM_ATT_GET_ARI, OML_FOM_IE_Body:{ari := ari})
+   });
+
 /* convert a request into an ACK */
 function f_OML_make_ack(OML_PDU orig) return OML_PDU {
var OML_PDU resp := orig;

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24655
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iec7198cc164b6e33e708d59c3f214efb3e1ac33b
Gerrit-Change-Number: 24655
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in osmo-ttcn3-hacks[master]: bts: Support passing PCUIF messages over IPA multiplex

2021-06-14 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24656 )


Change subject: bts: Support passing PCUIF messages over IPA multiplex
..

bts: Support passing PCUIF messages over IPA multiplex

Related: SYS#5303
Change-Id: I3cd0988cb654f1c5816d1c4717255a5e802d7925
---
M bts/BTS_Tests_OML.ttcn
M bts/regen_makefile.sh
M library/IPA_Emulation.ttcnpp
M library/IPA_Types.ttcn
4 files changed, 48 insertions(+), 2 deletions(-)



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

diff --git a/bts/BTS_Tests_OML.ttcn b/bts/BTS_Tests_OML.ttcn
index 6770dab..ddeb139 100644
--- a/bts/BTS_Tests_OML.ttcn
+++ b/bts/BTS_Tests_OML.ttcn
@@ -52,6 +52,8 @@
/* Port for OML */
port IPA_OML_PT OML;
var uint8_t g_bts_nr := 0;
+   /* Port for Abis/Osmo/PCU */
+   port IPA_OSMO_PCU_PT IPA_OSMO_PCU;

/* global test case guard timer */
timer T_oml_guard := 60.0;
@@ -97,6 +99,7 @@
vc_IPA_OML := IPA_Emulation_CT.create(id & "-OML-IPA");
map(vc_IPA_OML:IPA_PORT, system:IPA_CODEC_PT);
connect(vc_IPA_OML:IPA_OML_PORT, self:OML);
+   connect(vc_IPA_OML:IPA_OSMO_PCU_PORT, self:IPA_OSMO_PCU);
vc_IPA_OML.start(IPA_Emulation.main_server(mp_oml_ip, mp_oml_port));

T_oml_guard.start;
diff --git a/bts/regen_makefile.sh b/bts/regen_makefile.sh
index 9f1bf1d..8771500 100755
--- a/bts/regen_makefile.sh
+++ b/bts/regen_makefile.sh
@@ -2,6 +2,6 @@

 FILES="*.ttcn *.ttcnpp IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc 
IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc UD_PT.cc RLCMAC_EncDec.cc 
Native_FunctionDefs.cc TRXC_CodecPort_CtrlFunctDef.cc 
L1CTL_PortType_CtrlFunctDef.cc TELNETasp_PT.cc"

-export CPPFLAGS_TTCN3="-DIPA_EMULATION_RSL -DIPA_EMULATION_OML 
-DIPA_EMULATION_CTRL"
+export CPPFLAGS_TTCN3="-DIPA_EMULATION_RSL -DIPA_EMULATION_OML 
-DIPA_EMULATION_CTRL -DIPA_EMULATION_OSMO_PCU"

 ../regen-makefile.sh BTS_Tests.ttcn $FILES
diff --git a/library/IPA_Emulation.ttcnpp b/library/IPA_Emulation.ttcnpp
index 906664f..5cdf324 100644
--- a/library/IPA_Emulation.ttcnpp
+++ b/library/IPA_Emulation.ttcnpp
@@ -55,6 +55,10 @@
 import from Osmocom_CTRL_Types all;
 #endif
 
+#ifdef IPA_EMULATION_OSMO_PCU
+import from PCUIF_Types all;
+#endif
+
 modulepar {
/* Use Osmocom extended IPA mux header */
boolean mp_ipa_mgcp_uses_osmo_ext := true;
@@ -190,6 +194,12 @@
 } with { extension "internal" }
 #endif

+#ifdef IPA_EMULATION_OSMO_PCU
+/* Client port for Osmocom PCU extension inside IPA */
+type port IPA_OSMO_PCU_PT message {
+   inout PCUIF_Message, ASP_IPA_Event;
+} with { extension "internal" }
+#endif



@@ -224,6 +234,10 @@
/* up-facing port for RSPRO */
port IPA_RSPRO_PT IPA_RSPRO_PORT;
 #endif
+#ifdef IPA_EMULATION_OSMO_PCU
+   /* up-facing port for RSPRO */
+   port IPA_OSMO_PCU_PT IPA_OSMO_PCU_PORT;
+#endif

/* up-facing port for other streams */
port IPA_SP_PT IPA_SP_PORT;
@@ -350,6 +364,11 @@
IPA_RSPRO_PORT.send(evt);
}
 #endif
+#ifdef IPA_EMULATION_OSMO_PCU
+   if (IPA_OSMO_PCU_PORT.checkstate("Connected")) {
+   IPA_OSMO_PCU_PORT.send(evt);
+   }
+#endif
/* FIXME: to other ports */
 }

@@ -585,6 +604,13 @@
 }
 #endif

+#ifdef IPA_EMULATION_OSMO_PCU
+private function f_osmo_pcu_to_user(octetstring msg) runs on IPA_Emulation_CT {
+   var PCUIF_Message pcuif_msg := dec_PCUIF_Message(msg);
+   IPA_OSMO_PCU_PORT.send(pcuif_msg);
+}
+#endif
+
 #ifdef IPA_EMULATION_MGCP
 private function f_mgcp_to_user(octetstring msg) runs on IPA_Emulation_CT {
var charstring msg_ch := oct2char(msg);
@@ -657,6 +683,9 @@
 #ifdef IPA_EMULATION_RSPRO
var RsproPDU rspro;
 #endif
+#ifdef IPA_EMULATION_OSMO_PCU
+   var PCUIF_Message pcu;
+#endif

/* Set function for dissecting the binary */
var f_IPL4_getMsgLen vl_f := refers(f_IPL4_fixedMsgLen);
@@ -733,6 +762,11 @@
f_rspro_to_user(ipa_rx.msg);
}
 #endif
+#ifdef IPA_EMULATION_OSMO_PCU
+   case (IPAC_PROTO_EXT_OSMO_PCU) {
+   f_osmo_pcu_to_user(ipa_rx.msg);
+   }
+#endif
case else {

IPA_SP_PORT.send(f_to_asp(ipa_rx));
}
@@ -826,6 +860,14 @@
}
 #endif

+#ifdef IPA_EMULATION_OSMO_PCU
+   [] IPA_OSMO_PCU_PORT.receive(PCUIF_Message:?) -> value pcu {
+   payload := enc_PCUIF_Message(pcu);
+   ipa_ud := valueof(t_ASP_IPA_UD(IPAC_PROTO_OSMO, 
payload, IPAC_PROTO_EXT_OSMO_PCU));
+   IPA_PORT.send(f_from_asp(f_ipa_conn_id(), ipa_ud));

Change in osmo-bsc[master]: rsl_lchan_lookup: drop redundant condition

2021-06-14 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/24653 )

Change subject: rsl_lchan_lookup: drop redundant condition
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24653
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I4d9afc2996d95fdc15ee1a04e31d781b595023e3
Gerrit-Change-Number: 24653
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 14 Jun 2021 11:09:37 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: rsl_data_request() check lchan pointer before access

2021-06-14 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/24652 )

Change subject: rsl_data_request() check lchan pointer before access
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24652
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I873c1a27f9449a56c525984ea50bfcf6daa4b5f8
Gerrit-Change-Number: 24652
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Mon, 14 Jun 2021 11:09:19 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: gprs_ns2_sns: free the NSE if the SIZE PDU is not valid

2021-06-14 Thread dexter
dexter has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/24650 )

Change subject: gprs_ns2_sns: free the NSE if the SIZE PDU is not valid
..


Patch Set 2: Code-Review+1

(1 comment)

This looks good to me. I did not check, but I guess sns_failed() does the 
freeing.

https://gerrit.osmocom.org/c/libosmocore/+/24650/2/src/gb/gprs_ns2_sns.c
File src/gb/gprs_ns2_sns.c:

https://gerrit.osmocom.org/c/libosmocore/+/24650/2/src/gb/gprs_ns2_sns.c@2254
PS2, Line 2254: sns_failed(fi, "Rx Size: 
Missing Enssential IE");
I think in 3gpp speak this should be "Missing mandatory IE", but I don't know 
that for sure.



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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ife889091ecba4180a90743deb786767008fe863d
Gerrit-Change-Number: 24650
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 14 Jun 2021 09:16:18 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: gprs_ns2_sns: free the NSE if the SIZE PDU is not valid

2021-06-14 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/24650 )

Change subject: gprs_ns2_sns: free the NSE if the SIZE PDU is not valid
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ife889091ecba4180a90743deb786767008fe863d
Gerrit-Change-Number: 24650
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 14 Jun 2021 08:40:35 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: rsl_lchan_lookup: drop redundant condition

2021-06-14 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/24653 )

Change subject: rsl_lchan_lookup: drop redundant condition
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24653
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I4d9afc2996d95fdc15ee1a04e31d781b595023e3
Gerrit-Change-Number: 24653
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 14 Jun 2021 08:39:20 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: ns: test if SNS fails when all signalling NSVCs failes

2021-06-14 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24651 )

Change subject: ns: test if SNS fails when all signalling NSVCs failes
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24651
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id06e34e7235d94a06152a0015487a507d6492a97
Gerrit-Change-Number: 24651
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 14 Jun 2021 08:38:45 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: gprs_ns2_sns: implement outbound SNS DEL procedures

2021-06-14 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/24591 )

Change subject: gprs_ns2_sns: implement outbound SNS DEL procedures
..


Patch Set 4: Code-Review+1


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I53cd54dfd262c70c425c3f13dad3b29526daa523
Gerrit-Change-Number: 24591
Gerrit-PatchSet: 4
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 14 Jun 2021 08:38:05 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: gprs_ns2_sns: implement outbound SNS ADD procedures

2021-06-14 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/24123 )

Change subject: gprs_ns2_sns: implement outbound SNS ADD procedures
..


Patch Set 7: Code-Review+1


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I71c33200bd1f0307ceb943ee958db5ebe3623d36
Gerrit-Change-Number: 24123
Gerrit-PatchSet: 7
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 14 Jun 2021 08:37:00 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: gprs_ns2_sns: implement local change weight procedure

2021-06-14 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/23187 )

Change subject: gprs_ns2_sns: implement local change weight procedure
..


Patch Set 10: Code-Review+1


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Icec4dabb46bc198f68f91bfe09ba279fbe68d454
Gerrit-Change-Number: 23187
Gerrit-PatchSet: 10
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 14 Jun 2021 08:36:24 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: socket: add function to wait until a socket becomes writeable

2021-06-14 Thread dexter
Hello Jenkins Builder, laforge, pespin, fixeria,

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

https://gerrit.osmocom.org/c/libosmocore/+/24435

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

Change subject: socket: add function to wait until a socket becomes writeable
..

socket: add function to wait until a socket becomes writeable

In cases where a socket is created using the option OSMO_SOCK_F_NONBLOCK
it is not possible to detect a connection error because
osmo_sock_init() will return early while the connection is still in
progress.

One way to make sure that the socket is connected is to use select to
wait until the socket becomes writeable and to use getsockopt to check
SO_ERROR.

The function osmo_sock_wait() waits until the socket becomes writeable.
>From the error code the API user can determine whether the connection
was successful or not.

Change-Id: I1c68185120fa2a6c9b6cb8aa2a25232a44ff5508
Related: SYS#4971
---
M include/osmocom/core/socket.h
M src/socket.c
2 files changed, 53 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/35/24435/4
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/24435
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I1c68185120fa2a6c9b6cb8aa2a25232a44ff5508
Gerrit-Change-Number: 24435
Gerrit-PatchSet: 4
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in pysim[master]: ts_31_102: Fully support USIM EF.AD

2021-06-14 Thread laforge
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/24570 
)

Change subject: ts_31_102: Fully support USIM EF.AD
..

ts_31_102: Fully support USIM EF.AD

The USIM EF.AD has quite some more bits, it should have a separate
implementation and not reuse te DF.GSM/EF.AD implementation.

Change-Id: Iaf195cb63d5d12fc906a7e7cd85e3fd44589a41e
---
M pySim/ts_31_102.py
1 file changed, 26 insertions(+), 2 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py
index 78307a4..24d0f52 100644
--- a/pySim/ts_31_102.py
+++ b/pySim/ts_31_102.py
@@ -280,13 +280,15 @@
 # ADF.USIM
 ##

+import enum
 from struct import unpack, pack
 from construct import *
+from construct import Optional as COptional
 from pySim.construct import *
 from pySim.filesystem import *
 from pySim.tlv import *
 from pySim.ts_102_221 import EF_ARR
-from pySim.ts_51_011 import EF_IMSI, EF_xPLMNwAcT, EF_SPN, EF_CBMI, EF_ACC, 
EF_PLMNsel, EF_AD
+from pySim.ts_51_011 import EF_IMSI, EF_xPLMNwAcT, EF_SPN, EF_CBMI, EF_ACC, 
EF_PLMNsel
 from pySim.ts_51_011 import EF_CBMID, EF_CBMIR, EF_ADN, EF_SMS, EF_MSISDN, 
EF_SMSP, EF_SMSS
 from pySim.ts_51_011 import EF_SMSR, EF_DCK, EF_EXT, EF_CNL, EF_OPL, EF_MBI, 
EF_MWIS
 from pySim.ts_51_011 import EF_MMSN, EF_MMSICP, EF_MMSUP, EF_MMSUCP, EF_VGCS, 
EF_VGCSS, EF_NIA
@@ -559,6 +561,28 @@
 super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size)
 self._construct = Struct('tmsi'/HexAdapter(Bytes(4)), 
'lai'/HexAdapter(Bytes(5)), 'rfu'/Int8ub,
  'lu_status'/Int8ub)
+# TS 31.102 Section 4.2.18
+class EF_AD(TransparentEF):
+class OP_MODE(enum.IntEnum):
+normal  = 0x00
+type_approval   = 0x80
+normal_and_specific_facilities  = 0x01
+type_approval_and_specific_facilities   = 0x81
+maintenance_off_line= 0x02
+cell_test   = 0x04
+
+def __init__(self, fid='6fad', sfid=0x03, name='EF.AD', 
desc='Administrative Data', size={4,6}):
+super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size)
+self._construct = BitStruct(
+# Byte 1
+'ms_operation_mode'/Bytewise(Enum(Byte, EF_AD.OP_MODE)),
+# Byte 2 + 3
+'additional_info'/Bytewise(FlagsEnum(Int16ub, 
ciphering_indicator=1, csg_display_control=2,
+ prose_services=4, 
extended_drx=8)),
+'rfu'/BitsRFU(4),
+'mnc_len'/BitsInteger(4),
+'extensions'/COptional(Bytewise(GreedyBytesRFU))
+)

 # TS 31.102 Section 4.2.23
 class EF_PSLOCI(TransparentEF):
@@ -821,7 +845,7 @@
   EF_ACC(sfid=0x06),
   EF_PLMNsel('6f7b', 0x0d, 'EF.FPLMN', 'Forbidden PLMNs', 
size={12,None}),
   EF_LOCI(),
-  EF_AD(sfid=0x03),
+  EF_AD(),
   EF_CBMID(sfid=0x0e),
   EF_ECC(),
   EF_CBMIR(),

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Iaf195cb63d5d12fc906a7e7cd85e3fd44589a41e
Gerrit-Change-Number: 24570
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in pysim[master]: implement more files with TLV + construct

2021-06-14 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/24654 )

Change subject: implement more files with TLV + construct
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I6083d2bb0a307f660f09af384803f84e4098a5ed
Gerrit-Change-Number: 24654
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Mon, 14 Jun 2021 07:53:29 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in pysim[master]: implement more files with TLV + construct

2021-06-14 Thread laforge
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/24654 
)

Change subject: implement more files with TLV + construct
..

implement more files with TLV + construct

This adds encoding/decoding for more files, from 51.011 (SIM)
to 31.102 (USIM) and 31.103 (ISIM)

Change-Id: I6083d2bb0a307f660f09af384803f84e4098a5ed
---
M pySim/ts_31_102.py
M pySim/ts_31_103.py
M pySim/ts_51_011.py
3 files changed, 220 insertions(+), 13 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py
index 24d0f52..f3628ad 100644
--- a/pySim/ts_31_102.py
+++ b/pySim/ts_31_102.py
@@ -511,7 +511,14 @@
 super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size)
 self._construct = Struct('ksi'/Int8ub, 'ck'/HexAdapter(Bytes(16)), 
'ik'/HexAdapter(Bytes(16)))
 
-# TS 31.103 Section 4.2.7
+# TS 31.102 Section 4.2.6
+class EF_HPPLMN(TransparentEF):
+def __init__(self, fid='6f31', sfid=0x12, name='EF.HPPLMN', size={1,1},
+ desc='Higher Priority PLMN search period'):
+super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size)
+self._construct = Int8ub
+
+# TS 31.102 Section 4.2.8
 class EF_UST(TransparentEF):
 def __init__(self, fid='6f38', sfid=0x04, name='EF.UST', desc='USIM 
Service Table', size={1,17}):
 super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, size=size)
@@ -677,6 +684,33 @@
 self._construct = Struct('key_domain_id'/Bytes(3),
  'num_msk_id'/Int8ub,
  'msk_ids'/msk_ts_constr[this.num_msk_id])
+# TS 31.102 Section 4.2.81
+class EF_MUK(LinFixedEF):
+class MUK_Idr(BER_TLV_IE, tag=0x80):
+_construct = HexAdapter(GreedyBytes)
+class MUK_Idi(BER_TLV_IE, tag=0x82):
+_construct = HexAdapter(GreedyBytes)
+class MUK_ID(BER_TLV_IE, tag=0xA0, nested=[MUK_Idr, MUK_Idi]):
+pass
+class TimeStampCounter(BER_TLV_IE, tag=0x81):
+pass
+class EF_MUK_Collection(TLV_IE_Collection, nested=[MUK_ID, 
TimeStampCounter]):
+pass
+def __init__(self, fid='6fd8', sfid=None, name='EF.MUK', desc='MBMS User 
Key'):
+super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, 
rec_len={None,None})
+self._tlv = EF_MUK.EF_MUK_Collection
+
+# TS 31.102 Section 4.2.83
+class EF_GBANL(LinFixedEF):
+class NAF_ID(BER_TLV_IE, tag=0x80):
+_construct = HexAdapter(GreedyBytes)
+class B_TID(BER_TLV_IE, tag=0x81):
+_construct = HexAdapter(GreedyBytes)
+class EF_GBANL_Collection(BER_TLV_IE, nested=[NAF_ID, B_TID]):
+pass
+def __init__(self, fid='6fda', sfid=None, name='EF.GBANL', desc='GBA NAF 
List'):
+super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, 
rec_len={None,None})
+self._tlv = EF_GBANL.EF_GBANL_Collection

 # TS 31.102 Section 4.2.85
 class EF_EHPLMNPI(TransparentEF):
@@ -685,6 +719,42 @@
 super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size)
 self._construct = Struct('presentation_ind'/
  Enum(Byte, no_preference=0, 
display_highest_prio_only=1, display_all=2))
+
+# TS 31.102 Section 4.2.87
+class EF_NAFKCA(LinFixedEF):
+class NAF_KeyCentreAddress(BER_TLV_IE, tag=0x80):
+_construct = HexAdapter(GreedyBytes)
+def __init__(self, fid='6fdd', sfid=None, name='EF.NAFKCA', rec_len={None, 
None},
+desc='NAF Key Centre Address'):
+super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, 
rec_len=rec_len)
+self._tlv = EF_NAFKCA.NAF_KeyCentreAddress
+
+# TS 31.102 Section 4.2.90
+class EF_NCP_IP(LinFixedEF):
+class DataDestAddrRange(TLV_IE, tag=0x83):
+_construct = Struct('type_of_address'/Enum(Byte, IPv4=0x21, IPv6=0x56),
+'prefix_length'/Int8ub,
+'prefix'/HexAdapter(GreedyBytes))
+class AccessPointName(TLV_IE, tag=0x80):
+# coded as per TS 23.003
+_construct = HexAdapter(GreedyBytes)
+class Login(TLV_IE, tag=0x81):
+# as per SMS DCS TS 23.038
+_construct = GsmStringAdapter(GreedyBytes)
+class Password(TLV_IE, tag=0x82):
+# as per SMS DCS TS 23.038
+_construct = GsmStringAdapter(GreedyBytes)
+class BearerDescription(TLV_IE, tag=0x84):
+# Bearer descriptionTLV DO as per TS 31.111
+pass
+class EF_NCP_IP_Collection(TLV_IE_Collection,
+   nested=[AccessPointName, Login, Password, 
BearerDescription]):
+pass
+def __init__(self, fid='6fe2', sfid=None, name='EF.NCP-IP', rec_len={None, 
None},
+desc='Network Connectivity Parameters for USIM IP connections'):
+super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, 
rec_len=rec_len)
+self._tlv = EF_NCP_IP.EF_NCP_IP_Collection
+
 # TS 31