Change in osmo-bsc[master]: bts_uptime(): do not spam logs with 'OML link uptime unavailable'

2021-06-03 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/24541 )


Change subject: bts_uptime(): do not spam logs with 'OML link uptime 
unavailable'
..

bts_uptime(): do not spam logs with 'OML link uptime unavailable'

This message periodically appears in the logs with subsys=DNM and
level=INFO for every disconnected BTS.  I find this message useless
and even annoying, so I propose to remove it in this patch.

Change-Id: I7e2498cc61d311ca08585b2f1c49de021b17a5a1
---
M src/osmo-bsc/bts.c
1 file changed, 1 insertion(+), 3 deletions(-)



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

diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c
index 857ddd2..0c699c3 100644
--- a/src/osmo-bsc/bts.c
+++ b/src/osmo-bsc/bts.c
@@ -565,10 +565,8 @@
 {
struct timespec tp;

-   if (!bts->uptime || !bts->oml_link) {
-   LOGP(DNM, LOGL_INFO, "BTS %u OML link uptime unavailable\n", 
bts->nr);
+   if (!bts->uptime || !bts->oml_link)
return 0;
-   }

if (osmo_clock_gettime(CLOCK_MONOTONIC, ) != 0) {
LOGP(DNM, LOGL_ERROR, "BTS %u uptime computation failure: 
%s\n", bts->nr, strerror(errno));

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I7e2498cc61d311ca08585b2f1c49de021b17a5a1
Gerrit-Change-Number: 24541
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Change in osmo-bsc[master]: VTY: fix NULL-pointer dereference in lchan_act_single()

2021-06-03 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/24540 )


Change subject: VTY: fix NULL-pointer dereference in lchan_act_single()
..

VTY: fix NULL-pointer dereference in lchan_act_single()

Without this guard, a command like this can crash osmo-bsc:

  OsmoBSC# bts 0 trx 0 timeslot 0 sub-slot 0 activate fr

when timeslot 0 is configured as non-combined 'CCCH'.

Change-Id: I0197a6a2595ff9dade58e37383d44d2df3b03288
CLoses: OS#5170
---
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/40/24540/1

diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 6f4e2ec..89aacf2 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -6060,6 +6060,10 @@
if (activate) {
LOG_LCHAN(lchan, LOGL_NOTICE, "attempt from VTY to activate 
lchan %s with codec %s\n",
  gsm_lchan_name(lchan), codec_str);
+   if (!lchan->fi) {
+   vty_out(vty, "%% Cannot activate: Channel not 
initialized%s", VTY_NEWLINE);
+   return CMD_WARNING;
+   }

int lchan_t;
if (lchan->fi->state != LCHAN_ST_UNUSED) {

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I0197a6a2595ff9dade58e37383d44d2df3b03288
Gerrit-Change-Number: 24540
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Change in osmo-gsm-tester[master]: util: adds the feature to force the rpath when patching files.

2021-06-03 Thread alealcon
alealcon has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24272 )

Change subject: util: adds the feature to force the rpath when patching files.
..


Patch Set 1:

> Patch Set 1:
>
> Hi, did you think about using chroot? iirc it can be applied directly based 
> on ssh login by means of sshd config file, for instance based on user ip 
> address or alike.
> This way you could chroot into /mnt/nfs directly whenever you ssh into it, 
> and you would probably avoid this kind of issues.

Yes, we are using chroot for debugging purposes. We used the buildroot utility 
to build the toolchain and the rootfs, so we can select the tools that the 
rootfs will have. We did it because the base system doesn't have development 
tools (the ldd command that I posted before was crosscompiled and deployed in 
the nfs.

I didn't know that chroot can be applied on ssh. That probably will solve a lot 
of problems. Do you think its possible that OGT will log with ssh into a 
chroot? If that is possible the code won't change, because there will be no 
need to specify an rpath or dynamic-linker to the crosscompiled srsenb.

I'm going to do a little search of how configure that. Can you provide some 
support with that feature in OGT? OGT it's still too big to me to know how can 
it be achieved.

Thanks for your suggestion Pau. It's awesome!!


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

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I2d4a105d4843c0d31d6b5d8f8d4195247b290aec
Gerrit-Change-Number: 24272
Gerrit-PatchSet: 1
Gerrit-Owner: alealcon 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 20:10:00 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in libosmocore[master]: ns2: Use NSVC bufid in stats report

2021-06-03 Thread lynxis lazus
lynxis lazus has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/24468 )

Change subject: ns2: Use NSVC bufid in stats report
..


Patch Set 3: -Code-Review

@pespin See https://gerrit.osmocom.org/c/libosmocore/+/24539


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I4c696c615ba3416f8524d0797ce06c0ecd3a18f2
Gerrit-Change-Number: 24468
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: osmith 
Gerrit-CC: laforge 
Gerrit-Comment-Date: Thu, 03 Jun 2021 18:42:02 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: gprs_ns2: rework id strings of nsvcs

2021-06-03 Thread lynxis lazus
lynxis lazus has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/24539 )


Change subject: gprs_ns2: rework id strings of nsvcs
..

gprs_ns2: rework id strings of nsvcs

Ensure all nsvcs ids are unique as UDP ids might not be unique when
multiple NSVCs connect to the same remote endpoint (multiple binds).
Change the format of all ids to look similiar.
FR: NSE11-NSVC23-FR-fr0-DLCI13.
UDP: NSE11-NSVC-UDP-10.0.0.1:23000-192.168.1.1:24000
UDP: NSE11-NSVC23-UDP-10.0.0.1:23000-192.168.1.1:24000
UDP: NSE11-NSVC66-UDP-[fd01::1]:23000-[fd03::2]:24000

Change-Id: I618e263e73fcc64d4e46b57aa3a2cb2783837907
---
M src/gb/gprs_ns2.c
M src/gb/gprs_ns2_fr.c
M src/gb/gprs_ns2_udp.c
3 files changed, 19 insertions(+), 11 deletions(-)



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

diff --git a/src/gb/gprs_ns2.c b/src/gb/gprs_ns2.c
index 1148d6f..65a78a2 100644
--- a/src/gb/gprs_ns2.c
+++ b/src/gb/gprs_ns2.c
@@ -980,7 +980,8 @@
enum gprs_ns2_vc_mode vc_mode;
uint16_t nsvci;
uint16_t nsei;
-   char idbuf[32];
+   const struct osmo_sockaddr *local;
+   char idbuf[256], tmp[INET6_ADDRSTRLEN + 8];

int rc, tlv;

@@ -1113,8 +1114,12 @@

nsvci = tlvp_val16be(, NS_IE_VCI);
vc_mode = ns2_dialect_to_vc_mode(dialect);
-   snprintf(idbuf, sizeof(idbuf), "%s-NSE%05u-NSVC%05u", 
gprs_ns2_lltype_str(nse->ll),
-nse->nsei, nsvci);
+
+   local = gprs_ns2_ip_bind_sockaddr(bind);
+   osmo_sockaddr_to_str_buf(tmp, sizeof(tmp), local);
+   snprintf(idbuf, sizeof(idbuf), "%s-NSE%05u-NSVC%05u-%s-%s", 
gprs_ns2_lltype_str(nse->ll),
+nse->nsei, nsvci, tmp, osmo_sockaddr_to_str(remote));
+   osmo_identifier_sanitize_buf(idbuf, NULL, '_');
nsvc = ns2_vc_alloc(bind, nse, false, vc_mode, idbuf);
if (!nsvc)
return NS2_CS_SKIPPED;
diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index 84f3784..8de93e9 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -976,8 +976,9 @@
goto err;
}

-   snprintf(idbuf, sizeof(idbuf), "%s-%s-DLCI%u-NSE%05u-NSVC%05u", 
gprs_ns2_lltype_str(nse->ll),
-bpriv->netif, dlci, nse->nsei, nsvci);
+   snprintf(idbuf, sizeof(idbuf), "NSE%05u-NSVC%05u-%s-%s-DLCI%u", 
nse->nsei, nsvci,
+gprs_ns2_lltype_str(nse->ll), bpriv->netif, dlci);
+   osmo_identifier_sanitize_buf(idbuf, NULL, '_');
nsvc = ns2_vc_alloc(bind, nse, true, GPRS_NS2_VC_MODE_BLOCKRESET, 
idbuf);
if (!nsvc)
goto err;
diff --git a/src/gb/gprs_ns2_udp.c b/src/gb/gprs_ns2_udp.c
index 7980df5..428fd4a 100644
--- a/src/gb/gprs_ns2_udp.c
+++ b/src/gb/gprs_ns2_udp.c
@@ -384,10 +384,10 @@
const struct osmo_sockaddr *remote)
 {
struct gprs_ns2_vc *nsvc;
+   const struct osmo_sockaddr *local;
struct priv_vc *priv;
enum gprs_ns2_vc_mode vc_mode;
-   char *sockaddr_str;
-   char idbuf[64];
+   char idbuf[256], tmp[INET6_ADDRSTRLEN + 8];

OSMO_ASSERT(gprs_ns2_is_ip_bind(bind));

@@ -402,10 +402,12 @@
if (gprs_ns2_nsvc_by_sockaddr_bind(bind, remote))
return NULL;

-   sockaddr_str = (char *)osmo_sockaddr_to_str(remote);
-   osmo_identifier_sanitize_buf(sockaddr_str, NULL, '_');
-   snprintf(idbuf, sizeof(idbuf), "%s-NSE%05u-remote-%s", 
gprs_ns2_lltype_str(nse->ll),
-nse->nsei, sockaddr_str);
+   local = gprs_ns2_ip_bind_sockaddr(bind);
+   osmo_sockaddr_to_str_buf(tmp, sizeof(tmp), local);
+   snprintf(idbuf, sizeof(idbuf), "NSE%05u-NSVC-%s-%s-%s", nse->nsei, 
gprs_ns2_lltype_str(nse->ll),
+tmp, osmo_sockaddr_to_str(remote));
+   osmo_identifier_sanitize_buf(idbuf, NULL, '_');
+
nsvc = ns2_vc_alloc(bind, nse, true, vc_mode, idbuf);
if (!nsvc)
return NULL;

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I618e263e73fcc64d4e46b57aa3a2cb2783837907
Gerrit-Change-Number: 24539
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus 
Gerrit-MessageType: newchange


Change in osmo-asf4-dfu[master]: usb serial number descriptor

2021-06-03 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-asf4-dfu/+/17024 )

Change subject: usb serial number descriptor
..


Patch Set 3:

(1 comment)

https://gerrit.osmocom.org/c/osmo-asf4-dfu/+/17024/2/usb_start.c
File usb_start.c:

https://gerrit.osmocom.org/c/osmo-asf4-dfu/+/17024/2/usb_start.c@121
PS2, Line 121: SYSMOOCTSIM
> I wanted to have something that works with the current octsim, the string 
> index depends on the actua […]
everyone starts with something that works first, and then cleans it up or 
generalizes it, if possible.

The string descriptor index is configurable AFAICT (CONF_USB_DFUD_ISERIALNUM). 
Am I missing something?

sharing code between bootloader and application is completely orthogonal and 
not reaally on-topic here, IMHO.



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

Gerrit-Project: osmo-asf4-dfu
Gerrit-Branch: master
Gerrit-Change-Id: I4a23682cee0849c788e5f6c611df4ed1f1cac3da
Gerrit-Change-Number: 17024
Gerrit-PatchSet: 3
Gerrit-Owner: Hoernchen 
Gerrit-Reviewer: Hoernchen 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: roh 
Gerrit-CC: laforge 
Gerrit-Comment-Date: Thu, 03 Jun 2021 18:33:20 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Hoernchen 
Comment-In-Reply-To: laforge 
Gerrit-MessageType: comment


Change in osmo-gsm-tester[master]: util: adds the feature to force the rpath when patching files.

2021-06-03 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24272 )

Change subject: util: adds the feature to force the rpath when patching files.
..


Patch Set 1:

Hi, did you think about using chroot? iirc it can be applied directly based on 
ssh login by means of sshd config file, for instance based on user ip address 
or alike.
This way you could chroot into /mnt/nfs directly whenever you ssh into it, and 
you would probably avoid this kind of issues.


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

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I2d4a105d4843c0d31d6b5d8f8d4195247b290aec
Gerrit-Change-Number: 24272
Gerrit-PatchSet: 1
Gerrit-Owner: alealcon 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 16:54:09 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-gsm-tester[master]: util: adds the feature to force the rpath when patching files.

2021-06-03 Thread alealcon
alealcon has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24272 )

Change subject: util: adds the feature to force the rpath when patching files.
..


Patch Set 1:

Hi Pau,

As a summary I'm going to do:

- Abandon this commit (remove the patchelf_force function and do not implement 
the extra option for the normal patchelf function)
- Abandon https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24281/1.
- I will create the jenkins-build-srslte-bbu.sh as we talked, in a new commit, 
updating if needed the enb-srs.py if needed.

Answering these 2 questions:

- Why does *-common.sh sets the rpath?

For the code I'm seeing from amarisoft epc and ue, it seems that the binaries 
are not patched in the jenkins-build-amarisoft.sh job, so it is done in 
ms-amarisoft. The path that its patched seems different too, as it patches 
"remote_inst" (at least for the epc)

- Why we have a different libc version.

When we build a new toolchain we try to get the latest stable version of each 
library, to get the latest features/stability/performance.
Sadly, the OS running in that platforms it's too old, and because it is a 
leasing we cannot update the system libraries/utilities. That's why we have to 
patch the binary with "--force-rpath". If we could have updated those 
libraries, it would have been way easiest :D.

Thanks for all your suggestions, information and patience, Pau.

Alex


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

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I2d4a105d4843c0d31d6b5d8f8d4195247b290aec
Gerrit-Change-Number: 24272
Gerrit-PatchSet: 1
Gerrit-Owner: alealcon 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 16:31:39 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-gsm-tester[master]: util: adds the feature to force the rpath when patching files.

2021-06-03 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24272 )

Change subject: util: adds the feature to force the rpath when patching files.
..


Patch Set 1:

> Patch Set 1:
>
> Hi Pau, some comments for each question:
>
>  - Should I remove the function and add that parameter to the normal patchelf 
> function? This will help us (as I prefer to set an absolute path on deploy 
> rather that on build), but if you don't approve to modify the rpath inside 
> the srs-enb.py file it doesn't make sense this change and we can remove this 
> commit.
>
> - I agree with you that it makes sense to have different build scripts, each 
> of them supporting different platforms (ppc, aarch64, armv7). What I don't 
> like is that I must set an absolute path for the patchelf utility in those 
> scripts, because if I have 2 different boards with the same platform (ppc for 
> example) that path can change between boards due hardware specs. I would 
> really love to avoid that.
> If you prefer that I add a jenkins-build-stslte-bbu.sh I'm thinking to add 2 
> variables to the jenkins-build-commmon.sh: PATCHELF_RPATH_ARGS='--set-rpath' 
> and PATCHELF_RPATH_DIR='$ORIGIN/../lib/' by default. The 
> jenkins-build-stslte-bbu.sh will overwrite those values to  
> PATCHELF_RPATH_ARGS='--force-rpath --set-rpath' and 
> PATCHELF_RPATH_DIR='/mnt/nfs/bdlibs/'. The call within the *-common.sh would 
> be:
>   if [ -d bin/ ]; then
>   find bin -depth -type f -exec patchelf $PATCHELF_RPATH_ARGS 
> $PATCHELF_RPATH_DIR {} \;
>   fi
>   if [ -d sbin/ ]; then
>   find sbin -depth -type f -exec patchelf $PATCHELF_RPATH_ARGS 
> $PATCHELF_RPATH_DIR {} \;
>
> Does it sound good to you?
>
> One last question regarding the patchelf that is done in 
> jenkins-build-common.sh. Why does that script sets the rpath? Is there a file 
> where the "LD_LIBRARY_PATH" is not set before launching the binary?
> I ask this, because I configure the rpath and the dynamic-linker in the 
> toolchain, and I've tested that removing the call to "add_rpath" in the 
> jenkins-build-common.sh makes the srsenb works without patching it or 
> configuring the LD_LIBRARY_PATH in enb-srs.py.
>
>
> - I did that test. I removed the rpath from a binary and run ldd
>
> root@b4860qds:# 
> LD_LIBRARY_PATH='/mnt/nfs/osmo-gsm-tester-srsenb/srslte/lib:/mnt/nfs/bdlibs' 
> /mnt/nfs/ldd ../srslte/bin/srsenb srsenb.conf
> /bin/sh: /lib/ld.so.1: version `GLIBC_2.22' not found (required by 
> /mnt/nfs/bdlibs/libc.so.6)
>
> It uses the system's ld (/lib/ld.so.1) instead of the toolchain's ld 
> (/mnt/nfs/bdlibs/ld.so.1). Perhaps is because we're using LD_LIBRARY_PATH. 
> Here is the linker section of the srsenb (which points to the right ld):
>
> root@b4860qds:# readelf -l srsenb
>
> El tipo del fichero elf es EXEC (Fichero ejecutable)
> Entry point 0x10020fb8
> There are 10 program headers, starting at offset 52
>
> Encabezados de Programa:
>   Tipo   Desplaz  DirVirtDirFísica  TamFich TamMem  Opt Alin
>   PHDR   0x34 0x1034 0x1034 0x00140 0x00140 R   0x4
>   INTERP 0x000174 0x1174 0x1174 0x00018 0x00018 R   0x1
>   [Requesting program interpreter: /mnt/nfs/bdlibs/ld.so.1]


* [jenkins-build-stslte-bbu.sh]
Fine with it. Regarding, PATCHELF_RPATH_DIR='/mnt/nfs/bdlibs/', it may be 
interesting to plan that variable as being a list of ":" separated paths and 
look at how to use that into patchelf. Because in that case you'd probably need 
to add both PATCHELF_RPATH_DIR='/mnt/nfs/bdlibs/:$ORIGIN/../lib/' ?
BTW, I forgot to talk about it, but patchelf MUST be >= 0.11, older versions 
are really not supported since they contain several bugs. See 
https://osmocom.org/issues/4389 for more info.

* [jenkins-build-common.sh. Why does that script sets the rpath]
That's indeed a good question, and it's probably historical. I started by using 
LD_LIBRARY_PATH at runtime, which is the easiest/quickest to use. However, for 
binaries requiring ADMIN capabilities, it works similar to suid bit, which 
means for security reasons the dynamic loader will disable use of 
LD_LIBRARY_PATH, so we can't use that. We must first hence patch the binary 
with patchelf before running it (could it be that in this case relative RPATH 
is not allowed too? I don't remember TBH).
 The patchelf stuff in jenkins-build-common.sh was added a long time ago by 
Holger why adding some OGT parts which never ended up fully merged with the 
rest of the code (see 9cf1c8afde842febc02ce5fe6f931fe797236a84 and 
src/osmo_ms_driver/). Specially important may be the "lib" part of those lines, 
were all libs are also patched to conform recursively to that RPATH.
In the end, I would say it's up to the "user/dev" adding new trials/classes to 
decide the best way, either by getting rid of the issue at compile time 
(jenkins-build-common.sh), or having to 

Change in osmo-gsm-tester[master]: util: adds the feature to force the rpath when patching files.

2021-06-03 Thread alealcon
alealcon has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24272 )

Change subject: util: adds the feature to force the rpath when patching files.
..


Patch Set 1:

Hi Pau, some comments for each question:

 - Should I remove the function and add that parameter to the normal patchelf 
function? This will help us (as I prefer to set an absolute path on deploy 
rather that on build), but if you don't approve to modify the rpath inside the 
srs-enb.py file it doesn't make sense this change and we can remove this commit.

- I agree with you that it makes sense to have different build scripts, each of 
them supporting different platforms (ppc, aarch64, armv7). What I don't like is 
that I must set an absolute path for the patchelf utility in those scripts, 
because if I have 2 different boards with the same platform (ppc for example) 
that path can change between boards due hardware specs. I would really love to 
avoid that.
If you prefer that I add a jenkins-build-stslte-bbu.sh I'm thinking to add 2 
variables to the jenkins-build-commmon.sh: PATCHELF_RPATH_ARGS='--set-rpath' 
and PATCHELF_RPATH_DIR='$ORIGIN/../lib/' by default. The 
jenkins-build-stslte-bbu.sh will overwrite those values to  
PATCHELF_RPATH_ARGS='--force-rpath --set-rpath' and 
PATCHELF_RPATH_DIR='/mnt/nfs/bdlibs/'. The call within the *-common.sh would be:
if [ -d bin/ ]; then
find bin -depth -type f -exec patchelf $PATCHELF_RPATH_ARGS 
$PATCHELF_RPATH_DIR {} \;
fi
if [ -d sbin/ ]; then
find sbin -depth -type f -exec patchelf $PATCHELF_RPATH_ARGS 
$PATCHELF_RPATH_DIR {} \;

Does it sound good to you?

One last question regarding the patchelf that is done in 
jenkins-build-common.sh. Why does that script sets the rpath? Is there a file 
where the "LD_LIBRARY_PATH" is not set before launching the binary?
I ask this, because I configure the rpath and the dynamic-linker in the 
toolchain, and I've tested that removing the call to "add_rpath" in the 
jenkins-build-common.sh makes the srsenb works without patching it or 
configuring the LD_LIBRARY_PATH in enb-srs.py.


- I did that test. I removed the rpath from a binary and run ldd

root@b4860qds:# 
LD_LIBRARY_PATH='/mnt/nfs/osmo-gsm-tester-srsenb/srslte/lib:/mnt/nfs/bdlibs' 
/mnt/nfs/ldd ../srslte/bin/srsenb srsenb.conf
/bin/sh: /lib/ld.so.1: version `GLIBC_2.22' not found (required by 
/mnt/nfs/bdlibs/libc.so.6)

It uses the system's ld (/lib/ld.so.1) instead of the toolchain's ld 
(/mnt/nfs/bdlibs/ld.so.1). Perhaps is because we're using LD_LIBRARY_PATH. Here 
is the linker section of the srsenb (which points to the right ld):

root@b4860qds:# readelf -l srsenb

El tipo del fichero elf es EXEC (Fichero ejecutable)
Entry point 0x10020fb8
There are 10 program headers, starting at offset 52

Encabezados de Programa:
  Tipo   Desplaz  DirVirtDirFísica  TamFich TamMem  Opt Alin
  PHDR   0x34 0x1034 0x1034 0x00140 0x00140 R   0x4
  INTERP 0x000174 0x1174 0x1174 0x00018 0x00018 R   0x1
  [Requesting program interpreter: /mnt/nfs/bdlibs/ld.so.1]


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

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I2d4a105d4843c0d31d6b5d8f8d4195247b290aec
Gerrit-Change-Number: 24272
Gerrit-PatchSet: 1
Gerrit-Owner: alealcon 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 14:49:44 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: RSL chan_nr: replace OSMO_ASSERT with error handling

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

Change subject: RSL chan_nr: replace OSMO_ASSERT with error handling
..


Patch Set 3: Code-Review+1

(2 comments)

https://gerrit.osmocom.org/c/osmo-bsc/+/24524/3/src/osmo-bsc/abis_rsl.c
File src/osmo-bsc/abis_rsl.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/24524/3/src/osmo-bsc/abis_rsl.c@292
PS3, Line 292:
maybe cast to (uint8_t) to mark that this is cast (chan_nr was uint8_t before) ?


https://gerrit.osmocom.org/c/osmo-bsc/+/24524/3/src/osmo-bsc/osmo_bsc_lcls.c
File src/osmo-bsc/osmo_bsc_lcls.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/24524/3/src/osmo-bsc/osmo_bsc_lcls.c@253
PS3, Line 253:msg = rsl_make_ipacc_mdcx(lchan, ip, port);
Isn't that unrelated?



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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I71ed6437c403a3f9336e17a94b4948fca295d853
Gerrit-Change-Number: 24524
Gerrit-PatchSet: 3
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 13:27:33 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: firmware: octsimtest: Fix disabling the card_insert signal

2021-06-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24538 )

Change subject: firmware: octsimtest: Fix disabling the card_insert signal
..

firmware: octsimtest: Fix disabling the card_insert signal

Back in I8c9b0c3d862a967832134b24252577739182da62 we added support
for enabling the card_insert signal, but not for explicit disable
of it.  Let's fix that.

Change-Id: I6f32bde60674119c9912e51059a53b5ee74d074a
---
M firmware/libboard/octsimtest/source/board_octsimtest.c
1 file changed, 7 insertions(+), 2 deletions(-)

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



diff --git a/firmware/libboard/octsimtest/source/board_octsimtest.c 
b/firmware/libboard/octsimtest/source/board_octsimtest.c
index 1c6a278..5dff046 100644
--- a/firmware/libboard/octsimtest/source/board_octsimtest.c
+++ b/firmware/libboard/octsimtest/source/board_octsimtest.c
@@ -103,8 +103,13 @@
 * the sim-present signal of the respective slot */

if (mcp2317_present) {
-   /* we must enable card-presence of the active slot and disable 
it on all others */
-   mcp23017_set_output_a(MCP23017_ADDRESS, (1 << s));
+   if (card_insert) {
+   /* we must enable card-presence of the active slot and 
disable it on all others */
+   mcp23017_set_output_a(MCP23017_ADDRESS, (1 << s));
+   } else {
+   /* we disable all card insert signals */
+   mcp23017_set_output_a(MCP23017_ADDRESS, 0);
+   }
} else {
TRACE_WARNING("No MCP23017 present; cannot set 
CARD_INSERT\r\n");
}

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I6f32bde60674119c9912e51059a53b5ee74d074a
Gerrit-Change-Number: 24538
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in osmo-bsc[master]: RSL chan_nr: replace OSMO_ASSERT with error handling

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

Change subject: RSL chan_nr: replace OSMO_ASSERT with error handling
..


Patch Set 3: Code-Review+1


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I71ed6437c403a3f9336e17a94b4948fca295d853
Gerrit-Change-Number: 24524
Gerrit-PatchSet: 3
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 13:10:00 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: firmware: octsimtest: Fix disabling the card_insert signal

2021-06-03 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24538 )

Change subject: firmware: octsimtest: Fix disabling the card_insert signal
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I6f32bde60674119c9912e51059a53b5ee74d074a
Gerrit-Change-Number: 24538
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 03 Jun 2021 13:09:53 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: RSL chan_nr: replace OSMO_ASSERT with error handling

2021-06-03 Thread neels
Hello Jenkins Builder, pespin,

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

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

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

Change subject: RSL chan_nr: replace OSMO_ASSERT with error handling
..

RSL chan_nr: replace OSMO_ASSERT with error handling

It's bad to abort the program for an incompatible chan_nr.  Instead of
OSMO_ASSERT(), make sure that error handling happens all they way to the
original callers of gsm_lchan2chan_nr etc.

This is also preparation to add further error causes: Osmocom specific
cbits needed for a non-Osmo BTS.

Related: SYS#5315 OS#4940
Change-Id: I71ed6437c403a3f9336e17a94b4948fca295d853
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/gsm_04_08_rr.c
M src/osmo-bsc/gsm_data.c
M src/osmo-bsc/lcs_loc_req.c
M src/osmo-bsc/osmo_bsc_lcls.c
M src/osmo-bsc/system_information.c
M tests/handover/handover_test.c
8 files changed, 184 insertions(+), 60 deletions(-)


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I71ed6437c403a3f9336e17a94b4948fca295d853
Gerrit-Change-Number: 24524
Gerrit-PatchSet: 3
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in simtrace2[master]: firmware: octsimtest: Fix disabling the card_insert signal

2021-06-03 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24538 )


Change subject: firmware: octsimtest: Fix disabling the card_insert signal
..

firmware: octsimtest: Fix disabling the card_insert signal

Back in I8c9b0c3d862a967832134b24252577739182da62 we added support
for enabling the card_insert signal, but not for explicit disable
of it.  Let's fix that.

Change-Id: I6f32bde60674119c9912e51059a53b5ee74d074a
---
M firmware/libboard/octsimtest/source/board_octsimtest.c
1 file changed, 7 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/38/24538/1

diff --git a/firmware/libboard/octsimtest/source/board_octsimtest.c 
b/firmware/libboard/octsimtest/source/board_octsimtest.c
index 1c6a278..5dff046 100644
--- a/firmware/libboard/octsimtest/source/board_octsimtest.c
+++ b/firmware/libboard/octsimtest/source/board_octsimtest.c
@@ -103,8 +103,13 @@
 * the sim-present signal of the respective slot */

if (mcp2317_present) {
-   /* we must enable card-presence of the active slot and disable 
it on all others */
-   mcp23017_set_output_a(MCP23017_ADDRESS, (1 << s));
+   if (card_insert) {
+   /* we must enable card-presence of the active slot and 
disable it on all others */
+   mcp23017_set_output_a(MCP23017_ADDRESS, (1 << s));
+   } else {
+   /* we disable all card insert signals */
+   mcp23017_set_output_a(MCP23017_ADDRESS, 0);
+   }
} else {
TRACE_WARNING("No MCP23017 present; cannot set 
CARD_INSERT\r\n");
}

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I6f32bde60674119c9912e51059a53b5ee74d074a
Gerrit-Change-Number: 24538
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in simtrace2[master]: firmware: octsimtest: use TRACE_* macros instead of direct printf

2021-06-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24537 )

Change subject: firmware: octsimtest: use TRACE_* macros instead of direct 
printf
..

firmware: octsimtest: use TRACE_* macros instead of direct printf

Change-Id: I41864bc2f64905a4f2ccb50769b1840e8a490c76
---
M firmware/libboard/octsimtest/source/mcp23017.c
M firmware/libboard/octsimtest/source/mux.c
2 files changed, 5 insertions(+), 5 deletions(-)

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



diff --git a/firmware/libboard/octsimtest/source/mcp23017.c 
b/firmware/libboard/octsimtest/source/mcp23017.c
index bc6bd49..959f2c6 100644
--- a/firmware/libboard/octsimtest/source/mcp23017.c
+++ b/firmware/libboard/octsimtest/source/mcp23017.c
@@ -94,7 +94,7 @@

 int mcp23017_init(uint8_t slave, uint8_t iodira, uint8_t iodirb)
 {
-   printf("mcp23017_init\n\r");
+   TRACE_DEBUG("mcp23017_init\n\r");

// all gpio input
if (mcp23017_write_byte(slave, MCP23017_IODIRA, iodira))
@@ -105,11 +105,11 @@
if (mcp23017_write_byte(slave, MCP23017_IOCONA, 0x20)) //disable SEQOP 
(autoinc addressing)
goto out_err;

-   printf("mcp23017 found\n\r");
+   TRACE_DEBUG("mcp23017 found\n\r");
return 0;

 out_err:
-   printf("mcp23017 NOT found!\n\r");
+   TRACE_WARNING("mcp23017 NOT found!\n\r");
return -1;
 }

diff --git a/firmware/libboard/octsimtest/source/mux.c 
b/firmware/libboard/octsimtest/source/mux.c
index 54c6cb6..8800ba2 100644
--- a/firmware/libboard/octsimtest/source/mux.c
+++ b/firmware/libboard/octsimtest/source/mux.c
@@ -54,7 +54,7 @@
 /* set the slot selection mux */
 int mux_set_slot(uint8_t s)
 {
-   printf("%s(%u)\r\n", __func__, s);
+   TRACE_INFO("%s(%u)\r\n", __func__, s);

if (s > 7)
return -EINVAL;
@@ -90,7 +90,7 @@
 /* set the frequency divider mux */
 void mux_set_freq(uint8_t s)
 {
-   printf("%s(%u)\r\n", __func__, s);
+   TRACE_INFO("%s(%u)\r\n", __func__, s);

/* no need for 'break before make' here, this would also affect
 * the SIM card I/O signals which we don't want to disturb */

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I41864bc2f64905a4f2ccb50769b1840e8a490c76
Gerrit-Change-Number: 24537
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in simtrace2[master]: firmware: octsimtest: Support SIMTRACE_MSGT_DT_CEMU_CARDINSERT

2021-06-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24536 )

Change subject: firmware: octsimtest: Support SIMTRACE_MSGT_DT_CEMU_CARDINSERT
..

firmware: octsimtest: Support SIMTRACE_MSGT_DT_CEMU_CARDINSERT

The octsimtest board can control the card-insert contact of the OCTSIM
under test via an external I2C gpio multiplexer; let's add support for
that.

Change-Id: I8c9b0c3d862a967832134b24252577739182da62
---
M firmware/libboard/octsimtest/include/board.h
M firmware/libboard/octsimtest/include/mcp23017.h
M firmware/libboard/octsimtest/source/board_octsimtest.c
M firmware/libboard/octsimtest/source/mcp23017.c
M firmware/libcommon/source/mode_cardemu.c
5 files changed, 35 insertions(+), 0 deletions(-)

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



diff --git a/firmware/libboard/octsimtest/include/board.h 
b/firmware/libboard/octsimtest/include/board.h
index ad21a1f..530f27b 100644
--- a/firmware/libboard/octsimtest/include/board.h
+++ b/firmware/libboard/octsimtest/include/board.h
@@ -111,6 +111,10 @@

 #define HAVE_SLOT_MUX

+#define HAVE_BOARD_CARDINSERT
+struct cardem_inst;
+void board_set_card_insert(struct cardem_inst *ci, bool card_insert);
+
 /** Supported modes */
 /* SIMtrace board supports sniffer mode */
 //#define HAVE_SNIFFER
diff --git a/firmware/libboard/octsimtest/include/mcp23017.h 
b/firmware/libboard/octsimtest/include/mcp23017.h
index c0f4b13..190588f 100644
--- a/firmware/libboard/octsimtest/include/mcp23017.h
+++ b/firmware/libboard/octsimtest/include/mcp23017.h
@@ -21,5 +21,7 @@
 int mcp23017_init(uint8_t slave, uint8_t iodira, uint8_t iodirb);
 int mcp23017_test(uint8_t slave);
 int mcp23017_toggle(uint8_t slave);
+int mcp23017_set_output_a(uint8_t slave, uint8_t val);
+int mcp23017_set_output_b(uint8_t slave, uint8_t val);
 //int mcp23017_write_byte(uint8_t slave, uint8_t addr, uint8_t byte);
 //int mcp23017_read_byte(uint8_t slave, uint8_t addr);
diff --git a/firmware/libboard/octsimtest/source/board_octsimtest.c 
b/firmware/libboard/octsimtest/source/board_octsimtest.c
index 404bef6..1c6a278 100644
--- a/firmware/libboard/octsimtest/source/board_octsimtest.c
+++ b/firmware/libboard/octsimtest/source/board_octsimtest.c
@@ -94,3 +94,18 @@
} else
return 0;
 }
+
+void board_set_card_insert(struct cardem_inst *ci, bool card_insert)
+{
+   int s = mux_get_slot();
+
+   /* A0 .. A7 of the MCP are each connected to the gate of a FET which 
closes
+* the sim-present signal of the respective slot */
+
+   if (mcp2317_present) {
+   /* we must enable card-presence of the active slot and disable 
it on all others */
+   mcp23017_set_output_a(MCP23017_ADDRESS, (1 << s));
+   } else {
+   TRACE_WARNING("No MCP23017 present; cannot set 
CARD_INSERT\r\n");
+   }
+}
diff --git a/firmware/libboard/octsimtest/source/mcp23017.c 
b/firmware/libboard/octsimtest/source/mcp23017.c
index a4d055f..bc6bd49 100644
--- a/firmware/libboard/octsimtest/source/mcp23017.c
+++ b/firmware/libboard/octsimtest/source/mcp23017.c
@@ -126,6 +126,16 @@
return 0;
 }

+int mcp23017_set_output_a(uint8_t slave, uint8_t val)
+{
+   return mcp23017_write_byte(slave, MCP23017_OLATA, val);
+}
+
+int mcp23017_set_output_b(uint8_t slave, uint8_t val)
+{
+   return mcp23017_write_byte(slave, MCP23017_OLATB, val);
+}
+
 int mcp23017_toggle(uint8_t slave)
 {
// example writing MSB of gpio
diff --git a/firmware/libcommon/source/mode_cardemu.c 
b/firmware/libcommon/source/mode_cardemu.c
index 3863767..a357f15 100644
--- a/firmware/libcommon/source/mode_cardemu.c
+++ b/firmware/libcommon/source/mode_cardemu.c
@@ -656,6 +656,9 @@
 {
TRACE_INFO("%u: set card_insert to %s\r\n", ci->num, card_insert ? 
"INSERTED" : "REMOVED");

+#ifdef HAVE_BOARD_CARDINSERT
+   board_set_card_insert(ci, card_insert);
+#else
if (!ci->pin_insert.pio) {
TRACE_INFO("%u: skipping unsupported card_insert to %s\r\n",
   ci->num, card_insert ? "INSERTED" : "REMOVED");
@@ -666,6 +669,7 @@
PIO_Set(>pin_insert);
else
PIO_Clear(>pin_insert);
+#endif
 }

 /* handle a single USB command as received from the USB host */

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I8c9b0c3d862a967832134b24252577739182da62
Gerrit-Change-Number: 24536
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in simtrace2[master]: firmware: cardem: re-factor CARDINSERT command processing

2021-06-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24535 )

Change subject: firmware: cardem: re-factor CARDINSERT command processing
..

firmware: cardem: re-factor CARDINSERT command processing

move it out of the general command dispatch switch statement
and into a separate function.

Change-Id: Ia40c3dbe68248da0dcc69d298450ca6e4869
---
M firmware/libcommon/source/mode_cardemu.c
1 file changed, 17 insertions(+), 12 deletions(-)

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



diff --git a/firmware/libcommon/source/mode_cardemu.c 
b/firmware/libcommon/source/mode_cardemu.c
index 8a59e16..3863767 100644
--- a/firmware/libcommon/source/mode_cardemu.c
+++ b/firmware/libcommon/source/mode_cardemu.c
@@ -652,6 +652,22 @@
usb_buf_free(msg);
 }

+static void process_card_insert(struct cardem_inst *ci, bool card_insert)
+{
+   TRACE_INFO("%u: set card_insert to %s\r\n", ci->num, card_insert ? 
"INSERTED" : "REMOVED");
+
+   if (!ci->pin_insert.pio) {
+   TRACE_INFO("%u: skipping unsupported card_insert to %s\r\n",
+  ci->num, card_insert ? "INSERTED" : "REMOVED");
+   return;
+   }
+
+   if (card_insert)
+   PIO_Set(>pin_insert);
+   else
+   PIO_Clear(>pin_insert);
+}
+
 /* handle a single USB command as received from the USB host */
 static void dispatch_usb_command_cardem(struct msgb *msg, struct cardem_inst 
*ci)
 {
@@ -675,18 +691,7 @@
break;
case SIMTRACE_MSGT_DT_CEMU_CARDINSERT:
cardins = (struct cardemu_usb_msg_cardinsert *) msg->l2h;
-   if (!ci->pin_insert.pio) {
-   TRACE_INFO("%u: skipping unsupported card_insert to 
%s\r\n",
-  ci->num, cardins->card_insert ? "INSERTED" : 
"REMOVED");
-   usb_buf_free(msg);
-   break;
-   }
-   TRACE_INFO("%u: set card_insert to %s\r\n", ci->num,
-  cardins->card_insert ? "INSERTED" : "REMOVED");
-   if (cardins->card_insert)
-   PIO_Set(>pin_insert);
-   else
-   PIO_Clear(>pin_insert);
+   process_card_insert(ci, cardins->card_insert);
usb_buf_free(msg);
break;
case SIMTRACE_MSGT_BD_CEMU_STATUS:

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ia40c3dbe68248da0dcc69d298450ca6e4869
Gerrit-Change-Number: 24535
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in simtrace2[master]: firmware: octsimtest: use TRACE_* macros instead of direct printf

2021-06-03 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24537 )

Change subject: firmware: octsimtest: use TRACE_* macros instead of direct 
printf
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I41864bc2f64905a4f2ccb50769b1840e8a490c76
Gerrit-Change-Number: 24537
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 03 Jun 2021 12:56:04 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: firmware: octsimtest: Support SIMTRACE_MSGT_DT_CEMU_CARDINSERT

2021-06-03 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24536 )

Change subject: firmware: octsimtest: Support SIMTRACE_MSGT_DT_CEMU_CARDINSERT
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I8c9b0c3d862a967832134b24252577739182da62
Gerrit-Change-Number: 24536
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 03 Jun 2021 12:55:49 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: firmware: cardem: re-factor CARDINSERT command processing

2021-06-03 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24535 )

Change subject: firmware: cardem: re-factor CARDINSERT command processing
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ia40c3dbe68248da0dcc69d298450ca6e4869
Gerrit-Change-Number: 24535
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 03 Jun 2021 12:55:36 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: firmware: octsimtest: mcp23017 initializaiton

2021-06-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24534 )

Change subject: firmware: octsimtest: mcp23017 initializaiton
..

firmware: octsimtest: mcp23017 initializaiton

* driver should not have hard-coded understanding about I/O directions
* board code should pass the I/O direction to driver
* board code should use the correct I/O directions (A0..7, B0: output)

Change-Id: Id4a8e012a33cee01bb489e612e17920760b9be59
---
M firmware/libboard/octsimtest/include/mcp23017.h
M firmware/libboard/octsimtest/source/board_octsimtest.c
M firmware/libboard/octsimtest/source/mcp23017.c
3 files changed, 20 insertions(+), 10 deletions(-)

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



diff --git a/firmware/libboard/octsimtest/include/mcp23017.h 
b/firmware/libboard/octsimtest/include/mcp23017.h
index 962a1d5..c0f4b13 100644
--- a/firmware/libboard/octsimtest/include/mcp23017.h
+++ b/firmware/libboard/octsimtest/include/mcp23017.h
@@ -18,7 +18,7 @@

 #define MCP23017_ADDRESS 0x20

-int mcp23017_init(uint8_t slave);
+int mcp23017_init(uint8_t slave, uint8_t iodira, uint8_t iodirb);
 int mcp23017_test(uint8_t slave);
 int mcp23017_toggle(uint8_t slave);
 //int mcp23017_write_byte(uint8_t slave, uint8_t addr, uint8_t byte);
diff --git a/firmware/libboard/octsimtest/source/board_octsimtest.c 
b/firmware/libboard/octsimtest/source/board_octsimtest.c
index 85d8aab..404bef6 100644
--- a/firmware/libboard/octsimtest/source/board_octsimtest.c
+++ b/firmware/libboard/octsimtest/source/board_octsimtest.c
@@ -17,6 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA
  */
+#include 
 #include "board.h"
 #include "simtrace.h"
 #include "utils.h"
@@ -27,6 +28,8 @@
 #include "mcp23017.h"
 #include "mux.h"

+static bool mcp2317_present = false;
+
 void board_exec_dbg_cmd(int ch)
 {
switch (ch) {
@@ -69,8 +72,9 @@

mux_init();
i2c_pin_init();
-   if (!mcp23017_init(MCP23017_ADDRESS))
-   printf("mcp23017 not found!\n\r");
+   /* PORT A: all outputs, Port B0 output, B1..B7 unused */
+   if (mcp23017_init(MCP23017_ADDRESS, 0x00, 0xfe) == 0)
+   mcp2317_present = true;
/* Initialize checking for card insert/remove events */
//card_present_init();
 #endif
diff --git a/firmware/libboard/octsimtest/source/mcp23017.c 
b/firmware/libboard/octsimtest/source/mcp23017.c
index 167bf34..a4d055f 100644
--- a/firmware/libboard/octsimtest/source/mcp23017.c
+++ b/firmware/libboard/octsimtest/source/mcp23017.c
@@ -92,19 +92,25 @@
return 0;
 }

-int mcp23017_init(uint8_t slave)
+int mcp23017_init(uint8_t slave, uint8_t iodira, uint8_t iodirb)
 {
printf("mcp23017_init\n\r");
+
// all gpio input
-   if (mcp23017_write_byte(slave, MCP23017_IODIRA, 0xff))
-   return false;
+   if (mcp23017_write_byte(slave, MCP23017_IODIRA, iodira))
+   goto out_err;
// msb of portb output, rest input
-   if (mcp23017_write_byte(slave, MCP23017_IODIRB, 0x7f))
-   return false;
+   if (mcp23017_write_byte(slave, MCP23017_IODIRB, iodirb))
+   goto out_err;
if (mcp23017_write_byte(slave, MCP23017_IOCONA, 0x20)) //disable SEQOP 
(autoinc addressing)
-   return false;
+   goto out_err;
+
printf("mcp23017 found\n\r");
-   return true;
+   return 0;
+
+out_err:
+   printf("mcp23017 NOT found!\n\r");
+   return -1;
 }

 int mcp23017_test(uint8_t slave)

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Id4a8e012a33cee01bb489e612e17920760b9be59
Gerrit-Change-Number: 24534
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in simtrace2[master]: firmware: octsimtest: Make slot mux configurable via USB

2021-06-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24533 )

Change subject: firmware: octsimtest: Make slot mux configurable via USB
..

firmware: octsimtest: Make slot mux configurable via USB

Change-Id: I4cdb250d2e1dbc5b8b0169f8b7c21e288b492e1d
---
M firmware/libboard/octsimtest/include/board.h
M firmware/libboard/octsimtest/include/mux.h
M firmware/libboard/octsimtest/source/mux.c
M firmware/libcommon/include/simtrace_prot.h
M firmware/libcommon/source/card_emu.c
5 files changed, 36 insertions(+), 2 deletions(-)

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



diff --git a/firmware/libboard/octsimtest/include/board.h 
b/firmware/libboard/octsimtest/include/board.h
index 171b2c1..ad21a1f 100644
--- a/firmware/libboard/octsimtest/include/board.h
+++ b/firmware/libboard/octsimtest/include/board.h
@@ -109,6 +109,8 @@
 #define VCC_UV_THRESH_1V8  (150*47)/(47+30)
 #define VCC_UV_THRESH_3V   (250*47)/(47+30)

+#define HAVE_SLOT_MUX
+
 /** Supported modes */
 /* SIMtrace board supports sniffer mode */
 //#define HAVE_SNIFFER
diff --git a/firmware/libboard/octsimtest/include/mux.h 
b/firmware/libboard/octsimtest/include/mux.h
index ba7ae9f..3181478 100644
--- a/firmware/libboard/octsimtest/include/mux.h
+++ b/firmware/libboard/octsimtest/include/mux.h
@@ -1,7 +1,8 @@
 #pragma once

 void mux_init(void);
-void mux_set_slot(uint8_t s);
+int mux_set_slot(uint8_t s);
+int mux_get_slot(void);
 void mux_set_freq(uint8_t s);

 /* this reflects the wiring between U5 and U4 */
diff --git a/firmware/libboard/octsimtest/source/mux.c 
b/firmware/libboard/octsimtest/source/mux.c
index 8d9f625..54c6cb6 100644
--- a/firmware/libboard/octsimtest/source/mux.c
+++ b/firmware/libboard/octsimtest/source/mux.c
@@ -20,6 +20,7 @@
 #include "board.h"
 #include "mux.h"
 #include 
+#include 

 /* 3-bit S0..S2 signal for slot selection */
 static const Pin pin_in_sel[3] = {
@@ -38,6 +39,8 @@
 /* low-active output enable for all muxes */
 static const Pin pin_oe = { PIO_PA19, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT 
};

+static uint8_t g_mux_slot = 0;
+
 /* initialize the external 1:8 multiplexers */
 void mux_init(void)
 {
@@ -49,10 +52,13 @@
 }

 /* set the slot selection mux */
-void mux_set_slot(uint8_t s)
+int mux_set_slot(uint8_t s)
 {
printf("%s(%u)\r\n", __func__, s);

+   if (s > 7)
+   return -EINVAL;
+
/* !OE = H: disconnect input and output of muxes */
PIO_Set(_oe);

@@ -71,6 +77,14 @@

/* !OE = L: (re-)enable the output of muxes */
PIO_Clear(_oe);
+
+   g_mux_slot = s;
+   return s;
+}
+
+int mux_get_slot(void)
+{
+   return g_mux_slot;
 }

 /* set the frequency divider mux */
diff --git a/firmware/libcommon/include/simtrace_prot.h 
b/firmware/libcommon/include/simtrace_prot.h
index e550616..5eb4f59 100644
--- a/firmware/libcommon/include/simtrace_prot.h
+++ b/firmware/libcommon/include/simtrace_prot.h
@@ -269,6 +269,8 @@
 struct cardemu_usb_msg_config {
/* bit-mask of CEMU_FEAT_F flags */
uint32_t features;
+   /* the selected slot number (if an external mux is present) */
+   uint8_t slot_mux_nr;
 } __attribute__ ((packed));

 /***
diff --git a/firmware/libcommon/source/card_emu.c 
b/firmware/libcommon/source/card_emu.c
index bcd5fd6..4b84039 100644
--- a/firmware/libcommon/source/card_emu.c
+++ b/firmware/libcommon/source/card_emu.c
@@ -33,6 +33,9 @@
 #include 
 #include 

+#ifdef HAVE_SLOT_MUX
+#include "mux.h"
+#endif

 #define NUM_SLOTS  2

@@ -1079,6 +1082,12 @@

cfg = (struct cardemu_usb_msg_config *) msgb_put(msg, sizeof(*cfg));
cfg->features = ch->features;
+#ifdef HAVE_SLOT_MUX
+   cfg->slot_mux_nr = mux_get_slot();
+#else
+   cfg->slot_mux_nr = 0;
+#endif
+

usb_buf_upd_len_and_submit(msg);
 }
@@ -1241,6 +1250,12 @@
if (scfg_len >= sizeof(uint32_t))
ch->features = (scfg->features & SUPPORTED_FEATURES);

+#ifdef HAVE_SLOT_MUX
+   if (scfg_len >= sizeof(uint32_t)+sizeof(uint8_t)) {
+   mux_set_slot(scfg->slot_mux_nr);
+   }
+#endif
+
/* send back a report of our current configuration */
card_emu_report_config(ch);


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I4cdb250d2e1dbc5b8b0169f8b7c21e288b492e1d
Gerrit-Change-Number: 24533
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in simtrace2[master]: firmware: octsimtest: Fix IO_DIR pin definition

2021-06-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24532 )

Change subject: firmware: octsimtest: Fix IO_DIR pin definition
..

firmware: octsimtest: Fix IO_DIR pin definition

Change-Id: I776c9106bcd4ceb24a5d50ea05c6025dedb73822
---
M firmware/libboard/octsimtest/include/board.h
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/firmware/libboard/octsimtest/include/board.h 
b/firmware/libboard/octsimtest/include/board.h
index 2d8a896..171b2c1 100644
--- a/firmware/libboard/octsimtest/include/board.h
+++ b/firmware/libboard/octsimtest/include/board.h
@@ -63,7 +63,7 @@
 /* Phone CLK clock input (CLK_PHONE in schematic) */
 #define PIN_PHONE_CLK  {PIO_PA23A_SCK1, PIOA, ID_PIOA, PIO_PERIPH_A, 
PIO_DEFAULT}
 /* Pin used to switch level shifter in I/O line between rx (0) and tx (1) */
-#define PIN_USIM1_IO_DIR   {PIO_PA16, PIOA, ID_PIOA, PIO_PERIPH_A, 
PIO_OUTPUT_0}
+#define PIN_USIM1_IO_DIR   {PIO_PA26, PIOA, ID_PIOA, PIO_OUTPUT_0, 
PIO_DEFAULT}
 /* Pin used for phone USIM slot 1 communication */
 #define PINS_USIM1  PIN_PHONE_IO, PIN_PHONE_CLK, 
PIN_PHONE_CLK_INPUT, PIN_USIM1_VCC, PIN_PHONE_IO_INPUT, PIN_USIM1_nRST, 
PIN_USIM1_IO_DIR
 /* Phone I/O data signal input/output (unused USART RX input; connected to 
I/O_PHONE in schematic) */

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I776c9106bcd4ceb24a5d50ea05c6025dedb73822
Gerrit-Change-Number: 24532
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in simtrace2[master]: firmware: octsimtest: mcp23017 initializaiton

2021-06-03 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24534 )

Change subject: firmware: octsimtest: mcp23017 initializaiton
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Id4a8e012a33cee01bb489e612e17920760b9be59
Gerrit-Change-Number: 24534
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 03 Jun 2021 12:55:19 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: firmware: octsimtest: Make slot mux configurable via USB

2021-06-03 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24533 )

Change subject: firmware: octsimtest: Make slot mux configurable via USB
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I4cdb250d2e1dbc5b8b0169f8b7c21e288b492e1d
Gerrit-Change-Number: 24533
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 03 Jun 2021 12:55:06 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: firmware: octsimtest: Fix IO_DIR pin definition

2021-06-03 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24532 )

Change subject: firmware: octsimtest: Fix IO_DIR pin definition
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I776c9106bcd4ceb24a5d50ea05c6025dedb73822
Gerrit-Change-Number: 24532
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 03 Jun 2021 12:54:57 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: firmware: octsimtest: use TRACE_* macros instead of direct printf

2021-06-03 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24537 )


Change subject: firmware: octsimtest: use TRACE_* macros instead of direct 
printf
..

firmware: octsimtest: use TRACE_* macros instead of direct printf

Change-Id: I41864bc2f64905a4f2ccb50769b1840e8a490c76
---
M firmware/libboard/octsimtest/source/mcp23017.c
M firmware/libboard/octsimtest/source/mux.c
2 files changed, 5 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/37/24537/1

diff --git a/firmware/libboard/octsimtest/source/mcp23017.c 
b/firmware/libboard/octsimtest/source/mcp23017.c
index bc6bd49..959f2c6 100644
--- a/firmware/libboard/octsimtest/source/mcp23017.c
+++ b/firmware/libboard/octsimtest/source/mcp23017.c
@@ -94,7 +94,7 @@

 int mcp23017_init(uint8_t slave, uint8_t iodira, uint8_t iodirb)
 {
-   printf("mcp23017_init\n\r");
+   TRACE_DEBUG("mcp23017_init\n\r");

// all gpio input
if (mcp23017_write_byte(slave, MCP23017_IODIRA, iodira))
@@ -105,11 +105,11 @@
if (mcp23017_write_byte(slave, MCP23017_IOCONA, 0x20)) //disable SEQOP 
(autoinc addressing)
goto out_err;

-   printf("mcp23017 found\n\r");
+   TRACE_DEBUG("mcp23017 found\n\r");
return 0;

 out_err:
-   printf("mcp23017 NOT found!\n\r");
+   TRACE_WARNING("mcp23017 NOT found!\n\r");
return -1;
 }
 
diff --git a/firmware/libboard/octsimtest/source/mux.c 
b/firmware/libboard/octsimtest/source/mux.c
index 54c6cb6..8800ba2 100644
--- a/firmware/libboard/octsimtest/source/mux.c
+++ b/firmware/libboard/octsimtest/source/mux.c
@@ -54,7 +54,7 @@
 /* set the slot selection mux */
 int mux_set_slot(uint8_t s)
 {
-   printf("%s(%u)\r\n", __func__, s);
+   TRACE_INFO("%s(%u)\r\n", __func__, s);

if (s > 7)
return -EINVAL;
@@ -90,7 +90,7 @@
 /* set the frequency divider mux */
 void mux_set_freq(uint8_t s)
 {
-   printf("%s(%u)\r\n", __func__, s);
+   TRACE_INFO("%s(%u)\r\n", __func__, s);

/* no need for 'break before make' here, this would also affect
 * the SIM card I/O signals which we don't want to disturb */

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I41864bc2f64905a4f2ccb50769b1840e8a490c76
Gerrit-Change-Number: 24537
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in simtrace2[master]: firmware: octsimtest: Support SIMTRACE_MSGT_DT_CEMU_CARDINSERT

2021-06-03 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24536 )


Change subject: firmware: octsimtest: Support SIMTRACE_MSGT_DT_CEMU_CARDINSERT
..

firmware: octsimtest: Support SIMTRACE_MSGT_DT_CEMU_CARDINSERT

The octsimtest board can control the card-insert contact of the OCTSIM
under test via an external I2C gpio multiplexer; let's add support for
that.

Change-Id: I8c9b0c3d862a967832134b24252577739182da62
---
M firmware/libboard/octsimtest/include/board.h
M firmware/libboard/octsimtest/include/mcp23017.h
M firmware/libboard/octsimtest/source/board_octsimtest.c
M firmware/libboard/octsimtest/source/mcp23017.c
M firmware/libcommon/source/mode_cardemu.c
5 files changed, 35 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/36/24536/1

diff --git a/firmware/libboard/octsimtest/include/board.h 
b/firmware/libboard/octsimtest/include/board.h
index ad21a1f..530f27b 100644
--- a/firmware/libboard/octsimtest/include/board.h
+++ b/firmware/libboard/octsimtest/include/board.h
@@ -111,6 +111,10 @@

 #define HAVE_SLOT_MUX

+#define HAVE_BOARD_CARDINSERT
+struct cardem_inst;
+void board_set_card_insert(struct cardem_inst *ci, bool card_insert);
+
 /** Supported modes */
 /* SIMtrace board supports sniffer mode */
 //#define HAVE_SNIFFER
diff --git a/firmware/libboard/octsimtest/include/mcp23017.h 
b/firmware/libboard/octsimtest/include/mcp23017.h
index c0f4b13..190588f 100644
--- a/firmware/libboard/octsimtest/include/mcp23017.h
+++ b/firmware/libboard/octsimtest/include/mcp23017.h
@@ -21,5 +21,7 @@
 int mcp23017_init(uint8_t slave, uint8_t iodira, uint8_t iodirb);
 int mcp23017_test(uint8_t slave);
 int mcp23017_toggle(uint8_t slave);
+int mcp23017_set_output_a(uint8_t slave, uint8_t val);
+int mcp23017_set_output_b(uint8_t slave, uint8_t val);
 //int mcp23017_write_byte(uint8_t slave, uint8_t addr, uint8_t byte);
 //int mcp23017_read_byte(uint8_t slave, uint8_t addr);
diff --git a/firmware/libboard/octsimtest/source/board_octsimtest.c 
b/firmware/libboard/octsimtest/source/board_octsimtest.c
index 404bef6..1c6a278 100644
--- a/firmware/libboard/octsimtest/source/board_octsimtest.c
+++ b/firmware/libboard/octsimtest/source/board_octsimtest.c
@@ -94,3 +94,18 @@
} else
return 0;
 }
+
+void board_set_card_insert(struct cardem_inst *ci, bool card_insert)
+{
+   int s = mux_get_slot();
+
+   /* A0 .. A7 of the MCP are each connected to the gate of a FET which 
closes
+* the sim-present signal of the respective slot */
+
+   if (mcp2317_present) {
+   /* we must enable card-presence of the active slot and disable 
it on all others */
+   mcp23017_set_output_a(MCP23017_ADDRESS, (1 << s));
+   } else {
+   TRACE_WARNING("No MCP23017 present; cannot set 
CARD_INSERT\r\n");
+   }
+}
diff --git a/firmware/libboard/octsimtest/source/mcp23017.c 
b/firmware/libboard/octsimtest/source/mcp23017.c
index a4d055f..bc6bd49 100644
--- a/firmware/libboard/octsimtest/source/mcp23017.c
+++ b/firmware/libboard/octsimtest/source/mcp23017.c
@@ -126,6 +126,16 @@
return 0;
 }

+int mcp23017_set_output_a(uint8_t slave, uint8_t val)
+{
+   return mcp23017_write_byte(slave, MCP23017_OLATA, val);
+}
+
+int mcp23017_set_output_b(uint8_t slave, uint8_t val)
+{
+   return mcp23017_write_byte(slave, MCP23017_OLATB, val);
+}
+
 int mcp23017_toggle(uint8_t slave)
 {
// example writing MSB of gpio
diff --git a/firmware/libcommon/source/mode_cardemu.c 
b/firmware/libcommon/source/mode_cardemu.c
index 3863767..a357f15 100644
--- a/firmware/libcommon/source/mode_cardemu.c
+++ b/firmware/libcommon/source/mode_cardemu.c
@@ -656,6 +656,9 @@
 {
TRACE_INFO("%u: set card_insert to %s\r\n", ci->num, card_insert ? 
"INSERTED" : "REMOVED");

+#ifdef HAVE_BOARD_CARDINSERT
+   board_set_card_insert(ci, card_insert);
+#else
if (!ci->pin_insert.pio) {
TRACE_INFO("%u: skipping unsupported card_insert to %s\r\n",
   ci->num, card_insert ? "INSERTED" : "REMOVED");
@@ -666,6 +669,7 @@
PIO_Set(>pin_insert);
else
PIO_Clear(>pin_insert);
+#endif
 }

 /* handle a single USB command as received from the USB host */

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I8c9b0c3d862a967832134b24252577739182da62
Gerrit-Change-Number: 24536
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in simtrace2[master]: firmware: cardem: re-factor CARDINSERT command processing

2021-06-03 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24535 )


Change subject: firmware: cardem: re-factor CARDINSERT command processing
..

firmware: cardem: re-factor CARDINSERT command processing

move it out of the general command dispatch switch statement
and into a separate function.

Change-Id: Ia40c3dbe68248da0dcc69d298450ca6e4869
---
M firmware/libcommon/source/mode_cardemu.c
1 file changed, 17 insertions(+), 12 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/35/24535/1

diff --git a/firmware/libcommon/source/mode_cardemu.c 
b/firmware/libcommon/source/mode_cardemu.c
index 8a59e16..3863767 100644
--- a/firmware/libcommon/source/mode_cardemu.c
+++ b/firmware/libcommon/source/mode_cardemu.c
@@ -652,6 +652,22 @@
usb_buf_free(msg);
 }

+static void process_card_insert(struct cardem_inst *ci, bool card_insert)
+{
+   TRACE_INFO("%u: set card_insert to %s\r\n", ci->num, card_insert ? 
"INSERTED" : "REMOVED");
+
+   if (!ci->pin_insert.pio) {
+   TRACE_INFO("%u: skipping unsupported card_insert to %s\r\n",
+  ci->num, card_insert ? "INSERTED" : "REMOVED");
+   return;
+   }
+
+   if (card_insert)
+   PIO_Set(>pin_insert);
+   else
+   PIO_Clear(>pin_insert);
+}
+
 /* handle a single USB command as received from the USB host */
 static void dispatch_usb_command_cardem(struct msgb *msg, struct cardem_inst 
*ci)
 {
@@ -675,18 +691,7 @@
break;
case SIMTRACE_MSGT_DT_CEMU_CARDINSERT:
cardins = (struct cardemu_usb_msg_cardinsert *) msg->l2h;
-   if (!ci->pin_insert.pio) {
-   TRACE_INFO("%u: skipping unsupported card_insert to 
%s\r\n",
-  ci->num, cardins->card_insert ? "INSERTED" : 
"REMOVED");
-   usb_buf_free(msg);
-   break;
-   }
-   TRACE_INFO("%u: set card_insert to %s\r\n", ci->num,
-  cardins->card_insert ? "INSERTED" : "REMOVED");
-   if (cardins->card_insert)
-   PIO_Set(>pin_insert);
-   else
-   PIO_Clear(>pin_insert);
+   process_card_insert(ci, cardins->card_insert);
usb_buf_free(msg);
break;
case SIMTRACE_MSGT_BD_CEMU_STATUS:

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ia40c3dbe68248da0dcc69d298450ca6e4869
Gerrit-Change-Number: 24535
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in simtrace2[master]: firmware: octsimtest: mcp23017 initializaiton

2021-06-03 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24534 )


Change subject: firmware: octsimtest: mcp23017 initializaiton
..

firmware: octsimtest: mcp23017 initializaiton

* driver should not have hard-coded understanding about I/O directions
* board code should pass the I/O direction to driver
* board code should use the correct I/O directions (A0..7, B0: output)

Change-Id: Id4a8e012a33cee01bb489e612e17920760b9be59
---
M firmware/libboard/octsimtest/include/mcp23017.h
M firmware/libboard/octsimtest/source/board_octsimtest.c
M firmware/libboard/octsimtest/source/mcp23017.c
3 files changed, 20 insertions(+), 10 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/34/24534/1

diff --git a/firmware/libboard/octsimtest/include/mcp23017.h 
b/firmware/libboard/octsimtest/include/mcp23017.h
index 962a1d5..c0f4b13 100644
--- a/firmware/libboard/octsimtest/include/mcp23017.h
+++ b/firmware/libboard/octsimtest/include/mcp23017.h
@@ -18,7 +18,7 @@

 #define MCP23017_ADDRESS 0x20

-int mcp23017_init(uint8_t slave);
+int mcp23017_init(uint8_t slave, uint8_t iodira, uint8_t iodirb);
 int mcp23017_test(uint8_t slave);
 int mcp23017_toggle(uint8_t slave);
 //int mcp23017_write_byte(uint8_t slave, uint8_t addr, uint8_t byte);
diff --git a/firmware/libboard/octsimtest/source/board_octsimtest.c 
b/firmware/libboard/octsimtest/source/board_octsimtest.c
index 85d8aab..404bef6 100644
--- a/firmware/libboard/octsimtest/source/board_octsimtest.c
+++ b/firmware/libboard/octsimtest/source/board_octsimtest.c
@@ -17,6 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA
  */
+#include 
 #include "board.h"
 #include "simtrace.h"
 #include "utils.h"
@@ -27,6 +28,8 @@
 #include "mcp23017.h"
 #include "mux.h"

+static bool mcp2317_present = false;
+
 void board_exec_dbg_cmd(int ch)
 {
switch (ch) {
@@ -69,8 +72,9 @@

mux_init();
i2c_pin_init();
-   if (!mcp23017_init(MCP23017_ADDRESS))
-   printf("mcp23017 not found!\n\r");
+   /* PORT A: all outputs, Port B0 output, B1..B7 unused */
+   if (mcp23017_init(MCP23017_ADDRESS, 0x00, 0xfe) == 0)
+   mcp2317_present = true;
/* Initialize checking for card insert/remove events */
//card_present_init();
 #endif
diff --git a/firmware/libboard/octsimtest/source/mcp23017.c 
b/firmware/libboard/octsimtest/source/mcp23017.c
index 167bf34..a4d055f 100644
--- a/firmware/libboard/octsimtest/source/mcp23017.c
+++ b/firmware/libboard/octsimtest/source/mcp23017.c
@@ -92,19 +92,25 @@
return 0;
 }

-int mcp23017_init(uint8_t slave)
+int mcp23017_init(uint8_t slave, uint8_t iodira, uint8_t iodirb)
 {
printf("mcp23017_init\n\r");
+
// all gpio input
-   if (mcp23017_write_byte(slave, MCP23017_IODIRA, 0xff))
-   return false;
+   if (mcp23017_write_byte(slave, MCP23017_IODIRA, iodira))
+   goto out_err;
// msb of portb output, rest input
-   if (mcp23017_write_byte(slave, MCP23017_IODIRB, 0x7f))
-   return false;
+   if (mcp23017_write_byte(slave, MCP23017_IODIRB, iodirb))
+   goto out_err;
if (mcp23017_write_byte(slave, MCP23017_IOCONA, 0x20)) //disable SEQOP 
(autoinc addressing)
-   return false;
+   goto out_err;
+
printf("mcp23017 found\n\r");
-   return true;
+   return 0;
+
+out_err:
+   printf("mcp23017 NOT found!\n\r");
+   return -1;
 }

 int mcp23017_test(uint8_t slave)

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Id4a8e012a33cee01bb489e612e17920760b9be59
Gerrit-Change-Number: 24534
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in simtrace2[master]: firmware: octsimtest: Make slot mux configurable via USB

2021-06-03 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24533 )


Change subject: firmware: octsimtest: Make slot mux configurable via USB
..

firmware: octsimtest: Make slot mux configurable via USB

Change-Id: I4cdb250d2e1dbc5b8b0169f8b7c21e288b492e1d
---
M firmware/libboard/octsimtest/include/board.h
M firmware/libboard/octsimtest/include/mux.h
M firmware/libboard/octsimtest/source/mux.c
M firmware/libcommon/include/simtrace_prot.h
M firmware/libcommon/source/card_emu.c
5 files changed, 36 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/33/24533/1

diff --git a/firmware/libboard/octsimtest/include/board.h 
b/firmware/libboard/octsimtest/include/board.h
index 171b2c1..ad21a1f 100644
--- a/firmware/libboard/octsimtest/include/board.h
+++ b/firmware/libboard/octsimtest/include/board.h
@@ -109,6 +109,8 @@
 #define VCC_UV_THRESH_1V8  (150*47)/(47+30)
 #define VCC_UV_THRESH_3V   (250*47)/(47+30)

+#define HAVE_SLOT_MUX
+
 /** Supported modes */
 /* SIMtrace board supports sniffer mode */
 //#define HAVE_SNIFFER
diff --git a/firmware/libboard/octsimtest/include/mux.h 
b/firmware/libboard/octsimtest/include/mux.h
index ba7ae9f..3181478 100644
--- a/firmware/libboard/octsimtest/include/mux.h
+++ b/firmware/libboard/octsimtest/include/mux.h
@@ -1,7 +1,8 @@
 #pragma once

 void mux_init(void);
-void mux_set_slot(uint8_t s);
+int mux_set_slot(uint8_t s);
+int mux_get_slot(void);
 void mux_set_freq(uint8_t s);

 /* this reflects the wiring between U5 and U4 */
diff --git a/firmware/libboard/octsimtest/source/mux.c 
b/firmware/libboard/octsimtest/source/mux.c
index 8d9f625..54c6cb6 100644
--- a/firmware/libboard/octsimtest/source/mux.c
+++ b/firmware/libboard/octsimtest/source/mux.c
@@ -20,6 +20,7 @@
 #include "board.h"
 #include "mux.h"
 #include 
+#include 

 /* 3-bit S0..S2 signal for slot selection */
 static const Pin pin_in_sel[3] = {
@@ -38,6 +39,8 @@
 /* low-active output enable for all muxes */
 static const Pin pin_oe = { PIO_PA19, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT 
};

+static uint8_t g_mux_slot = 0;
+
 /* initialize the external 1:8 multiplexers */
 void mux_init(void)
 {
@@ -49,10 +52,13 @@
 }

 /* set the slot selection mux */
-void mux_set_slot(uint8_t s)
+int mux_set_slot(uint8_t s)
 {
printf("%s(%u)\r\n", __func__, s);

+   if (s > 7)
+   return -EINVAL;
+
/* !OE = H: disconnect input and output of muxes */
PIO_Set(_oe);

@@ -71,6 +77,14 @@

/* !OE = L: (re-)enable the output of muxes */
PIO_Clear(_oe);
+
+   g_mux_slot = s;
+   return s;
+}
+
+int mux_get_slot(void)
+{
+   return g_mux_slot;
 }

 /* set the frequency divider mux */
diff --git a/firmware/libcommon/include/simtrace_prot.h 
b/firmware/libcommon/include/simtrace_prot.h
index e550616..5eb4f59 100644
--- a/firmware/libcommon/include/simtrace_prot.h
+++ b/firmware/libcommon/include/simtrace_prot.h
@@ -269,6 +269,8 @@
 struct cardemu_usb_msg_config {
/* bit-mask of CEMU_FEAT_F flags */
uint32_t features;
+   /* the selected slot number (if an external mux is present) */
+   uint8_t slot_mux_nr;
 } __attribute__ ((packed));

 /***
diff --git a/firmware/libcommon/source/card_emu.c 
b/firmware/libcommon/source/card_emu.c
index bcd5fd6..4b84039 100644
--- a/firmware/libcommon/source/card_emu.c
+++ b/firmware/libcommon/source/card_emu.c
@@ -33,6 +33,9 @@
 #include 
 #include 

+#ifdef HAVE_SLOT_MUX
+#include "mux.h"
+#endif

 #define NUM_SLOTS  2

@@ -1079,6 +1082,12 @@

cfg = (struct cardemu_usb_msg_config *) msgb_put(msg, sizeof(*cfg));
cfg->features = ch->features;
+#ifdef HAVE_SLOT_MUX
+   cfg->slot_mux_nr = mux_get_slot();
+#else
+   cfg->slot_mux_nr = 0;
+#endif
+

usb_buf_upd_len_and_submit(msg);
 }
@@ -1241,6 +1250,12 @@
if (scfg_len >= sizeof(uint32_t))
ch->features = (scfg->features & SUPPORTED_FEATURES);

+#ifdef HAVE_SLOT_MUX
+   if (scfg_len >= sizeof(uint32_t)+sizeof(uint8_t)) {
+   mux_set_slot(scfg->slot_mux_nr);
+   }
+#endif
+
/* send back a report of our current configuration */
card_emu_report_config(ch);


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I4cdb250d2e1dbc5b8b0169f8b7c21e288b492e1d
Gerrit-Change-Number: 24533
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in simtrace2[master]: firmware: octsimtest: Fix IO_DIR pin definition

2021-06-03 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24532 )


Change subject: firmware: octsimtest: Fix IO_DIR pin definition
..

firmware: octsimtest: Fix IO_DIR pin definition

Change-Id: I776c9106bcd4ceb24a5d50ea05c6025dedb73822
---
M firmware/libboard/octsimtest/include/board.h
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/32/24532/1

diff --git a/firmware/libboard/octsimtest/include/board.h 
b/firmware/libboard/octsimtest/include/board.h
index 2d8a896..171b2c1 100644
--- a/firmware/libboard/octsimtest/include/board.h
+++ b/firmware/libboard/octsimtest/include/board.h
@@ -63,7 +63,7 @@
 /* Phone CLK clock input (CLK_PHONE in schematic) */
 #define PIN_PHONE_CLK  {PIO_PA23A_SCK1, PIOA, ID_PIOA, PIO_PERIPH_A, 
PIO_DEFAULT}
 /* Pin used to switch level shifter in I/O line between rx (0) and tx (1) */
-#define PIN_USIM1_IO_DIR   {PIO_PA16, PIOA, ID_PIOA, PIO_PERIPH_A, 
PIO_OUTPUT_0}
+#define PIN_USIM1_IO_DIR   {PIO_PA26, PIOA, ID_PIOA, PIO_OUTPUT_0, 
PIO_DEFAULT}
 /* Pin used for phone USIM slot 1 communication */
 #define PINS_USIM1  PIN_PHONE_IO, PIN_PHONE_CLK, 
PIN_PHONE_CLK_INPUT, PIN_USIM1_VCC, PIN_PHONE_IO_INPUT, PIN_USIM1_nRST, 
PIN_USIM1_IO_DIR
 /* Phone I/O data signal input/output (unused USART RX input; connected to 
I/O_PHONE in schematic) */

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I776c9106bcd4ceb24a5d50ea05c6025dedb73822
Gerrit-Change-Number: 24532
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in libosmocore[master]: ns2: Use NSVC bufid in stats report

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

Change subject: ns2: Use NSVC bufid in stats report
..


Patch Set 3:

> Patch Set 3: Code-Review-1
>
> We should improve the ids for UDP before merging this. At least UDP id are 
> not unique as we can have a single NSE with 2x NSVCs. Both NSVCs have the 
> same remote endpoints, but a different local bind.

lynxis can you take care about this work mentioned above? You know far more 
about the details on that.


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I4c696c615ba3416f8524d0797ce06c0ecd3a18f2
Gerrit-Change-Number: 24468
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: osmith 
Gerrit-CC: laforge 
Gerrit-Comment-Date: Thu, 03 Jun 2021 12:25:31 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: add bsc/BSC_Tests_VAMOS.ttcn

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

Change subject: add bsc/BSC_Tests_VAMOS.ttcn
..


Patch Set 13:

(1 comment)

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24411/10/bsc/BSC_Tests_VAMOS.ttcn
File bsc/BSC_Tests_VAMOS.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24411/10/bsc/BSC_Tests_VAMOS.ttcn@89
PS10, Line 89:  var integer subslot;
> I would set it to 0, otherwise you may return an unbound value.
if a test calls this function on an unimplemented channel type, we should 
rather get an error message, so added that instead.



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24411
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: I2c504099163a30ea102cbd26d3615ca2e5ce1e64
Gerrit-Change-Number: 24411
Gerrit-PatchSet: 13
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 12:22:31 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: add bsc/BSC_Tests_VAMOS.ttcn

2021-06-03 Thread neels
Hello Jenkins Builder, laforge, fixeria, pespin,

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

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24411

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

Change subject: add bsc/BSC_Tests_VAMOS.ttcn
..

add bsc/BSC_Tests_VAMOS.ttcn

BSC_Tests_VAMOS.ttcn is separate from BSC_Tests.ttcn in order to
instruct osmo-bts-omldummy to pass BTS_FEAT_VAMOS == true in the OML BTS
attributes.

Add tests:
TC_chan_act_to_vamos()
TC_mode_modify_to_vamos_fr()
TC_mode_modify_to_vamos_hr()
TC_assign_to_secondary_lchan_fr()
TC_assign_to_secondary_lchan_hr()
TC_vamos_multiplex_tch_f_tch_f()
TC_vamos_multiplex_tch_h_tch_h_tch_h_tch_h()

Change-Id: I2c504099163a30ea102cbd26d3615ca2e5ce1e64
---
M bsc/BSC_Tests.ttcn
A bsc/BSC_Tests_VAMOS.ttcn
M library/L3_Templates.ttcn
M library/RSL_Types.ttcn
4 files changed, 859 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/11/24411/13
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24411
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: I2c504099163a30ea102cbd26d3615ca2e5ce1e64
Gerrit-Change-Number: 24411
Gerrit-PatchSet: 13
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-bsc[master]: VTY: add lchan re-assignment command

2021-06-03 Thread neels
Hello Jenkins Builder, pespin,

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

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

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

Change subject: VTY: add lchan re-assignment command
..

VTY: add lchan re-assignment command

Add VTY command to trigger an intra-cell re-assignment, also allowing to
re-assign to a secondary VAMOS lchan.

Related: SYS#5315 OS#4940
Change-Id: If006f5caaf83b07675f57e5665cfa79328da55e6
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/gsm_data.c
M tests/osmo-bsc.vty
4 files changed, 129 insertions(+), 0 deletions(-)


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: If006f5caaf83b07675f57e5665cfa79328da55e6
Gerrit-Change-Number: 24381
Gerrit-PatchSet: 21
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-CC: laforge 
Gerrit-MessageType: newpatchset


Change in osmo-gsm-tester[master]: util: adds the feature to force the rpath when patching files.

2021-06-03 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24272 )

Change subject: util: adds the feature to force the rpath when patching files.
..


Patch Set 1:

Hi, answering to your questions:

* I agree adding new param to change_elf_rpath sounds better than adding a new 
function

* I think it makes sense having different jenkins-build-*.sh script to build on 
different platforms. We do that for instance when building software we run in a 
sysmobts or OC2G BTS (armv5(?) each with its own yocto SDK and hence library 
versions), see jenkins-build-osmo-bts-* and jenkins-build-osmo-pcu-*.sh. The 
idea is to reuse as much as possible the -common.sh bits from the new file, ex 
jenkins-build-srslte-bbu.sh. You could add for instance a new global envvar 
PATCHELF_EXTRA_ARGS in -common.sh and then set it in 
jenkins-build-srslte-bbu.sh PATCHELF_EXTRA_ARGS="--force-rpath".

* Regarding LD_LIBRARY_PATH failing, it would be great to know why. Generally 
the way to find out is to ssh into the target host, then run the process 
manually: LD_LIBRARY_PATH="..." ./srsenb and see what it errors about. Also 
using ldd quickly tells you which is the library not being found: 
LD_LIBRARY_PATH="..." ldd ./srsenb. IIRC there's also some envvar you can set 
to tell the dynamic loader to enter debug mode and print lots of info.


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

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I2d4a105d4843c0d31d6b5d8f8d4195247b290aec
Gerrit-Change-Number: 24272
Gerrit-PatchSet: 1
Gerrit-Owner: alealcon 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 11:20:56 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: vty-test: osmo-bsc.vty: test doc of lchan activate cmd

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

Change subject: vty-test: osmo-bsc.vty: test doc of lchan activate cmd
..


Patch Set 11: Code-Review+2


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I6379e306fb8fa6ec227125c6cf14893d674e7596
Gerrit-Change-Number: 24387
Gerrit-PatchSet: 11
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 11:15:18 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: fix rc handling in channel_mode_from_lchan()

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

Change subject: fix rc handling in channel_mode_from_lchan()
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I52e13b24ce67e288ff32dbdaa1c1759089926f5c
Gerrit-Change-Number: 24517
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 11:12:53 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: fixup for Mode Modify TSC

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

Change subject: fixup for Mode Modify TSC
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I87ecf7d9266f37f4c775d029e277b614671a9401
Gerrit-Change-Number: 24516
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 11:12:33 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: [VAMOS] osmo-bts-trx: schedule bursts on 'shadow' timeslots

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

Change subject: [VAMOS] osmo-bts-trx: schedule bursts on 'shadow' timeslots
..


Patch Set 4: Code-Review+1


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I3e0bdf8c03273f66991aa1764029ab1dd3528d7e
Gerrit-Change-Number: 24440
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 10:24:19 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: [VAMOS] osmo-bts-omldummy: allocate shadow timeslots

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

Change subject: [VAMOS] osmo-bts-omldummy: allocate shadow timeslots
..


Patch Set 5: Code-Review+1


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I4aa9a8bb35bd828d6f25d5690297e727dace5974
Gerrit-Change-Number: 24155
Gerrit-PatchSet: 5
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 10:21:50 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in docker-playground[master]: ttcn3-bts-test/BTS_Tests.cfg: execute VAMOS specific test cases

2021-06-03 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/docker-playground/+/24529 )

Change subject: ttcn3-bts-test/BTS_Tests.cfg: execute VAMOS specific test cases
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I421f6ce5b689cd221f43fcc0f5985e266e95
Gerrit-Change-Number: 24529
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 10:21:02 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: BTS_Tests.cfg: also execute LAPDm related test cases

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

Change subject: BTS_Tests.cfg: also execute LAPDm related test cases
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24528
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: If632fdd740634e4e115e4aea56940033b18f5736
Gerrit-Change-Number: 24528
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 10:19:22 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: [VAMOS] Implement the concept of 'shadow' timeslots

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

Change subject: [VAMOS] Implement the concept of 'shadow' timeslots
..


Patch Set 12: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/c/osmo-bts/+/24153/12/include/osmo-bts/gsm_data.h
File include/osmo-bts/gsm_data.h:

https://gerrit.osmocom.org/c/osmo-bts/+/24153/12/include/osmo-bts/gsm_data.h@526
PS12, Line 526: "bts=%u,trx=%u,ts=%u" "%s"
I don't really get why do you separate the %s into a different string here...



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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I48b44b4df9ffb1cca105aebbd868c29b21f3b1d6
Gerrit-Change-Number: 24153
Gerrit-PatchSet: 12
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 10:18:04 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: trx_sched_is_sacch_fn(): fix handling of dynamic timeslots

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

Change subject: trx_sched_is_sacch_fn(): fix handling of dynamic timeslots
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ia5e337e897b595e7de6e504664c969b583cc02a1
Gerrit-Change-Number: 24526
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 09:56:55 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: measurement: remove over-defensive checks in is_meas_complete()

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

Change subject: measurement: remove over-defensive checks in is_meas_complete()
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6d20d7cba49cc8b6d1dc2192598ca372b7d2c5bf
Gerrit-Change-Number: 24527
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 09:55:28 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: fsm: cosmetic: fix weird spacing in osmo_fsm_inst_alloc()

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

Change subject: fsm: cosmetic: fix weird spacing in osmo_fsm_inst_alloc()
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I199085e717c6ebdc9061a0c9fa9a96bfbc11a74a
Gerrit-Change-Number: 24525
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 09:54:36 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmo-abis[master]: ipa: add optional connect timeout to ipa_client_conn_open

2021-06-03 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-abis/+/24514 )

Change subject: ipa: add optional connect timeout to ipa_client_conn_open
..


Patch Set 1:

(2 comments)

https://gerrit.osmocom.org/c/libosmo-abis/+/24514/1/src/input/ipa.c
File src/input/ipa.c:

https://gerrit.osmocom.org/c/libosmo-abis/+/24514/1/src/input/ipa.c@233
PS1, Line 233:
> ws
He's just adding a new line here because he's adding new blocks to the 
function, so that different steps are more readable. It's fine adding this new 
line as part of the change.


https://gerrit.osmocom.org/c/libosmo-abis/+/24514/1/src/input/ipa.c@247
PS1, Line 247:  ret = osmo_sock_wait(link->ofd->fd, timeout_msec);
So this is the use case you were saying it's fine blocking? Inside a library 
function? Doesn't look correct to me at first glance.



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

Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I7bc4345876e3c20266985270d0ddfa770437a053
Gerrit-Change-Number: 24514
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 09:54:18 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


Change in osmo-bts[master]: allow to configure multiple oml remote-ip addresses

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

Change subject: allow to configure multiple oml remote-ip addresses
..


Patch Set 1:

(2 comments)

https://gerrit.osmocom.org/c/osmo-bts/+/24513/1/src/common/main.c
File src/common/main.c:

https://gerrit.osmocom.org/c/osmo-bts/+/24513/1/src/common/main.c@402
PS1, Line 402: LOGP
> fprintf() -> LOGP() is unrelated, let's keep it consistent in this function.
I think it's fine changing this since anyway he's changing lots of lines around 
this one.


https://gerrit.osmocom.org/c/osmo-bts/+/24513/1/src/common/main.c@419
PS1, Line 419: BSC
> I suggest to clarify which connection, because together with OML you also 
> have RSL connections: […]
Ack



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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I205f68a3a7f35fee4c38a7cfba2b014237df2727
Gerrit-Change-Number: 24513
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 09:50:01 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


Change in osmo-bsc[master]: vty-test: osmo-bsc.vty: test doc of lchan activate cmd

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

Change subject: vty-test: osmo-bsc.vty: test doc of lchan activate cmd
..


Patch Set 11: Code-Review+1


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I6379e306fb8fa6ec227125c6cf14893d674e7596
Gerrit-Change-Number: 24387
Gerrit-PatchSet: 11
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 09:44:13 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: implement CHANnel ACTIVate to VAMOS mode

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

Change subject: implement CHANnel ACTIVate to VAMOS mode
..


Patch Set 15: Code-Review+1


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: If3ac584e4223ef7656c7fedc3bf11df87e4309ec
Gerrit-Change-Number: 24375
Gerrit-PatchSet: 15
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 09:43:49 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: RSL chan_nr: replace OSMO_ASSERT with error handling

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

Change subject: RSL chan_nr: replace OSMO_ASSERT with error handling
..


Patch Set 2: Code-Review+1


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I71ed6437c403a3f9336e17a94b4948fca295d853
Gerrit-Change-Number: 24524
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 09:39:56 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-mgw[master]: mgcp_client: do not crash when lco/sdp can not be generated

2021-06-03 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/24182 )

Change subject: mgcp_client: do not crash when lco/sdp can not be generated
..


Patch Set 2:

(2 comments)

https://gerrit.osmocom.org/c/osmo-mgw/+/24182/2/src/libosmo-mgcp-client/mgcp_client.c
File src/libosmo-mgcp-client/mgcp_client.c:

https://gerrit.osmocom.org/c/osmo-mgw/+/24182/2/src/libosmo-mgcp-client/mgcp_client.c@1236
PS2, Line 1236: } else
no need for else here, there's early return. Moreover, you are using {} in the 
if clause but no in the else one.


https://gerrit.osmocom.org/c/osmo-mgw/+/24182/2/src/libosmo-mgcp-client/mgcp_client.c@1353
PS2, Line 1353: else
same here, no need for else.



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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Ibb788343e0bec9c0eaf33e6e4727d4d36c100017
Gerrit-Change-Number: 24182
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 09:33:23 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bts[master]: manuals/abis/rsl.adoc: add VAMOS specific Channel Number values

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

Change subject: manuals/abis/rsl.adoc: add VAMOS specific Channel Number values
..


Patch Set 2: Code-Review+1


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ib3ad7652dfcbd104d25b031ac89f5491da2673a6
Gerrit-Change-Number: 24492
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 09:28:24 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: fix rc handling in channel_mode_from_lchan()

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

Change subject: fix rc handling in channel_mode_from_lchan()
..


Patch Set 2: Code-Review+1


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I52e13b24ce67e288ff32dbdaa1c1759089926f5c
Gerrit-Change-Number: 24517
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 09:27:44 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: gitignore

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

Change subject: gitignore
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24518
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: Iedd6aeb17b1c774a5d96b28e69827796ff769bc1
Gerrit-Change-Number: 24518
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 09:27:17 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-dev[master]: ttcn3: add missing ttcn3-docker-run.sh

2021-06-03 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-dev/+/24497 )

Change subject: ttcn3: add missing ttcn3-docker-run.sh
..


Patch Set 2: Code-Review+1


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

Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: I23467136af6deaca69e0b43697a06385cb65444d
Gerrit-Change-Number: 24497
Gerrit-PatchSet: 2
Gerrit-Owner: osmith 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 09:26:51 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: fixup for Mode Modify TSC

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

Change subject: fixup for Mode Modify TSC
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I87ecf7d9266f37f4c775d029e277b614671a9401
Gerrit-Change-Number: 24516
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 09:23:58 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: osmo-bts-trx: fix NULL pointer dereference in trx_if_send_burst()

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

Change subject: osmo-bts-trx: fix NULL pointer dereference in 
trx_if_send_burst()
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I4a361777fc40bdedcebbe54df6274bc5573f77a8
Gerrit-Change-Number: 24515
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 03 Jun 2021 09:22:02 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Jenkins build is back to normal : master-osmo-asf4-dfu » a1=default,a2=default,a3=default,a4=default,osmocom-master-debian9 #889

2021-06-03 Thread jenkins
See 




Jenkins build is back to normal : master-simtrace2 » a1=default,a2=default,a3=default,a4=default,osmocom-master-debian9 #1212

2021-06-03 Thread jenkins
See 




Build failed in Jenkins: master-simtrace2 » a1=default,a2=default,a3=default,a4=default,osmocom-master-debian9 #1211

2021-06-03 Thread jenkins
See 


Changes:

[laforge] octsimtest: Adjust VCC voltage thresholds (resistive VCC divider)

[laforge] contrib/jenkins.sh: Build 'cardem' app for 'octsimtest' board


--
[...truncated 153.34 KB...]
configure.ac:20: installing './compile'
configure.ac:22: installing './config.guess'
configure.ac:22: installing './config.sub'
configure.ac:8: installing './install-sh'
configure.ac:8: installing './missing'
lib/Makefile.am: installing './depcomp'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking whether make sets $(MAKE)... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu 
format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... 
func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for pkg-config... /usr/bin/pkg-config
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.20... yes
checking if gcc supports -fvisibility=hidden... yes
checking for LIBOSMOCORE... yes
checking for LIBOSMOSIM... yes
checking for LIBOSMOUSB... yes
checking for LIBUSB... yes
CFLAGS="-g -O2 -Wall -fsanitize=address -fsanitize=undefined -fsanitize=address 
-fsanitize=undefined -Werror -Wno-error=deprecated 
-Wno-error=deprecated-declarations -Wno-error=cpp"
CPPFLAGS=" -Wall -fsanitize=address -fsanitize=undefined -fsanitize=address 
-fsanitize=undefined -Werror -Wno-error=deprecated 
-Wno-error=deprecated-declarations 

Change in simtrace2[master]: contrib/jenkins.sh: Build 'cardem' app for 'octsimtest' board

2021-06-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24531 )

Change subject: contrib/jenkins.sh: Build 'cardem' app for 'octsimtest' board
..

contrib/jenkins.sh: Build 'cardem' app for 'octsimtest' board

Change-Id: Ia38bbb85c2828ab7307ffe688e50d7cdf70d6d39
---
M contrib/jenkins.sh
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index c5f5cad..924d5f7 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -31,6 +31,7 @@
 BUILDS+="simtrace/dfu simtrace/trace simtrace/cardem "
 BUILDS+="qmod/dfu qmod/cardem "
 BUILDS+="owhw/dfu owhw/cardem "
+BUILDS+="octsimtest/cardem "

 cd $TOPDIR/firmware
 for build in $BUILDS; do

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ia38bbb85c2828ab7307ffe688e50d7cdf70d6d39
Gerrit-Change-Number: 24531
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in simtrace2[master]: octsimtest: Adjust VCC voltage thresholds (resistive VCC divider)

2021-06-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24530 )

Change subject: octsimtest: Adjust VCC voltage thresholds (resistive VCC 
divider)
..

octsimtest: Adjust VCC voltage thresholds (resistive VCC divider)

octsimtest has a resistive voltage divider in front of the VCC ADC
in order to also detect 5V.  We must make the thresholds board-specific
and adjust them for octsimtest.

Change-Id: I9e4adb4f349d2d838ea4100eb49271f3a0e7a2a5
---
M firmware/libboard/octsimtest/include/board.h
M firmware/libboard/qmod/include/board.h
M firmware/libcommon/source/mode_cardemu.c
3 files changed, 9 insertions(+), 3 deletions(-)

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



diff --git a/firmware/libboard/octsimtest/include/board.h 
b/firmware/libboard/octsimtest/include/board.h
index 361c180..2d8a896 100644
--- a/firmware/libboard/octsimtest/include/board.h
+++ b/firmware/libboard/octsimtest/include/board.h
@@ -105,6 +105,9 @@
 #define BOARD_USB_BMATTRIBUTES USBConfigurationDescriptor_BUSPOWERED_NORWAKEUP

 #define DETECT_VCC_BY_ADC
+/* we have a resistive voltage divider of 47 + 30 kOhms to also detect 5V 
supply power */
+#define VCC_UV_THRESH_1V8  (150*47)/(47+30)
+#define VCC_UV_THRESH_3V   (250*47)/(47+30)

 /** Supported modes */
 /* SIMtrace board supports sniffer mode */
diff --git a/firmware/libboard/qmod/include/board.h 
b/firmware/libboard/qmod/include/board.h
index 5165434..0d35bef 100644
--- a/firmware/libboard/qmod/include/board.h
+++ b/firmware/libboard/qmod/include/board.h
@@ -109,6 +109,9 @@
 #define BOARD_USB_RELEASE  0x010

 #define CARDEMU_SECOND_UART
+
 #define DETECT_VCC_BY_ADC
+#define VCC_UV_THRESH_1V8  150
+#define VCC_UV_THRESH_3V   250

 #define HAVE_CARDEM
diff --git a/firmware/libcommon/source/mode_cardemu.c 
b/firmware/libcommon/source/mode_cardemu.c
index 604c66a..8a59e16 100644
--- a/firmware/libcommon/source/mode_cardemu.c
+++ b/firmware/libcommon/source/mode_cardemu.c
@@ -408,6 +408,9 @@
  ***/

 #ifdef DETECT_VCC_BY_ADC
+#if !defined(VCC_UV_THRESH_1V8) || !defined(VCC_UV_THRESH_3V)
+#error "You must define VCC_UV_THRESH_{1V1,3V} if you use ADC VCC detection"
+#endif

 static volatile int adc_triggered = 0;
 static int adc_sam3s_reva_errata = 0;
@@ -456,9 +459,6 @@
return 0;
 }

-#define VCC_UV_THRESH_1V8  150
-#define VCC_UV_THRESH_3V   250
-
 static void process_vcc_adc(struct cardem_inst *ci)
 {
if (ci->vcc_uv >= VCC_UV_THRESH_3V)

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I9e4adb4f349d2d838ea4100eb49271f3a0e7a2a5
Gerrit-Change-Number: 24530
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in simtrace2[master]: contrib/jenkins.sh: Build 'cardem' app for 'octsimtest' board

2021-06-03 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24531 )

Change subject: contrib/jenkins.sh: Build 'cardem' app for 'octsimtest' board
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ia38bbb85c2828ab7307ffe688e50d7cdf70d6d39
Gerrit-Change-Number: 24531
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 03 Jun 2021 07:41:10 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: octsimtest: Adjust VCC voltage thresholds (resistive VCC divider)

2021-06-03 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24530 )

Change subject: octsimtest: Adjust VCC voltage thresholds (resistive VCC 
divider)
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I9e4adb4f349d2d838ea4100eb49271f3a0e7a2a5
Gerrit-Change-Number: 24530
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 03 Jun 2021 07:41:04 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: octsimtest: Adjust VCC voltage thresholds (resistive VCC divider)

2021-06-03 Thread laforge
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/c/simtrace2/+/24530

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

Change subject: octsimtest: Adjust VCC voltage thresholds (resistive VCC 
divider)
..

octsimtest: Adjust VCC voltage thresholds (resistive VCC divider)

octsimtest has a resistive voltage divider in front of the VCC ADC
in order to also detect 5V.  We must make the thresholds board-specific
and adjust them for octsimtest.

Change-Id: I9e4adb4f349d2d838ea4100eb49271f3a0e7a2a5
---
M firmware/libboard/octsimtest/include/board.h
M firmware/libboard/qmod/include/board.h
M firmware/libcommon/source/mode_cardemu.c
3 files changed, 9 insertions(+), 3 deletions(-)


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I9e4adb4f349d2d838ea4100eb49271f3a0e7a2a5
Gerrit-Change-Number: 24530
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in simtrace2[master]: contrib/jenkins.sh: Build 'cardem' app for 'octsimtest' board

2021-06-03 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24531 )


Change subject: contrib/jenkins.sh: Build 'cardem' app for 'octsimtest' board
..

contrib/jenkins.sh: Build 'cardem' app for 'octsimtest' board

Change-Id: Ia38bbb85c2828ab7307ffe688e50d7cdf70d6d39
---
M contrib/jenkins.sh
1 file changed, 1 insertion(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/31/24531/1

diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index c5f5cad..924d5f7 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -31,6 +31,7 @@
 BUILDS+="simtrace/dfu simtrace/trace simtrace/cardem "
 BUILDS+="qmod/dfu qmod/cardem "
 BUILDS+="owhw/dfu owhw/cardem "
+BUILDS+="octsimtest/cardem "

 cd $TOPDIR/firmware
 for build in $BUILDS; do

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ia38bbb85c2828ab7307ffe688e50d7cdf70d6d39
Gerrit-Change-Number: 24531
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in simtrace2[master]: octsimtest: Adjust VCC voltage thresholds (resistive VCC divider)

2021-06-03 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24530 )


Change subject: octsimtest: Adjust VCC voltage thresholds (resistive VCC 
divider)
..

octsimtest: Adjust VCC voltage thresholds (resistive VCC divider)

octsimtest has a resistive voltage divider in front of the VCC ADC
in order to also detect 5V.  We must make the thresholds board-specific
and adjust them for octsimtest.

Change-Id: I9e4adb4f349d2d838ea4100eb49271f3a0e7a2a5
---
M firmware/libboard/octsimtest/include/board.h
M firmware/libboard/qmod/include/board.h
M firmware/libcommon/source/mode_cardemu.c
3 files changed, 11 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/30/24530/1

diff --git a/firmware/libboard/octsimtest/include/board.h 
b/firmware/libboard/octsimtest/include/board.h
index 361c180..2d8a896 100644
--- a/firmware/libboard/octsimtest/include/board.h
+++ b/firmware/libboard/octsimtest/include/board.h
@@ -105,6 +105,9 @@
 #define BOARD_USB_BMATTRIBUTES USBConfigurationDescriptor_BUSPOWERED_NORWAKEUP

 #define DETECT_VCC_BY_ADC
+/* we have a resistive voltage divider of 47 + 30 kOhms to also detect 5V 
supply power */
+#define VCC_UV_THRESH_1V8  (150*47)/(47+30)
+#define VCC_UV_THRESH_3V   (250*47)/(47+30)

 /** Supported modes */
 /* SIMtrace board supports sniffer mode */
diff --git a/firmware/libboard/qmod/include/board.h 
b/firmware/libboard/qmod/include/board.h
index 5165434..0d35bef 100644
--- a/firmware/libboard/qmod/include/board.h
+++ b/firmware/libboard/qmod/include/board.h
@@ -109,6 +109,9 @@
 #define BOARD_USB_RELEASE  0x010

 #define CARDEMU_SECOND_UART
+
 #define DETECT_VCC_BY_ADC
+#define VCC_UV_THRESH_1V8  150
+#define VCC_UV_THRESH_3V   250

 #define HAVE_CARDEM
diff --git a/firmware/libcommon/source/mode_cardemu.c 
b/firmware/libcommon/source/mode_cardemu.c
index 604c66a..23f9f66 100644
--- a/firmware/libcommon/source/mode_cardemu.c
+++ b/firmware/libcommon/source/mode_cardemu.c
@@ -408,6 +408,9 @@
  ***/

 #ifdef DETECT_VCC_BY_ADC
+#if !defined(VCC_UV_THRESH_1V8) || !defined(VCC_UV_THRESH_3V)
+#error "You must define VCC_UV_THRESH_{1V1,3V} if you use ADC VCC detection"
+#endif

 static volatile int adc_triggered = 0;
 static int adc_sam3s_reva_errata = 0;
@@ -456,8 +459,8 @@
return 0;
 }

-#define VCC_UV_THRESH_1V8  150
-#define VCC_UV_THRESH_3V   250
+#define VCC_UV_THRESH_1V8  (150/(47+30)*47)
+#define VCC_UV_THRESH_3V   (250/(47+30)*47)

 static void process_vcc_adc(struct cardem_inst *ci)
 {

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I9e4adb4f349d2d838ea4100eb49271f3a0e7a2a5
Gerrit-Change-Number: 24530
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Build failed in Jenkins: master-simtrace2 » a1=default,a2=default,a3=default,a4=default,osmocom-master-debian9 #1210

2021-06-03 Thread jenkins
See 


Changes:

[laforge] assert: Use printf_sync() to ensure printing of assert / panic

[laforge] Add usb product ID of sysmoOCTSIMTEST

[laforge] octsimtest: remove lots of unused #defines

[laforge] octsimtest: most code for support of this new board

[laforge] octsimtest: Switch direction of I/O level shifter depending on uart 
tx /

[laforge] cardem-pcsc: initialize libosmocore logging


--
[...truncated 136.15 KB...]
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu 
format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... 
func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for pkg-config... /usr/bin/pkg-config
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.20... yes
checking if gcc supports -fvisibility=hidden... yes
checking for LIBOSMOCORE... yes
checking for LIBOSMOSIM... yes
checking for LIBOSMOUSB... yes
checking for LIBUSB... yes
CFLAGS="-g -O2 -Wall -fsanitize=address -fsanitize=undefined -fsanitize=address 
-fsanitize=undefined -Werror -Wno-error=deprecated 
-Wno-error=deprecated-declarations -Wno-error=cpp"
CPPFLAGS=" -Wall -fsanitize=address -fsanitize=undefined -fsanitize=address 
-fsanitize=undefined -Werror -Wno-error=deprecated 
-Wno-error=deprecated-declarations -Wno-error=cpp"
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating libosmo-simtrace2.pc
config.status: creating include/Makefile
config.status: creating src/Makefile
config.status: creating lib/Makefile
config.status: creating contrib/Makefile
config.status: creating contrib/simtrace2.spec
config.status: creating Makefile
config.status: executing tests/atconfig commands
config.status: executing depfiles commands
config.status: executing libtool commands
echo 0.7.0.114-054d > .version-t && mv .version-t .version
make  all-recursive
make[1]: Entering directory '/build/host'
Making all in include
make[2]: Entering directory '/build/host/include'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/build/host/include'
Making all in lib
make[2]: Entering directory '/build/host/lib'
  CC   apdu_dispatch.lo
  CC   gsmtap.lo
  CC   simtrace2_api.lo
  CC   usb_util.lo
  CCLD libosmo-simtrace2.la
ar: `u' modifier ignored since `D' is the default (see `U')
make[2]: Leaving directory '/build/host/lib'
Making all in src
make[2]: Entering directory '/build/host/src'
  CC   simtrace2-cardem-pcsc.o
  CC   simtrace2_usb.o
  CC   simtrace2-sniff.o
  CCLD simtrace2-list
  CCLD simtrace2-sniff
  CCLD simtrace2-cardem-pcsc
make[2]: Leaving directory '/build/host/src'
Making all in contrib
make[2]: Entering directory '/build/host/contrib'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/build/host/contrib'
make[2]: Entering 

Change in simtrace2[master]: cardem-pcsc: initialize libosmocore logging

2021-06-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24522 )

Change subject: cardem-pcsc: initialize libosmocore logging
..

cardem-pcsc: initialize libosmocore logging

Change-Id: I815d39190e944d9512ffc8e5f581515d7be9834f
---
M host/src/simtrace2-cardem-pcsc.c
1 file changed, 6 insertions(+), 0 deletions(-)

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



diff --git a/host/src/simtrace2-cardem-pcsc.c b/host/src/simtrace2-cardem-pcsc.c
index af34d3f..d43e7f2 100644
--- a/host/src/simtrace2-cardem-pcsc.c
+++ b/host/src/simtrace2-cardem-pcsc.c
@@ -48,6 +48,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 

@@ -425,6 +427,8 @@
}
 }

+static struct log_info log_info = {};
+
 int main(int argc, char **argv)
 {
struct osmo_st2_transport *transp = ci->slot->transp;
@@ -451,6 +455,8 @@
return rc;
}

+   osmo_init_logging2(NULL, _info);
+
while (1) {
int option_index = 0;


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I815d39190e944d9512ffc8e5f581515d7be9834f
Gerrit-Change-Number: 24522
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in simtrace2[master]: octsimtest: Switch direction of I/O level shifter depending on uart t...

2021-06-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24521 )

Change subject: octsimtest: Switch direction of I/O level shifter depending on 
uart tx / rx
..

octsimtest: Switch direction of I/O level shifter depending on uart tx / rx

Contrary to other hardware designs, octsimtest has a level-shifter in
the I/O line to support testing with 1.8, 3 and 5V.  This level shifter
is bi-directional, but the direction needs to be explicitly specified
via the SIM_IO_DIR signal attached to PA26.

Change-Id: I44171363b5bd69d6049b12c86f8143be83557cb2
---
M firmware/libboard/octsimtest/include/board.h
M firmware/libcommon/source/mode_cardemu.c
2 files changed, 23 insertions(+), 1 deletion(-)

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



diff --git a/firmware/libboard/octsimtest/include/board.h 
b/firmware/libboard/octsimtest/include/board.h
index 6006796..361c180 100644
--- a/firmware/libboard/octsimtest/include/board.h
+++ b/firmware/libboard/octsimtest/include/board.h
@@ -62,8 +62,10 @@
 #define PIN_PHONE_IO   {PIO_PA22A_TXD1, PIOA, ID_PIOA, PIO_PERIPH_A, 
PIO_DEFAULT}
 /* Phone CLK clock input (CLK_PHONE in schematic) */
 #define PIN_PHONE_CLK  {PIO_PA23A_SCK1, PIOA, ID_PIOA, PIO_PERIPH_A, 
PIO_DEFAULT}
+/* Pin used to switch level shifter in I/O line between rx (0) and tx (1) */
+#define PIN_USIM1_IO_DIR   {PIO_PA16, PIOA, ID_PIOA, PIO_PERIPH_A, 
PIO_OUTPUT_0}
 /* Pin used for phone USIM slot 1 communication */
-#define PINS_USIM1  PIN_PHONE_IO, PIN_PHONE_CLK, 
PIN_PHONE_CLK_INPUT, PIN_USIM1_VCC, PIN_PHONE_IO_INPUT, PIN_USIM1_nRST
+#define PINS_USIM1  PIN_PHONE_IO, PIN_PHONE_CLK, 
PIN_PHONE_CLK_INPUT, PIN_USIM1_VCC, PIN_PHONE_IO_INPUT, PIN_USIM1_nRST, 
PIN_USIM1_IO_DIR
 /* Phone I/O data signal input/output (unused USART RX input; connected to 
I/O_PHONE in schematic) */
 #define PIN_PHONE_IO_INPUT {PIO_PA21A_RXD1, PIOA, ID_PIOA, PIO_PERIPH_A, 
PIO_DEFAULT}
 /* Pin used as clock input (to measure the ETU duration; connected to 
CLK_PHONE in schematic) */
diff --git a/firmware/libcommon/source/mode_cardemu.c 
b/firmware/libcommon/source/mode_cardemu.c
index 127556c..604c66a 100644
--- a/firmware/libcommon/source/mode_cardemu.c
+++ b/firmware/libcommon/source/mode_cardemu.c
@@ -42,6 +42,10 @@
 static const Pin pins_usim1[]  = {PINS_USIM1};
 static const Pin pin_usim1_rst = PIN_USIM1_nRST;
 static const Pin pin_usim1_vcc = PIN_USIM1_VCC;
+#ifdef PIN_USIM1_IO_DIR
+static const Pin pin_io_dir= PIN_USIM1_IO_DIR;
+#endif
+

 #ifdef CARDEMU_SECOND_UART
 static const Pin pins_usim2[]  = {PINS_USIM2};
@@ -142,12 +146,27 @@
wait_tx_idle(usart);
 }

+static void card_emu_uart_set_direction(uint8_t uart_chan, bool tx)
+{
+   /* only on some boards (octsimtest) we hae an external level
+* shifter that requires us to switch the direction between RX and TX */
+#ifdef PIN_USIM1_IO_DIR
+   if (uart_chan == 0) {
+   if (tx)
+   PIO_Set(_io_dir);
+   else
+   PIO_Clear(_io_dir);
+   }
+#endif
+}
+
 /* call-back from card_emu.c to enable/disable transmit and/or receive */
 void card_emu_uart_enable(uint8_t uart_chan, uint8_t rxtx)
 {
Usart *usart = get_usart_by_chan(uart_chan);
switch (rxtx) {
case ENABLE_TX:
+   card_emu_uart_set_direction(uart_chan, true);
USART_DisableIt(usart, ~(US_IER_TXRDY | US_IER_TIMEOUT));
/* as irritating as it is, we actually want to keep the
 * receiver enabled during transmit */
@@ -173,6 +192,7 @@
 * transmitter enabled during receive */
USART_SetTransmitterEnabled(usart, 1);
wait_tx_idle(usart);
+   card_emu_uart_set_direction(uart_chan, false);;
usart->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK;
USART_EnableIt(usart, US_IER_RXRDY);
USART_SetReceiverEnabled(usart, 1);

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I44171363b5bd69d6049b12c86f8143be83557cb2
Gerrit-Change-Number: 24521
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in simtrace2[master]: octsimtest: most code for support of this new board

2021-06-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24520 )

Change subject: octsimtest: most code for support of this new board
..

octsimtest: most code for support of this new board

* code for controlling the Card slot + frequencyt divider muxes
* put everything in place to build cardem application for it

Change-Id: I7e03e0c0f2999a1ce2dad966d98e22033fa58465
---
M firmware/libboard/octsimtest/include/board.h
A firmware/libboard/octsimtest/include/mux.h
M firmware/libboard/octsimtest/source/board_octsimtest.c
A firmware/libboard/octsimtest/source/mux.c
A firmware/libboard/octsimtest/source/sim_switch.c
5 files changed, 167 insertions(+), 2 deletions(-)

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



diff --git a/firmware/libboard/octsimtest/include/board.h 
b/firmware/libboard/octsimtest/include/board.h
index a267f0f..6006796 100644
--- a/firmware/libboard/octsimtest/include/board.h
+++ b/firmware/libboard/octsimtest/include/board.h
@@ -57,7 +57,7 @@
 /* Phone USIM slot 1 VCC pin (VCC_PHONE in schematic) */
 #define PIN_USIM1_VCC  {PIO_PA25, PIOA, ID_PIOA, PIO_INPUT, 
PIO_DEFAULT}
 /* Phone USIM slot 1 RST pin (active low; RST_PHONE in schematic) */
-#define PIN_USIM1_nRST {PIO_PA24, PIOA, ID_PIOA, PIO_INPUT, 
PIO_IT_RISE_EDGE | PIO_DEGLITCH }
+#define PIN_USIM1_nRST {PIO_PA24, PIOA, ID_PIOA, PIO_INPUT, 
PIO_IT_EDGE | PIO_DEGLITCH }
 /* Phone I/O data signal input/output (I/O_PHONE in schematic) */
 #define PIN_PHONE_IO   {PIO_PA22A_TXD1, PIOA, ID_PIOA, PIO_PERIPH_A, 
PIO_DEFAULT}
 /* Phone CLK clock input (CLK_PHONE in schematic) */
@@ -102,13 +102,15 @@
 /* Indicate SIMtrace is bus power in USB attributes */
 #define BOARD_USB_BMATTRIBUTES USBConfigurationDescriptor_BUSPOWERED_NORWAKEUP

+#define DETECT_VCC_BY_ADC
+
 /** Supported modes */
 /* SIMtrace board supports sniffer mode */
 //#define HAVE_SNIFFER
 /* SIMtrace board supports CCID mode */
 //#define HAVE_CCID
 /* SIMtrace board supports card emulation mode */
-//#define HAVE_CARDEM
+#define HAVE_CARDEM
 /* SIMtrace board supports man-in-the-middle mode */
 //#define HAVE_MITM
 /* octsimtest board supports gpio_test mode */
diff --git a/firmware/libboard/octsimtest/include/mux.h 
b/firmware/libboard/octsimtest/include/mux.h
new file mode 100644
index 000..ba7ae9f
--- /dev/null
+++ b/firmware/libboard/octsimtest/include/mux.h
@@ -0,0 +1,16 @@
+#pragma once
+
+void mux_init(void);
+void mux_set_slot(uint8_t s);
+void mux_set_freq(uint8_t s);
+
+/* this reflects the wiring between U5 and U4 */
+#define MUX_FREQ_DIV_2 0
+#define MUX_FREQ_DIV_4 1
+#define MUX_FREQ_DIV_162
+#define MUX_FREQ_DIV_323
+#define MUX_FREQ_DIV_323
+#define MUX_FREQ_DIV_128   4
+#define MUX_FREQ_DIV_512   5
+#define MUX_FREQ_DIV_2048  6
+#define MUX_FREQ_DIV_4096  7
diff --git a/firmware/libboard/octsimtest/source/board_octsimtest.c 
b/firmware/libboard/octsimtest/source/board_octsimtest.c
index b7d7245..85d8aab 100644
--- a/firmware/libboard/octsimtest/source/board_octsimtest.c
+++ b/firmware/libboard/octsimtest/source/board_octsimtest.c
@@ -25,6 +25,7 @@
 #include "usb_buf.h"
 #include "i2c.h"
 #include "mcp23017.h"
+#include "mux.h"

 void board_exec_dbg_cmd(int ch)
 {
@@ -34,7 +35,16 @@
printf("\tR\treset SAM3\n\r");
printf("\tm\trun mcp23017 test\n\r");
printf("\tR\ttoggle MSB of gpio on mcp23017\n\r");
+   printf("\t0-8\tselect physical SIM slot\n\r");
break;
+   case '0': mux_set_slot(0); break;
+   case '1': mux_set_slot(1); break;
+   case '2': mux_set_slot(2); break;
+   case '3': mux_set_slot(3); break;
+   case '4': mux_set_slot(4); break;
+   case '5': mux_set_slot(5); break;
+   case '6': mux_set_slot(6); break;
+   case '7': mux_set_slot(7); break;
case 'R':
printf("Asking NVIC to reset us\n\r");
USBD_Disconnect();
@@ -57,6 +67,7 @@
 #ifndef APPLICATION_dfu
usb_buf_init();

+   mux_init();
i2c_pin_init();
if (!mcp23017_init(MCP23017_ADDRESS))
printf("mcp23017 not found!\n\r");
diff --git a/firmware/libboard/octsimtest/source/mux.c 
b/firmware/libboard/octsimtest/source/mux.c
new file mode 100644
index 000..8d9f625
--- /dev/null
+++ b/firmware/libboard/octsimtest/source/mux.c
@@ -0,0 +1,99 @@
+/* sysmoOCTSIMTEST support for multiplexers
+ *
+ * (C) 2021 by Harald Welte 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; 

Change in simtrace2[master]: octsimtest: remove lots of unused #defines

2021-06-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24519 )

Change subject: octsimtest: remove lots of unused #defines
..

octsimtest: remove lots of unused #defines

The octsimtest board only supports cardem mode, not 'ccid'
nor 'sniffer'.  Remove related GPIO pin #defines from board.h

Change-Id: I43e8631d945ba183a1e5b1e37dd4565adb377154
---
M firmware/libboard/octsimtest/include/board.h
1 file changed, 0 insertions(+), 55 deletions(-)

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



diff --git a/firmware/libboard/octsimtest/include/board.h 
b/firmware/libboard/octsimtest/include/board.h
index 2b8e7bf..a267f0f 100644
--- a/firmware/libboard/octsimtest/include/board.h
+++ b/firmware/libboard/octsimtest/include/board.h
@@ -50,33 +50,8 @@
 /* Button to force bootloader start (shorted to ground when pressed */
 #define PIN_BOOTLOADER_SW  {PIO_PA5, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP}

-//FIXME SIM_PWEN_PIN collides with PA5/bootloader_sw on octsimtest
-/* Enable powering the card using the second 3.3 V output of the LDO (active 
high) */
-#define SIM_PWEN_PIN   {PIO_PA12, PIOA, ID_PIOA, PIO_OUTPUT_1, 
PIO_DEFAULT}
-/* Enable powering the SIM card */
-#define PWR_PINSSIM_PWEN_PIN
-
 // FIXME PA8 is 32khz xtal on octsimtest
-/* Card presence pin */
-#define SW_SIM  PIO_PA11
 /* Pull card presence pin high (shorted to ground in card slot when card is 
present) */
-#define SMARTCARD_CONNECT_PIN  {SW_SIM, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP | 
PIO_DEBOUNCE | PIO_DEGLITCH | PIO_IT_EDGE }
-
-/** Smart card connection **/
-//FIXME
-/* Card RST reset signal input (active low; RST_SIM in schematic) */
-#define PIN_SIM_RST{PIO_PA13, PIOA, ID_PIOA, PIO_OUTPUT_0, 
PIO_DEFAULT}
-/* Card I/O data signal input/output (I/O_SIM in schematic) */
-#define PIN_SIM_IO {PIO_PA6A_TXD0, PIOA, ID_PIOA, PIO_PERIPH_A, 
PIO_DEFAULT}
-/* Card CLK clock input (CLK_SIM in schematic) */
-#define PIN_SIM_CLK{PIO_PA2B_SCK0, PIOA, ID_PIOA, PIO_PERIPH_B, 
PIO_DEFAULT}
-/* Pin to measure card I/O timing (to start measuring the ETU on I/O activity; 
connected I/O_SIM in schematic) */
-#define PIN_SIM_IO_INPUT   {PIO_PA1B_TIOB0, PIOA, ID_PIOA, PIO_PERIPH_B, 
PIO_DEFAULT}
-//FIXME PIO_PA4B_TCLK0 PA4 is LED on octsimtest
-/* Pin used as clock input (to measure the ETU duration; connected to CLK_SIM 
in schematic) */
-#define PIN_SIM_CLK_INPUT  {PIO_PA14, PIOA, ID_PIOA, PIO_PERIPH_B, 
PIO_DEFAULT}
-/* Pins used to measure ETU timing (using timer counter) */
-#define PINS_TC PIN_SIM_IO_INPUT, PIN_SIM_CLK_INPUT

 /** Phone connection **/
 /* Phone USIM slot 1 VCC pin (VCC_PHONE in schematic) */
@@ -95,36 +70,6 @@
 #define PIN_PHONE_CLK_INPUT{PIO_PA29B_TCLK2, PIOA, ID_PIOA, PIO_PERIPH_B, 
PIO_DEFAULT}

 /** Default pin configuration **/
-/* Disconnect VPP, CLK, and RST lines between card and phone using bus switch 
(high sets bus switch to high-impedance) */
-#define PIN_SC_SW_DEFAULT  {PIO_PA20, PIOA, ID_PIOA, PIO_OUTPUT_1, 
PIO_DEFAULT}
-/* Disconnect I/O line between card and phone using bus switch (high sets bus 
switch to high-impedance) */
-#define PIN_IO_SW_DEFAULT  {PIO_PA19, PIOA, ID_PIOA, PIO_OUTPUT_1, 
PIO_DEFAULT}
-/* Disconnect all lines (VPP, CLK, RST, and I/O) between card and phone */
-#define PINS_BUS_DEFAULTPIN_SC_SW_DEFAULT, PIN_IO_SW_DEFAULT
-
-/** Sniffer configuration **/
-/* Connect VPP, CLK, and RST lines between card and phone using bus switch 
(low connects signals on bus switch) */
-#define PIN_SC_SW_SNIFF{PIO_PA20, PIOA, ID_PIOA, PIO_OUTPUT_0, 
PIO_DEFAULT}
-/* Connect I/O line between card and phone using bus switch (low connects 
signals on bus switch) */
-#define PIN_IO_SW_SNIFF{PIO_PA19, PIOA, ID_PIOA, PIO_OUTPUT_0, 
PIO_DEFAULT}
-/* Connect all lines (VPP, CLK, RST, and I/O) between card and phone */
-#define PINS_BUS_SNIFF  PIN_SC_SW_SNIFF, PIN_IO_SW_SNIFF
-/* Card RST reset signal input (use as input since the phone will drive it) */
-#define PIN_SIM_RST_SNIFF  {PIO_PA7, PIOA, ID_PIOA, PIO_INPUT, 
PIO_DEGLITCH | PIO_IT_EDGE}
-/* Pins used to sniff phone-card communication */
-#define PINS_SIM_SNIFF  PIN_SIM_IO, PIN_SIM_CLK, PIN_SIM_RST_SNIFF
-/* Disable power converter 4.5-6V to 3.3V (active high) */
-#define PIN_SIM_PWEN_SNIFF {SIM_PWEN, PIOA, ID_PIOA, PIO_OUTPUT_0, 
PIO_DEFAULT}
-/* Enable power switch to forward VCC_PHONE to VCC_SIM (active high) */
-#define PIN_VCC_FWD_SNIFF  {VCC_FWD, PIOA, ID_PIOA, PIO_OUTPUT_1, 
PIO_DEFAULT}
-/* Use phone VCC to power card */
-#define PINS_PWR_SNIFF  PIN_SIM_PWEN_SNIFF, PIN_VCC_FWD_SNIFF
-
-/** CCID configuration */
-/* Card RST reset signal input (active low; RST_SIM in schematic) */
-#define PIN_ISO7816_RSTMC  {PIO_PA7, PIOA, ID_PIOA, PIO_OUTPUT_0, 
PIO_DEFAULT}
-/* 

Change in simtrace2[master]: Add usb product ID of sysmoOCTSIMTEST

2021-06-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24511 )

Change subject: Add usb product ID of sysmoOCTSIMTEST
..

Add usb product ID of sysmoOCTSIMTEST

This is a custom board for production testing of the sysmoOCTSIM,
an 8-slot smart card reader.

Change-Id: I65839be50ac896c76f34755fb2800f836f6cdae4
---
M firmware/libboard/octsimtest/include/board.h
M firmware/libcommon/include/simtrace_usb.h
M host/lib/usb_util.c
3 files changed, 4 insertions(+), 2 deletions(-)

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



diff --git a/firmware/libboard/octsimtest/include/board.h 
b/firmware/libboard/octsimtest/include/board.h
index 2e0f3c4..2b8e7bf 100644
--- a/firmware/libboard/octsimtest/include/board.h
+++ b/firmware/libboard/octsimtest/include/board.h
@@ -149,9 +149,9 @@
 /* OpenMoko SIMtrace 2 USB vendor ID */
 #define BOARD_USB_VENDOR_IDUSB_VENDOR_OPENMOKO
 /* OpenMoko SIMtrace 2 USB product ID (main application/runtime mode) */
-#define BOARD_USB_PRODUCT_ID   USB_PRODUCT_SIMTRACE2
+#define BOARD_USB_PRODUCT_ID   USB_PRODUCT_OCTSIMTEST
 /* OpenMoko SIMtrace 2 DFU USB product ID (DFU bootloader/DFU mode) */
-#define BOARD_DFU_USB_PRODUCT_ID USB_PRODUCT_SIMTRACE2_DFU
+#define BOARD_DFU_USB_PRODUCT_ID USB_PRODUCT_OCTSIMTEST
 /* USB release number (bcdDevice, shown as 0.00) */
 #define BOARD_USB_RELEASE  0x000
 /* Indicate SIMtrace is bus power in USB attributes */
diff --git a/firmware/libcommon/include/simtrace_usb.h 
b/firmware/libcommon/include/simtrace_usb.h
index be2da9f..a232ac5 100644
--- a/firmware/libcommon/include/simtrace_usb.h
+++ b/firmware/libcommon/include/simtrace_usb.h
@@ -25,6 +25,7 @@
 #define USB_PRODUCT_QMOD_SAM3  0x4004
 #define USB_PRODUCT_SIMTRACE2_DFU  0x60e3  /* was 0x60e2 */
 #define USB_PRODUCT_SIMTRACE2  0x60e3
+#define USB_PRODUCT_OCTSIMTEST 0x616d

 /* USB proprietary class */
 #define USB_CLASS_PROPRIETARY  0xff
diff --git a/host/lib/usb_util.c b/host/lib/usb_util.c
index 751..4d3b2b9 100644
--- a/host/lib/usb_util.c
+++ b/host/lib/usb_util.c
@@ -32,5 +32,6 @@
{ USB_VENDOR_OPENMOKO, USB_PRODUCT_OWHW_SAM3 },
{ USB_VENDOR_OPENMOKO, USB_PRODUCT_QMOD_SAM3 },
{ USB_VENDOR_OPENMOKO, USB_PRODUCT_SIMTRACE2 },
+   { USB_VENDOR_OPENMOKO, USB_PRODUCT_OCTSIMTEST },
{ 0, 0 }
 };

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I65839be50ac896c76f34755fb2800f836f6cdae4
Gerrit-Change-Number: 24511
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in simtrace2[master]: assert: Use printf_sync() to ensure printing of assert / panic

2021-06-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24510 )

Change subject: assert: Use printf_sync() to ensure printing of assert / panic
..

assert: Use printf_sync() to ensure printing of assert / panic

Change-Id: Icc202e60445d9be1cdcd61176db5ed1704d583e7
---
M firmware/libcommon/include/assert.h
M firmware/libosmocore/source/panic.c
M firmware/test/card_emu_tests.c
3 files changed, 16 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  dexter: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/firmware/libcommon/include/assert.h 
b/firmware/libcommon/include/assert.h
index 22bb101..dc6b1b5 100644
--- a/firmware/libcommon/include/assert.h
+++ b/firmware/libcommon/include/assert.h
@@ -89,7 +89,7 @@
/// \param condition  Condition to verify.
#define ASSERT(condition)  { \
if (!(condition)) { \
-   printf("-F- ASSERT: %s %s:%d\n\r", #condition, 
__BASE_FILE__, __LINE__); \
+   printf_sync("-F- ASSERT: %s %s:%d\n\r", 
#condition, __BASE_FILE__, __LINE__); \
while (1); \
} \
}
diff --git a/firmware/libosmocore/source/panic.c 
b/firmware/libosmocore/source/panic.c
index 74243b0..db5c26a 100644
--- a/firmware/libosmocore/source/panic.c
+++ b/firmware/libosmocore/source/panic.c
@@ -46,7 +46,7 @@
 __attribute__ ((format (printf, 1, 0)))
 static void osmo_panic_default(const char *fmt, va_list args)
 {
-   vfprintf(stderr, fmt, args);
+   vfprintf_sync(stderr, fmt, args);
osmo_generate_backtrace();
assert(0);
 }
diff --git a/firmware/test/card_emu_tests.c b/firmware/test/card_emu_tests.c
index 69159a8..5d5bd3e 100644
--- a/firmware/test/card_emu_tests.c
+++ b/firmware/test/card_emu_tests.c
@@ -13,6 +13,20 @@
 #define PHONE_INT  2
 #define PHONE_DATAOUT  3

+/* stub for stdio */
+signed int printf_sync(const char *pFormat, ...)
+{
+   va_list ap;
+   signed int result;
+
+   va_start(ap, pFormat);
+   result = vprintf(pFormat, ap);
+   va_end(ap);
+
+   return result;
+}
+
+
 /***
  * stub functions required by card_emu.c
  ***/

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Icc202e60445d9be1cdcd61176db5ed1704d583e7
Gerrit-Change-Number: 24510
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in simtrace2[master]: cardem-pcsc: initialize libosmocore logging

2021-06-03 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24522 )

Change subject: cardem-pcsc: initialize libosmocore logging
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I815d39190e944d9512ffc8e5f581515d7be9834f
Gerrit-Change-Number: 24522
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 03 Jun 2021 06:54:19 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: octsimtest: Switch direction of I/O level shifter depending on uart t...

2021-06-03 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24521 )

Change subject: octsimtest: Switch direction of I/O level shifter depending on 
uart tx / rx
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I44171363b5bd69d6049b12c86f8143be83557cb2
Gerrit-Change-Number: 24521
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 03 Jun 2021 06:54:08 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: octsimtest: most code for support of this new board

2021-06-03 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24520 )

Change subject: octsimtest: most code for support of this new board
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I7e03e0c0f2999a1ce2dad966d98e22033fa58465
Gerrit-Change-Number: 24520
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 03 Jun 2021 06:53:52 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: octsimtest: remove lots of unused #defines

2021-06-03 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24519 )

Change subject: octsimtest: remove lots of unused #defines
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I43e8631d945ba183a1e5b1e37dd4565adb377154
Gerrit-Change-Number: 24519
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 03 Jun 2021 06:53:39 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: Add usb product ID of sysmoOCTSIMTEST

2021-06-03 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24511 )

Change subject: Add usb product ID of sysmoOCTSIMTEST
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I65839be50ac896c76f34755fb2800f836f6cdae4
Gerrit-Change-Number: 24511
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 03 Jun 2021 06:53:33 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: assert: Use printf_sync() to ensure printing of assert / panic

2021-06-03 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/24510 )

Change subject: assert: Use printf_sync() to ensure printing of assert / panic
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Icc202e60445d9be1cdcd61176db5ed1704d583e7
Gerrit-Change-Number: 24510
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 03 Jun 2021 06:53:23 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment