Build failure of network:osmocom:nightly/simtrace2 in xUbuntu_20.04/x86_64

2021-04-04 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/simtrace2/xUbuntu_20.04/x86_64

Package network:osmocom:nightly/simtrace2 failed to build in 
xUbuntu_20.04/x86_64

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

Last lines of build log:
[  175s] [COMPILING apps/dfu/main.c]
[  175s] [COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu.c]
[  175s] [COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu_desc.c]
[  175s] [COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu_driver.c]
[  175s] Memory region Used Size  Region Size  %age Used
[  176s]  rom:   16628 B16 KB101.49%
[  176s]  ram:   11688 B48 KB 
23.78/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: warning: 
changing start of section .stack by 4 bytes
[  176s] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  176s] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: 
bin/qmod-dfu-flash.elf section `.text' will not fit in region `rom'
[  176s] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  176s] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  176s] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  176s] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: region 
`rom' overflowed by 244 bytes
[  176s] collect2: error: ld returned 1 exit status
[  176s] %
[  176s] make[2]: *** [Makefile:238: flash] Error 1
[  176s] make[2]: Leaving directory '/usr/src/packages/BUILD/firmware'
[  176s] make[1]: *** [Makefile:13: fw-qmod-dfu] Error 2
[  176s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  176s] dh_auto_build: error: make -j1 returned exit code 2
[  176s] make: *** [debian/rules:16: build] Error 25
[  176s] dpkg-buildpackage: error: debian/rules build subprocess returned exit 
status 2
[  176s] ### VM INTERACTION START ###
[  179s] [  163.573361] sysrq: Power Off
[  179s] [  163.586364] reboot: Power down
[  179s] ### VM INTERACTION END ###
[  179s] 
[  179s] sheep81 failed "build simtrace2_0.7.0.85.b218.dsc" at Mon Apr  5 
02:23:01 UTC 2021.
[  179s] 

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


Build failure of network:osmocom:nightly/simtrace2 in xUbuntu_20.10/x86_64

2021-04-04 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/simtrace2/xUbuntu_20.10/x86_64

Package network:osmocom:nightly/simtrace2 failed to build in 
xUbuntu_20.10/x86_64

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

Last lines of build log:
[  685s] [COMPILING libboard/qmod/source/board_qmod.c]
[  685s] [COMPILING libboard/qmod/source/card_pres.c]
[  685s] [COMPILING libboard/qmod/source/i2c.c]
[  686s] [COMPILING libboard/qmod/source/wwan_led.c]
[  686s] [COMPILING libboard/qmod/source/wwan_perst.c]
[  686s] [COMPILING apps/dfu/main.c]
[  687s] [COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu.c]
[  687s] [COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu_desc.c]
[  687s] [COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu_driver.c]
[  688s] Memory region Used Size  Region Size  %age Used
[  688s]  rom:   16628 B16 KB101.49%
[  688s]  ram:   11680 B48 KB 
23.76/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: 
bin/qmod-dfu-flash.elf section `.text' will not fit in region `rom'
[  688s] /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: region 
`rom' overflowed by 244 bytes
[  688s] collect2: error: ld returned 1 exit status
[  688s] %
[  688s] make[2]: *** [Makefile:238: flash] Error 1
[  688s] make[2]: Leaving directory '/usr/src/packages/BUILD/firmware'
[  688s] make[1]: *** [Makefile:13: fw-qmod-dfu] Error 2
[  688s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  688s] dh_auto_build: error: make -j1 returned exit code 2
[  688s] make: *** [debian/rules:16: build] Error 25
[  688s] dpkg-buildpackage: error: debian/rules build subprocess returned exit 
status 2
[  688s] ### VM INTERACTION START ###
[  691s] [  623.991395] sysrq: Power Off
[  691s] [  624.078645] reboot: Power down
[  692s] ### VM INTERACTION END ###
[  692s] 
[  692s] lamb26 failed "build simtrace2_0.7.0.85.b218.dsc" at Mon Apr  5 
02:13:27 UTC 2021.
[  692s] 

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


Change in libosmocore[master]: vty/logging: logp: properly handle library specific sub-systems

2021-04-04 Thread fixeria
Hello Jenkins Builder,

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

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

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

Change subject: vty/logging: logp: properly handle library specific sub-systems
..

vty/logging: logp: properly handle library specific sub-systems

The library specific sub-systems are kind of special, because their
position in the 'osmo_log_info' may vary depending on the number of
application specific sub-systems.  This is why their associated
constant values (like DLGLOBAL) are negative, and this is what
the LOGP() macro expects as the first argument.

Before this change, invoking 'logp' command with any library
specific logging sub-system would result in getting messages
printed with the fall-back DLGLOBAL sub-systems.

Change-Id: If86563e169fe1243adfa7b09c9d65d9f88c8a99e
---
M src/vty/logging_vty.c
M tests/logging/logging_vty_test.vty
2 files changed, 20 insertions(+), 0 deletions(-)


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: If86563e169fe1243adfa7b09c9d65d9f88c8a99e
Gerrit-Change-Number: 23630
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in libosmocore[master]: vty/logging: ensure consistent '%' prefix for warnings

2021-04-04 Thread fixeria
Hello Jenkins Builder,

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

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

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

Change subject: vty/logging: ensure consistent '%' prefix for warnings
..

vty/logging: ensure consistent '%' prefix for warnings

Change-Id: I2b2bab61e46668c3b4b0ccad88d02b6d00a83544
---
M src/vty/logging_vty.c
M tests/logging/logging_vty_test.vty
2 files changed, 7 insertions(+), 7 deletions(-)


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I2b2bab61e46668c3b4b0ccad88d02b6d00a83544
Gerrit-Change-Number: 23629
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in libosmocore[master]: vty/logging: logp: properly handle library specific sub-systems

2021-04-04 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/23630 )


Change subject: vty/logging: logp: properly handle library specific sub-systems
..

vty/logging: logp: properly handle library specific sub-systems

The library specific sub-systems are kind of special, because their
position in the 'osmo_log_info' may vary depending on the number of
application specific sub-systems.  This is why their associated
constant values (like DLGLOBAL) are negative, and this is what
the LOGP() macro expects as the first argument.

Before this change, invoking 'logp' command with any library
specific logging sub-system would result in getting messages
printed with the fall-back DLGLOBAL sub-systems.

Change-Id: If86563e169fe1243adfa7b09c9d65d9f88c8a99e
---
M src/vty/logging_vty.c
M tests/logging/logging_vty_test.vty
2 files changed, 20 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/23630/1

diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index 5f31b39..3b131c2 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -1110,6 +1110,23 @@
int category = log_parse_category(argv[0]);
int level = log_parse_level(argv[1]);
char *str = argv_concat(argv, argc, 2);
+
+   if (level < 0) {
+   vty_out(vty, "%% Invalid level '%s'%s", argv[1], VTY_NEWLINE);
+   return CMD_WARNING;
+   }
+
+   if (category < 0) {
+   vty_out(vty, "%% Invalid category '%s'%s", argv[0], 
VTY_NEWLINE);
+   return CMD_WARNING;
+   }
+
+   /* Properly handle library specific sub-systems */
+   if ((unsigned int) category >= osmo_log_info->num_cat_user) {
+   category -= osmo_log_info->num_cat_user - 1;
+   category *= -1;
+   }
+
LOGP(category, level, "%s\n", str);
return CMD_SUCCESS;
 }
diff --git a/tests/logging/logging_vty_test.vty 
b/tests/logging/logging_vty_test.vty
index 91c2a48..68d132a 100644
--- a/tests/logging/logging_vty_test.vty
+++ b/tests/logging/logging_vty_test.vty
@@ -526,3 +526,6 @@
 logging_vty_test# logp lglobal debug This log message is not echoed
 logging_vty_test# logp lglobal notice This log message is echoed
 DLGLOBAL NOTICE This log message is echoed
+
+logging_vty_test# logp dlctrl notice This is a CTRL specific message
+DLCTRL NOTICE This is a CTRL specific message

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: If86563e169fe1243adfa7b09c9d65d9f88c8a99e
Gerrit-Change-Number: 23630
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Change in libosmocore[master]: vty/logging: ensure consistent '%' prefix for warnings

2021-04-04 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/23629 )


Change subject: vty/logging: ensure consistent '%' prefix for warnings
..

vty/logging: ensure consistent '%' prefix for warnings

Change-Id: I2b2bab61e46668c3b4b0ccad88d02b6d00a83544
---
M src/vty/logging_vty.c
1 file changed, 6 insertions(+), 6 deletions(-)



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

diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index cc250c0..5f31b39 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -131,7 +131,7 @@

conn = (struct telnet_connection *) vty->priv;
if (conn->dbg) {
-   vty_out(vty, "Logging already enabled.%s", VTY_NEWLINE);
+   vty_out(vty, "%% Logging already enabled.%s", VTY_NEWLINE);
return CMD_WARNING;
}

@@ -158,7 +158,7 @@

conn = (struct telnet_connection *) vty->priv;
if (!conn->dbg)
-   vty_out(vty, "Logging was not enabled.%s", VTY_NEWLINE);
+   vty_out(vty, "%% Logging was not enabled.%s", VTY_NEWLINE);

return conn->dbg;
 }
@@ -372,12 +372,12 @@
int level = log_parse_level(argv[1]);

if (level < 0) {
-   vty_out(vty, "Invalid level '%s'%s", argv[1], VTY_NEWLINE);
+   vty_out(vty, "%% Invalid level '%s'%s", argv[1], VTY_NEWLINE);
return CMD_WARNING;
}

if (category < 0) {
-   vty_out(vty, "Invalid category '%s'%s", argv[0], VTY_NEWLINE);
+   vty_out(vty, "%% Invalid category '%s'%s", argv[0], 
VTY_NEWLINE);
return CMD_WARNING;
}

@@ -595,7 +595,7 @@
char **dptr = vty->index_sub;

if (!dptr) {
-   vty_out(vty, "vty->index_sub == NULL%s", VTY_NEWLINE);
+   vty_out(vty, "%% vty->index_sub == NULL%s", VTY_NEWLINE);
return CMD_WARNING;
}

@@ -616,7 +616,7 @@
char **dptr = vty->index_sub;

if (!dptr) {
-   vty_out(vty, "vty->index_sub == NULL%s", VTY_NEWLINE);
+   vty_out(vty, "%% vty->index_sub == NULL%s", VTY_NEWLINE);
return CMD_WARNING;
}


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I2b2bab61e46668c3b4b0ccad88d02b6d00a83544
Gerrit-Change-Number: 23629
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Change in libosmocore[master]: vty/logging: use consistent quiting in warning messages

2021-04-04 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/23628 )


Change subject: vty/logging: use consistent quiting in warning messages
..

vty/logging: use consistent quiting in warning messages

Change-Id: Ifded63a38caac26e174fc6cb69dead7bc83db344
---
M src/vty/logging_vty.c
1 file changed, 4 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/28/23628/1

diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index 48b039b..cc250c0 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -372,12 +372,12 @@
int level = log_parse_level(argv[1]);

if (level < 0) {
-   vty_out(vty, "Invalid level `%s'%s", argv[1], VTY_NEWLINE);
+   vty_out(vty, "Invalid level '%s'%s", argv[1], VTY_NEWLINE);
return CMD_WARNING;
}

if (category < 0) {
-   vty_out(vty, "Invalid category `%s'%s", argv[0], VTY_NEWLINE);
+   vty_out(vty, "Invalid category '%s'%s", argv[0], VTY_NEWLINE);
return CMD_WARNING;
}

@@ -889,7 +889,7 @@
if (!tgt) {
tgt = log_target_create_file(fname);
if (!tgt) {
-   vty_out(vty, "%% Unable to create file `%s'%s",
+   vty_out(vty, "%% Unable to create file '%s'%s",
fname, VTY_NEWLINE);
RET_WITH_UNLOCK(CMD_WARNING);
}
@@ -913,7 +913,7 @@
log_tgt_mutex_lock();
tgt = log_target_find(LOG_TGT_TYPE_FILE, fname);
if (!tgt) {
-   vty_out(vty, "%% No such log file `%s'%s",
+   vty_out(vty, "%% No such log file '%s'%s",
fname, VTY_NEWLINE);
RET_WITH_UNLOCK(CMD_WARNING);
}

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ifded63a38caac26e174fc6cb69dead7bc83db344
Gerrit-Change-Number: 23628
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Build failure of network:osmocom:nightly/simtrace2 in xUbuntu_18.04/x86_64

2021-04-04 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/simtrace2/xUbuntu_18.04/x86_64

Package network:osmocom:nightly/simtrace2 failed to build in 
xUbuntu_18.04/x86_64

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

Last lines of build log:
[  104s] [COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu_driver.c]
[  104s] Memory region Used Size  Region Size  %age Used
[  104s]  rom:   16400 B16 KB100.10%
[  104s]  ram:   11688 B48 KB 
23.78/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: warning: 
changing start of section .stack by 4 bytes
[  104s] /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  104s] /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: 
bin/qmod-dfu-flash.elf section `.text' will not fit in region `rom'
[  104s] /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  104s] /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  104s] /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  104s] /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: region 
`rom' overflowed by 16 bytes
[  104s] collect2: error: ld returned 1 exit status
[  104s] %
[  104s] Makefile:238: recipe for target 'flash' failed
[  104s] make[2]: *** [flash] Error 1
[  104s] make[2]: Leaving directory '/usr/src/packages/BUILD/firmware'
[  104s] Makefile:13: recipe for target 'fw-qmod-dfu' failed
[  104s] make[1]: *** [fw-qmod-dfu] Error 2
[  104s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  104s] dh_auto_build: make -j1 returned exit code 2
[  104s] debian/rules:16: recipe for target 'build' failed
[  104s] make: *** [build] Error 2
[  104s] dpkg-buildpackage: error: debian/rules build subprocess returned exit 
status 2
[  104s] ### VM INTERACTION START ###
[  107s] [   98.514857] sysrq: Power Off
[  107s] [   98.519466] reboot: Power down
[  107s] ### VM INTERACTION END ###
[  107s] 
[  107s] sheep87 failed "build simtrace2_0.7.0.85.b218.dsc" at Mon Apr  5 
01:53:20 UTC 2021.
[  107s] 

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


Build failure of network:osmocom:nightly/simtrace2 in Debian_9.0/x86_64

2021-04-04 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/simtrace2/Debian_9.0/x86_64

Package network:osmocom:nightly/simtrace2 failed to build in Debian_9.0/x86_64

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

Last lines of build log:
[  154s] [COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu_driver.c]
[  154s] Memory region Used Size  Region Size  %age Used
[  154s]  rom:   16400 B16 KB100.10%
[  154s]  ram:   11688 B48 KB 
23.78/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: 
changing start of section .stack by 4 bytes
[  154s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  154s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: 
bin/qmod-dfu-flash.elf section `.text' will not fit in region `rom'
[  154s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  154s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  154s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  154s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: region 
`rom' overflowed by 16 bytes
[  154s] collect2: error: ld returned 1 exit status
[  154s] %
[  154s] Makefile:238: recipe for target 'flash' failed
[  154s] make[2]: *** [flash] Error 1
[  154s] make[2]: Leaving directory '/usr/src/packages/BUILD/firmware'
[  154s] Makefile:13: recipe for target 'fw-qmod-dfu' failed
[  154s] make[1]: *** [fw-qmod-dfu] Error 2
[  154s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  154s] dh_auto_build: make -j1 returned exit code 2
[  154s] debian/rules:16: recipe for target 'build' failed
[  154s] make: *** [build] Error 2
[  154s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  155s] ### VM INTERACTION START ###
[  158s] [  142.565195] sysrq: Power Off
[  158s] [  142.585998] reboot: Power down
[  158s] ### VM INTERACTION END ###
[  158s] 
[  158s] lamb28 failed "build simtrace2_0.7.0.85.b218.dsc" at Mon Apr  5 
01:52:00 UTC 2021.
[  158s] 

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


Build failure of network:osmocom:nightly/simtrace2 in Debian_9.0/i586

2021-04-04 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/simtrace2/Debian_9.0/i586

Package network:osmocom:nightly/simtrace2 failed to build in Debian_9.0/i586

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

Last lines of build log:
[  271s] [COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu_driver.c]
[  272s] Memory region Used Size  Region Size  %age Used
[  272s]  rom:   16400 B16 KB100.10%
[  272s]  ram:   11688 B48 KB 
23.78/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: 
changing start of section .stack by 4 bytes
[  272s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  272s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: 
bin/qmod-dfu-flash.elf section `.text' will not fit in region `rom'
[  272s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  272s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  272s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  272s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: region 
`rom' overflowed by 16 bytes
[  272s] collect2: error: ld returned 1 exit status
[  272s] %
[  272s] Makefile:238: recipe for target 'flash' failed
[  272s] make[2]: *** [flash] Error 1
[  272s] make[2]: Leaving directory '/usr/src/packages/BUILD/firmware'
[  272s] Makefile:13: recipe for target 'fw-qmod-dfu' failed
[  272s] make[1]: *** [fw-qmod-dfu] Error 2
[  272s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  272s] dh_auto_build: make -j1 returned exit code 2
[  272s] debian/rules:16: recipe for target 'build' failed
[  272s] make: *** [build] Error 2
[  272s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  272s] ### VM INTERACTION START ###
[  275s] [  236.716262] sysrq: Power Off
[  275s] [  236.816649] reboot: Power down
[  276s] ### VM INTERACTION END ###
[  276s] 
[  276s] lamb21 failed "build simtrace2_0.7.0.85.b218.dsc" at Mon Apr  5 
01:40:16 UTC 2021.
[  276s] 

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


Build failure of network:osmocom:nightly/simtrace2 in Debian_9.0/armv7l

2021-04-04 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/simtrace2/Debian_9.0/armv7l

Package network:osmocom:nightly/simtrace2 failed to build in Debian_9.0/armv7l

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

Last lines of build log:
[  166s] [COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu_driver.c]
[  167s] Memory region Used Size  Region Size  %age Used
[  167s]  rom:   16400 B16 KB100.10%
[  167s]  ram:   11688 B48 KB 
23.78/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: 
changing start of section .stack by 4 bytes
[  167s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  167s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: 
bin/qmod-dfu-flash.elf section `.text' will not fit in region `rom'
[  167s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  167s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  167s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  167s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: region 
`rom' overflowed by 16 bytes
[  167s] collect2: error: ld returned 1 exit status
[  167s] %
[  167s] Makefile:238: recipe for target 'flash' failed
[  167s] make[2]: *** [flash] Error 1
[  167s] make[2]: Leaving directory '/usr/src/packages/BUILD/firmware'
[  167s] Makefile:13: recipe for target 'fw-qmod-dfu' failed
[  167s] make[1]: *** [fw-qmod-dfu] Error 2
[  167s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  167s] dh_auto_build: make -j1 returned exit code 2
[  167s] debian/rules:16: recipe for target 'build' failed
[  167s] make: *** [build] Error 2
[  167s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  167s] ### VM INTERACTION START ###
[  170s] [  156.393206] sysrq: SysRq : Power Off
[  170s] [  156.394919] reboot: Power down
[  170s] ### VM INTERACTION END ###
[  170s] 
[  170s] armbuild04 failed "build simtrace2_0.7.0.85.b218.dsc" at Mon Apr  5 
01:40:26 UTC 2021.
[  170s] 

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


Build failure of network:osmocom:nightly/simtrace2 in Debian_9.0/aarch64

2021-04-04 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/simtrace2/Debian_9.0/aarch64

Package network:osmocom:nightly/simtrace2 failed to build in Debian_9.0/aarch64

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

Last lines of build log:
[  128s] [COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu_driver.c]
[  129s] Memory region Used Size  Region Size  %age Used
[  129s]  rom:   16400 B16 KB100.10%
[  129s]  ram:   11688 B48 KB 
23.78/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: 
changing start of section .stack by 4 bytes
[  129s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  129s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: 
bin/qmod-dfu-flash.elf section `.text' will not fit in region `rom'
[  129s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  129s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  129s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: 
warning: changing start of section .stack by 4 bytes
[  129s] /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: region 
`rom' overflowed by 16 bytes
[  129s] collect2: error: ld returned 1 exit status
[  129s] %
[  129s] Makefile:238: recipe for target 'flash' failed
[  129s] make[2]: *** [flash] Error 1
[  129s] make[2]: Leaving directory '/usr/src/packages/BUILD/firmware'
[  129s] Makefile:13: recipe for target 'fw-qmod-dfu' failed
[  129s] make[1]: *** [fw-qmod-dfu] Error 2
[  129s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  129s] dh_auto_build: make -j1 returned exit code 2
[  129s] debian/rules:16: recipe for target 'build' failed
[  129s] make: *** [build] Error 2
[  129s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  129s] ### VM INTERACTION START ###
[  132s] [  120.145156] sysrq: Power Off
[  132s] [  120.208094] reboot: Power down
[  132s] ### VM INTERACTION END ###
[  132s] 
[  132s] obs-arm-9 failed "build simtrace2_0.7.0.85.b218.dsc" at Mon Apr  5 
01:38:10 UTC 2021.
[  132s] 

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


Jenkins build is back to normal : master-osmo-sip-connector » a1=default,a2=default,a3=default,a4=default,osmocom-master-debian9 #3363

2021-04-04 Thread jenkins
See 




Change in simtrace2[master]: minor add comments

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

Change subject: minor add comments
..

minor add comments

this is just to better understand the flow

Change-Id: I045286836176da729cc8c863866d6f6aa3836592
---
M firmware/libcommon/source/mode_cardemu.c
1 file changed, 28 insertions(+), 8 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 6a8d98f..4886983 100644
--- a/firmware/libcommon/source/mode_cardemu.c
+++ b/firmware/libcommon/source/mode_cardemu.c
@@ -1,7 +1,7 @@
 /* card emulation mode
  *
  * (C) 2015-2017 by Harald Welte 
- * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon 

+ * (C) 2018-2019 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon 

  *
  * 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
@@ -194,7 +194,8 @@
 }


-/* FIXME: integrate this with actual irq handler */
+/*! common handler if interrupt was received.
+ *  \param[in] inst_num Instance number, range 0..1 (some boards only '0' 
permitted) */
 static void usart_irq_rx(uint8_t inst_num)
 {
Usart *usart = get_usart_by_chan(inst_num);
@@ -202,32 +203,43 @@
uint32_t csr;
uint8_t byte = 0;

+   /* get one atomic snapshot of state/flags before they get changed */
csr = usart->US_CSR & usart->US_IMR;

+   /* check if one byte has been completely received and is now in the 
holding register */
if (csr & US_CSR_RXRDY) {
+   /* read the bye from the holding register */
byte = (usart->US_RHR) & 0xFF;
+   /* append it to the buffer */
if (rbuf_write(>rb, byte) < 0)
TRACE_ERROR("rbuf overrun\r\n");
}

+   /* check if the transmitter is ready for the next byte */
if (csr & US_CSR_TXRDY) {
-   if (card_emu_tx_byte(ci->ch) == 0)
+   /* transmit next byte and check if more bytes are to be 
transmitted */
+   if (card_emu_tx_byte(ci->ch) == 0) {
+   /* stop the TX ready interrupt of no more bytes to 
transmit */
USART_DisableIt(usart, US_IER_TXRDY);
+   }
}

-   if (csr & (US_CSR_OVRE|US_CSR_FRAME|US_CSR_PARE|
-  US_CSR_TIMEOUT|US_CSR_NACK|(1<<10))) {
+   /* check if any error flags are set */
+   if (csr & 
(US_CSR_OVRE|US_CSR_FRAME|US_CSR_PARE|US_CSR_TIMEOUT|US_CSR_NACK|(1<<10))) {
+   /* clear any error flags */
usart->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK;
-   TRACE_ERROR("%u e 0x%x st: 0x%lx\n", ci->num, byte, csr);
+   TRACE_ERROR("%u USART error on 0x%x status: 0x%lx\n", ci->num, 
byte, csr);
}
 }

+/*! ISR called for USART0 */
 void mode_cardemu_usart0_irq(void)
 {
/* USART0 == Instance 1 == USIM 2 */
usart_irq_rx(1);
 }

+/*! ISR called for USART1 */
 void mode_cardemu_usart1_irq(void)
 {
/* USART1 == Instance 0 == USIM 1 */
@@ -419,15 +431,21 @@
INIT_LLIST_HEAD(_inst[0].usb_out_queue);
rbuf_reset(_inst[0].rb);
PIO_Configure(pins_usim1, PIO_LISTSIZE(pins_usim1));
+
+   /* configure USART as ISO-7816 slave (e.g. card) */
ISO7816_Init(_inst[0].usart_info, CLK_SLAVE);
NVIC_EnableIRQ(USART1_IRQn);
PIO_ConfigureIt(_usim1_rst, usim1_rst_irqhandler);
PIO_EnableIt(_usim1_rst);
-   usim1_rst_irqhandler(_usim1_rst); /* obtain current RST state */
+
+   /* obtain current RST state */
+   usim1_rst_irqhandler(_usim1_rst);
 #ifndef DETECT_VCC_BY_ADC
PIO_ConfigureIt(_usim1_vcc, usim1_vcc_irqhandler);
PIO_EnableIt(_usim1_vcc);
-   usim1_vcc_irqhandler(_usim1_vcc); /* obtain current VCC state */
+
+   /* obtain current VCC state */
+   usim1_vcc_irqhandler(_usim1_vcc);
 #else
do {} while (!adc_triggered); /* wait for first ADC reading */
 #endif /* DETECT_VCC_BY_ADC */
@@ -442,6 +460,7 @@
rbuf_reset(_inst[1].rb);
PIO_Configure(pins_usim2, PIO_LISTSIZE(pins_usim2));
ISO7816_Init(_inst[1].usart_info, CLK_SLAVE);
+   /* TODO enable timeout */
NVIC_EnableIRQ(USART0_IRQn);
PIO_ConfigureIt(_usim2_rst, usim2_rst_irqhandler);
PIO_EnableIt(_usim2_rst);
@@ -458,6 +477,7 @@
  SIMTRACE_CARDEM_USB_EP_USIM2_INT, 
cardem_inst[1].vcc_active,
  cardem_inst[1].rst_active, 
cardem_inst[1].vcc_active);
sim_switch_use_physical(1, 1);
+   /* TODO check RST and VCC */
 #endif /* CARDEMU_SECOND_UART */
 }


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

Change in simtrace2[master]: minor add comments

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

Change subject: minor add comments
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I045286836176da729cc8c863866d6f6aa3836592
Gerrit-Change-Number: 23615
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Assignee: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-Comment-Date: Sun, 04 Apr 2021 21:25:27 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: add ISO 7816-3 library to remsim project

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

Change subject: add ISO 7816-3 library to remsim project
..

add ISO 7816-3 library to remsim project

Change-Id: I99f3fecbc00d2379c3a6dc457b047c6fee41c292
---
M firmware/apps/cardem/Makefile
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/firmware/apps/cardem/Makefile b/firmware/apps/cardem/Makefile
index 75c43e8..d5f68a5 100644
--- a/firmware/apps/cardem/Makefile
+++ b/firmware/apps/cardem/Makefile
@@ -1,3 +1,3 @@
 C_FILES += $(C_LIBUSB_RT)

-C_FILES += card_emu.c cciddriver.c iso7816_4.c iso7816_fidi.c mitm.c 
mode_cardemu.c mode_ccid.c simtrace_iso7816.c sniffer.c tc_etu.c usb.c
+C_FILES += card_emu.c cciddriver.c iso7816_3.c iso7816_4.c iso7816_fidi.c 
mitm.c mode_cardemu.c mode_ccid.c simtrace_iso7816.c sniffer.c tc_etu.c usb.c

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I99f3fecbc00d2379c3a6dc457b047c6fee41c292
Gerrit-Change-Number: 23613
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-MessageType: merged


Change in simtrace2[master]: rename PIN_PHONE_{CLK, IO} to PIN_USIM1_{CLK, IO}

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

Change subject: rename PIN_PHONE_{CLK,IO} to PIN_USIM1_{CLK,IO}
..

rename PIN_PHONE_{CLK,IO} to PIN_USIM1_{CLK,IO}

While this differs from tha naming in the schematics ({CLK,IO}_PHONE),
this matches the naming scheme used for USIM2 and the naming on other
boards.

Change-Id: I486b14260faec897e8c8698c4b7987bf36492497
---
M firmware/libboard/simtrace/include/board.h
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/firmware/libboard/simtrace/include/board.h 
b/firmware/libboard/simtrace/include/board.h
index 35c9426..ab1c019 100644
--- a/firmware/libboard/simtrace/include/board.h
+++ b/firmware/libboard/simtrace/include/board.h
@@ -78,11 +78,11 @@
 /* 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_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}
+#define PIN_USIM1_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}
+#define PIN_USIM1_CLK  {PIO_PA23A_SCK1, PIOA, ID_PIOA, PIO_PERIPH_A, 
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
+#define PINS_USIM1  PIN_USIM1_IO, PIN_USIM1_CLK, 
PIN_PHONE_CLK_INPUT, PIN_USIM1_VCC, PIN_PHONE_IO_INPUT, PIN_USIM1_nRST
 /* 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) */

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I486b14260faec897e8c8698c4b7987bf36492497
Gerrit-Change-Number: 23614
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-MessageType: merged


Change in simtrace2[master]: add library providing ISO 7816-3 utilities

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

Change subject: add library providing ISO 7816-3 utilities
..

add library providing ISO 7816-3 utilities

this will become part of libosmocore since it it common to smart
card related projects (such as osmo-ccid-firmware)

Change-Id: I3d4c65d137fc4555fcb256443feadd1c695de73d
---
A firmware/libcommon/include/iso7816_3.h
A firmware/libcommon/source/iso7816_3.c
2 files changed, 229 insertions(+), 0 deletions(-)

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



diff --git a/firmware/libcommon/include/iso7816_3.h 
b/firmware/libcommon/include/iso7816_3.h
new file mode 100644
index 000..e6c1b4f
--- /dev/null
+++ b/firmware/libcommon/include/iso7816_3.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2019 sysmocom -s.f.m.c. GmbH, Author: Kevin Redon 

+ *
+ * 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; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
USA.
+*/
+
+/* this library provides utilities to handle the ISO-7816 part 3 communication 
aspects (e.g. related
+ * to F and D) */
+
+#pragma once
+
+#include 
+#include 
+
+/*! default clock rate conversion integer Fd.
+ *  ISO/IEC 7816-3:2006(E) section 8.1 */
+#define ISO7816_3_DEFAULT_FD 372
+
+/*! default baud rate adjustment factor Dd.
+ *  ISO/IEC 7816-3:2006(E) section 8.1 */
+#define ISO7816_3_DEFAULT_DD 1
+
+/*! default clock rate conversion integer Fi.
+ *  ISO/IEC 7816-3:2006(E) section 8.3
+ *  \note non-default value is optionally specified in TA1 */
+#define ISO7816_3_DEFAULT_FI 372
+
+/*! default baud rate adjustment factor Di.
+ *  ISO/IEC 7816-3:2006(E) section 8.3
+ *  \note non-default value is optionally specified in TA1 */
+#define ISO7816_3_DEFAULT_DI 1
+
+/*! default maximum clock frequency, in Hz.
+ *  ISO/IEC 7816-3:2006(E) section 8.3
+ *  \note non-default value is optionally specified in TA1 */
+#define ISO7816_3_DEFAULT_FMAX 500UL
+
+/*! default Waiting Integer (WI) value for T=0.
+ *  ISO/IEC 7816-3:2006(E) section 10.2
+ *  \note non-default value is optionally specified in TC2 */
+#define ISO7816_3_DEFAULT_WI 10
+
+/*! default Waiting Time (WT) value, in ETU.
+ *  ISO/IEC 7816-3:2006(E) section 8.1
+ *  \note depends on Fi, Di, and WI if protocol T=0 is selected */
+#define ISO7816_3_DEFAULT_WT 9600
+
+extern const uint16_t iso7816_3_fi_table[];
+
+extern const uint32_t iso7816_3_fmax_table[];
+
+extern const uint8_t iso7816_3_di_table[];
+
+bool iso7816_3_valid_f(uint16_t f);
+
+bool iso7816_3_valid_d(uint8_t d);
+
+int32_t iso7816_3_calculate_wt(uint8_t wi, uint16_t fi, uint8_t di, uint16_t 
f, uint8_t d);
diff --git a/firmware/libcommon/source/iso7816_3.c 
b/firmware/libcommon/source/iso7816_3.c
new file mode 100644
index 000..ccdff68
--- /dev/null
+++ b/firmware/libcommon/source/iso7816_3.c
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2019 sysmocom -s.f.m.c. GmbH, Author: Kevin Redon 

+ *
+ * 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; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
USA.
+*/
+#include 
+#include 
+
+#include "utils.h"
+#include "iso7816_3.h"
+
+/*! Table of clock rate conversion integer F indexed by Fi.
+ *  \note Fi is indicated in TA1, but the same table is used for F and Fn 
during PPS
+ *  ISO/IEC 7816-3:2006(E) table 7 */
+const uint16_t iso7816_3_fi_table[16] = {
+   372, 372, 558, 744, 1116, 1488, 1860, 0,
+   0, 512, 768, 1024, 1536, 2048, 0, 0
+};
+
+/*! Table of maximum clock frequency f_max in Hz indexed by Fi.
+ *  ISO/IEC 7816-3:2006(E) table 7
+ *  \note f_max is indicated in TA1, but the same table is used for F and Fn 
during PPS */
+const uint32_t 

Change in simtrace2[master]: rename PIN_PHONE_{CLK, IO} to PIN_USIM1_{CLK, IO}

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

Change subject: rename PIN_PHONE_{CLK,IO} to PIN_USIM1_{CLK,IO}
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I486b14260faec897e8c8698c4b7987bf36492497
Gerrit-Change-Number: 23614
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-Comment-Date: Sun, 04 Apr 2021 21:25:22 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: add library providing ISO 7816-3 utilities

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

Change subject: add library providing ISO 7816-3 utilities
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I3d4c65d137fc4555fcb256443feadd1c695de73d
Gerrit-Change-Number: 23612
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-Comment-Date: Sun, 04 Apr 2021 21:25:17 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: cardemu: different init for simtrace board which uses uart timers

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

Change subject: cardemu: different init for simtrace board which uses uart 
timers
..


Patch Set 2: Code-Review-1

I have the feeling this should not be a separate patch.  Ater all, at the point 
this patch is in the series, the "simtrace board" is not using uart timers yet.


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I464f0ce1ec5e60be5f9377186b7d13a5e6dc637e
Gerrit-Change-Number: 23617
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-Comment-Date: Sun, 04 Apr 2021 21:25:00 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: minor add comments

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

Change subject: minor add comments
..


Patch Set 2: Code-Review+1


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I045286836176da729cc8c863866d6f6aa3836592
Gerrit-Change-Number: 23615
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Assignee: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-Comment-Date: Sun, 04 Apr 2021 21:21:11 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: rename PIN_PHONE_{CLK, IO} to PIN_USIM1_{CLK, IO}

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

Change subject: rename PIN_PHONE_{CLK,IO} to PIN_USIM1_{CLK,IO}
..


Patch Set 2: Code-Review+1


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I486b14260faec897e8c8698c4b7987bf36492497
Gerrit-Change-Number: 23614
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-Comment-Date: Sun, 04 Apr 2021 21:20:48 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: add library providing ISO 7816-3 utilities

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

Change subject: add library providing ISO 7816-3 utilities
..


Patch Set 2: Code-Review+1


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I3d4c65d137fc4555fcb256443feadd1c695de73d
Gerrit-Change-Number: 23612
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-Comment-Date: Sun, 04 Apr 2021 21:20:23 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: cardem: Use USART timeout for waiting time

2021-04-04 Thread laforge
Hello Jenkins Builder, tsaitgaist,

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

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

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

Change subject: cardem: Use USART timeout for waiting time
..

cardem: Use USART timeout for waiting time

The reset/ATR handling has been heavily updated/fixed.

Instead of using the timer/counter peripheral to handle the waiting time
and corresponding timeout, the USART peripheral internal timeout
mechanism is used.

This is particularly important for the SIMtrace board since the clock
signal is not connected to the timer counter.  thus this change adds
card emulation support for SIMtrace boards.

Fi and Di have been properly rename to F and D since the "i" stands only
for an "indicated" value, not the actual value.  This does not change
the USB protocol (the variable have just been renamed).  Additional
variables store more information about the card capabilities

NOTE: It has only be tested for the SIMtrace board

Change-Id: Ibcb2c8cace9137695adf5fb3de43566f7cfb93b5
---
M contrib/jenkins.sh
M firmware/apps/cardem/Makefile
M firmware/apps/cardem/main.c
M firmware/apps/trace/Makefile
M firmware/libboard/qmod/include/board.h
M firmware/libboard/simtrace/include/board.h
M firmware/libcommon/include/card_emu.h
M firmware/libcommon/include/simtrace_prot.h
M firmware/libcommon/include/tc_etu.h
M firmware/libcommon/source/card_emu.c
M firmware/libcommon/source/mode_cardemu.c
M firmware/libcommon/source/tc_etu.c
M firmware/libosmocore/include/osmocom/core/utils.h
M host/src/simtrace2-cardem-pcsc.c
14 files changed, 340 insertions(+), 64 deletions(-)


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ibcb2c8cace9137695adf5fb3de43566f7cfb93b5
Gerrit-Change-Number: 23620
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: tsaitgaist 
Gerrit-MessageType: newpatchset


Change in simtrace2[master]: minor add comments

2021-04-04 Thread laforge
Hello Jenkins Builder, tsaitgaist,

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

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

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

Change subject: minor add comments
..

minor add comments

this is just to better understand the flow

Change-Id: I045286836176da729cc8c863866d6f6aa3836592
---
M firmware/libcommon/source/mode_cardemu.c
1 file changed, 28 insertions(+), 8 deletions(-)


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I045286836176da729cc8c863866d6f6aa3836592
Gerrit-Change-Number: 23615
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Assignee: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-MessageType: newpatchset


Change in simtrace2[master]: cardem: use edge-triggered VCC ADC logic

2021-04-04 Thread laforge
Hello Jenkins Builder, tsaitgaist,

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

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

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

Change subject: cardem: use edge-triggered VCC ADC logic
..

cardem: use edge-triggered VCC ADC logic

Before this patch, we used to st ci->vcc_active depending on the
instantaneous ADC reading of VCC.  Is it > .5v, we claim VCC is active,
and if it's below, VCC is inactive.

With this patch we move to an edge triggered approach: Only change
ci->vcc_active if the previous reading was different from the current
reading.

FIXME: why?

Change-Id: I71b703162219484e43638f1f2f692e9dd554ef55
---
M firmware/libcommon/source/mode_cardemu.c
1 file changed, 8 insertions(+), 2 deletions(-)


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I71b703162219484e43638f1f2f692e9dd554ef55
Gerrit-Change-Number: 23616
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Assignee: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: tsaitgaist 
Gerrit-MessageType: newpatchset


Change in simtrace2[master]: rename PIN_PHONE_{CLK, IO} to PIN_USIM1_{CLK, IO}

2021-04-04 Thread laforge
Hello Jenkins Builder, tsaitgaist,

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

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

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

Change subject: rename PIN_PHONE_{CLK,IO} to PIN_USIM1_{CLK,IO}
..

rename PIN_PHONE_{CLK,IO} to PIN_USIM1_{CLK,IO}

While this differs from tha naming in the schematics ({CLK,IO}_PHONE),
this matches the naming scheme used for USIM2 and the naming on other
boards.

Change-Id: I486b14260faec897e8c8698c4b7987bf36492497
---
M firmware/libboard/simtrace/include/board.h
1 file changed, 3 insertions(+), 3 deletions(-)


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I486b14260faec897e8c8698c4b7987bf36492497
Gerrit-Change-Number: 23614
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: tsaitgaist 
Gerrit-MessageType: newpatchset


Change in simtrace2[master]: add library providing ISO 7816-3 utilities

2021-04-04 Thread laforge
Hello Jenkins Builder, tsaitgaist,

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

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

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

Change subject: add library providing ISO 7816-3 utilities
..

add library providing ISO 7816-3 utilities

this will become part of libosmocore since it it common to smart
card related projects (such as osmo-ccid-firmware)

Change-Id: I3d4c65d137fc4555fcb256443feadd1c695de73d
---
A firmware/libcommon/include/iso7816_3.h
A firmware/libcommon/source/iso7816_3.c
2 files changed, 229 insertions(+), 0 deletions(-)


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I3d4c65d137fc4555fcb256443feadd1c695de73d
Gerrit-Change-Number: 23612
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: tsaitgaist 
Gerrit-MessageType: newpatchset


Change in osmo-bsc[master]: abis_nm: finally handle BTS_TYPE_VARIANT, match BTS type

2021-04-04 Thread fixeria
fixeria has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18618 )

Change subject: abis_nm: finally handle BTS_TYPE_VARIANT, match BTS type
..


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I344afccdb82f62a7d483b57597d08f028f88bdc9
Gerrit-Change-Number: 18618
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge 
Gerrit-MessageType: abandon


Change in osmo-bsc[master]: abis_nm: rework warnings about unknown / not supported features

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

Change subject: abis_nm: rework warnings about unknown / not supported features
..


Patch Set 7:

(1 comment)

https://gerrit.osmocom.org/c/osmo-bsc/+/18599/5//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/c/osmo-bsc/+/18599/5//COMMIT_MSG@13
PS5, Line 13: do not log this
I changed my decision while re-working this patch.



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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I2f925bcdb010cb10d074bf7c82619e3ae1f8818b
Gerrit-Change-Number: 18599
Gerrit-PatchSet: 7
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Sun, 04 Apr 2021 20:17:06 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: Split GSM_BTS_TYPE_OSMOBTS to individual BTS types

2021-04-04 Thread fixeria
fixeria has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18616 )

Change subject: Split GSM_BTS_TYPE_OSMOBTS to individual BTS types
..


Abandoned

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I00a815cfa6daab126742d27843e700c07c1db183
Gerrit-Change-Number: 18616
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: abandon


Change in osmo-bsc[master]: Replace all references to 'sysmobts' with 'osmo-bts'

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


Change subject: Replace all references to 'sysmobts' with 'osmo-bts'
..

Replace all references to 'sysmobts' with 'osmo-bts'

sysmoBTS is a BTS model sold by Sysmocom, which runs osmo-bts.
The later may also work with some other back-ends, including
the genaral purpose SDR hardware.  Therefore, it's more
logical to call it 'osmo-bts'.

Change-Id: I93ab4dbf483e0786c35685b75ee4ea83bd591f7b
---
M include/osmocom/bsc/bss.h
M include/osmocom/bsc/bts.h
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/bsc_ctrl_commands.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts_init.c
A src/osmo-bsc/bts_osmobts.c
D src/osmo-bsc/bts_sysmobts.c
M src/osmo-bsc/lchan_fsm.c
9 files changed, 77 insertions(+), 77 deletions(-)



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

diff --git a/include/osmocom/bsc/bss.h b/include/osmocom/bsc/bss.h
index b8945db..199f981 100644
--- a/include/osmocom/bsc/bss.h
+++ b/include/osmocom/bsc/bss.h
@@ -16,5 +16,5 @@
 extern int bts_model_rbs2k_init(void);
 extern int bts_model_nanobts_init(void);
 extern int bts_model_nokia_site_init(void);
-extern int bts_model_sysmobts_init(void);
+extern int bts_model_osmobts_init(void);
 #endif
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index c8cf8b3..f56c0df 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -552,7 +552,7 @@
return 0;
 }

-static inline int is_sysmobts_v2(const struct gsm_bts *bts)
+static inline int is_osmobts(const struct gsm_bts *bts)
 {
switch (bts->type) {
case GSM_BTS_TYPE_OSMOBTS:
diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am
index 49b7890..ca39825 100644
--- a/src/osmo-bsc/Makefile.am
+++ b/src/osmo-bsc/Makefile.am
@@ -53,7 +53,7 @@
bts_nokia_site.c \
bts_siemens_bs11.c \
bts_sm.c \
-   bts_sysmobts.c \
+   bts_osmobts.c \
bts_unknown.c \
chan_alloc.c \
codec_pref.c \
diff --git a/src/osmo-bsc/bsc_ctrl_commands.c b/src/osmo-bsc/bsc_ctrl_commands.c
index 9383167..96aeba2 100644
--- a/src/osmo-bsc/bsc_ctrl_commands.c
+++ b/src/osmo-bsc/bsc_ctrl_commands.c
@@ -102,7 +102,7 @@
 * so let's us just reboot it. For the sysmoBTS we can just
 * restart the process as all state is gone.
 */
-   if (!is_sysmobts_v2(bts) && strcmp(cmd->value, "restart") == 0) 
{
+   if (!is_osmobts(bts) && strcmp(cmd->value, "restart") == 0) {
struct gsm_bts_trx *trx;
llist_for_each_entry_reverse(trx, >trx_list, list)
abis_nm_ipaccess_restart(trx);
diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index eebfc33..5192c49 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -3795,7 +3795,7 @@
 {
struct gsm_bts *bts = vty->index;

-   if (!is_ipaccess_bts(bts) || is_sysmobts_v2(bts)) {
+   if (!is_ipaccess_bts(bts) || is_osmobts(bts)) {
vty_out(vty, "%% This command is only intended for ipaccess 
nanoBTS. See OS#3707.%s",
VTY_NEWLINE);
return CMD_WARNING;
@@ -5764,7 +5764,7 @@
return CMD_WARNING;
}

-   if (!is_ipaccess_bts(bts) || is_sysmobts_v2(bts)) {
+   if (!is_ipaccess_bts(bts) || is_osmobts(bts)) {
vty_out(vty, "%% This command only works for ipaccess 
nanoBTS.%s",
VTY_NEWLINE);
return CMD_WARNING;
diff --git a/src/osmo-bsc/bts_init.c b/src/osmo-bsc/bts_init.c
index 18f1ed4..0e3debc 100644
--- a/src/osmo-bsc/bts_init.c
+++ b/src/osmo-bsc/bts_init.c
@@ -24,7 +24,7 @@
bts_model_rbs2k_init();
bts_model_nanobts_init();
bts_model_nokia_site_init();
-   bts_model_sysmobts_init();
+   bts_model_osmobts_init();
/* Your new BTS here. */
return 0;
 }
diff --git a/src/osmo-bsc/bts_osmobts.c b/src/osmo-bsc/bts_osmobts.c
new file mode 100644
index 000..1814ada
--- /dev/null
+++ b/src/osmo-bsc/bts_osmobts.c
@@ -0,0 +1,69 @@
+/* Osmocom OsmoBTS specific code */
+
+/* (C) 2010-2012 by Harald Welte 
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see 

Change in osmo-bsc[master]: stats: Count transitions from BORKEN state due to LCHAN_EV_TS_ERROR s...

2021-04-04 Thread keith
keith has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18703 )

Change subject: stats: Count transitions from BORKEN state due to 
LCHAN_EV_TS_ERROR signal.
..


Patch Set 4:

Sorry, I pushed to Patchset 3 from the wrong branch.
Patchset 4 is Patchset 2, just rebased.


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ice3379020039dc3634aa3887939740729d720dee
Gerrit-Change-Number: 18703
Gerrit-PatchSet: 4
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: keith 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Sun, 04 Apr 2021 20:10:38 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in ...osmo-python-tests[master]: Use proper python3 shebang in all modules

2021-04-04 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/python/osmo-python-tests/+/23626 )


Change subject: Use proper python3 shebang in all modules
..

Use proper python3 shebang in all modules

Change-Id: I1295be505f4ec30e809297a474b689e6c0cdf505
---
M osmopy/osmo_ipa.py
M osmopy/trap_helper.py
M osmopy/twisted_ipa.py
M scripts/ctrl2cgi.py
M scripts/osmo_rate_ctr2csv.py
M scripts/osmo_trap2cgi.py
M scripts/soap.py
M setup.py
8 files changed, 8 insertions(+), 8 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests 
refs/changes/26/23626/1

diff --git a/osmopy/osmo_ipa.py b/osmopy/osmo_ipa.py
index f957f41..5538d27 100755
--- a/osmopy/osmo_ipa.py
+++ b/osmopy/osmo_ipa.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 # -*- mode: python-mode; py-indent-tabs-mode: nil -*-
 """
 /*
diff --git a/osmopy/trap_helper.py b/osmopy/trap_helper.py
index d942cd2..a48770b 100644
--- a/osmopy/trap_helper.py
+++ b/osmopy/trap_helper.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 # -*- mode: python-mode; py-indent-tabs-mode: nil -*-
 """
 /*
diff --git a/osmopy/twisted_ipa.py b/osmopy/twisted_ipa.py
index 5b65f12..f39bc5c 100755
--- a/osmopy/twisted_ipa.py
+++ b/osmopy/twisted_ipa.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 # -*- mode: python-mode; py-indent-tabs-mode: nil -*-
 """
 /*
diff --git a/scripts/ctrl2cgi.py b/scripts/ctrl2cgi.py
index 95ff788..3e8f87d 100755
--- a/scripts/ctrl2cgi.py
+++ b/scripts/ctrl2cgi.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 # -*- mode: python-mode; py-indent-tabs-mode: nil -*-
 """
 /*
diff --git a/scripts/osmo_rate_ctr2csv.py b/scripts/osmo_rate_ctr2csv.py
index 1e3fc9f..a66fb01 100755
--- a/scripts/osmo_rate_ctr2csv.py
+++ b/scripts/osmo_rate_ctr2csv.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 # -*- mode: python-mode; py-indent-tabs-mode: nil -*-
 """
 /*
diff --git a/scripts/osmo_trap2cgi.py b/scripts/osmo_trap2cgi.py
index ca73fa8..a03fd2b 100755
--- a/scripts/osmo_trap2cgi.py
+++ b/scripts/osmo_trap2cgi.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 # -*- mode: python-mode; py-indent-tabs-mode: nil -*-
 """
 /*
diff --git a/scripts/soap.py b/scripts/soap.py
index 0cb2184..8a5f514 100755
--- a/scripts/soap.py
+++ b/scripts/soap.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 # -*- mode: python-mode; py-indent-tabs-mode: nil -*-
 """
 /*
diff --git a/setup.py b/setup.py
index ab604ce..301420a 100755
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # Osmopython: test utilities for osmocom programs
 # Copyright (C) 2013 Katerina Barone-Adesi kat.o...@gmail.com


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

Gerrit-Project: python/osmo-python-tests
Gerrit-Branch: master
Gerrit-Change-Id: I1295be505f4ec30e809297a474b689e6c0cdf505
Gerrit-Change-Number: 23626
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Change in osmo-bsc[master]: vty: deprecate BTS type 'sysmobts' in favor of 'osmo-bts'

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


Change subject: vty: deprecate BTS type 'sysmobts' in favor of 'osmo-bts'
..

vty: deprecate BTS type 'sysmobts' in favor of 'osmo-bts'

Change-Id: I60d5ff887a7c830180088904c2458f7e73ce3893
---
M doc/examples/osmo-bsc/osmo-bsc-minimal.cfg
M doc/examples/osmo-bsc/osmo-bsc.cfg
M doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
M doc/manuals/chapters/bts.adoc
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts.c
M tests/ctrl/osmo-bsc-neigh-test.cfg
M tests/neighbor_ident.vty
8 files changed, 26 insertions(+), 11 deletions(-)



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

diff --git a/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg 
b/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg
index b8cd78d..2258495 100644
--- a/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg
@@ -2,7 +2,7 @@
  network country code 901
  mobile network code 70
  bts 0
-  type sysmobts
+  type osmo-bts
   band GSM-1800
   location_area_code 23
   ipa unit-id 1800 0
diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg 
b/doc/examples/osmo-bsc/osmo-bsc.cfg
index 828875d..807bd19 100644
--- a/doc/examples/osmo-bsc/osmo-bsc.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc.cfg
@@ -19,7 +19,7 @@
  handover1 maximum distance 
  periodic location update 30
  bts 0
-  type sysmobts
+  type osmo-bts
   band DCS1800
   cell_identity 6969
   location_area_code 1
diff --git a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg 
b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
index 0ecb5fc..335e23d 100644
--- a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
@@ -18,7 +18,7 @@
  handover1 maximum distance 
  periodic location update 30
  bts 0
-  type sysmobts
+  type osmo-bts
   band DCS1800
   cell_identity 0
   location_area_code 1
diff --git a/doc/manuals/chapters/bts.adoc b/doc/manuals/chapters/bts.adoc
index e416775..6ef0a0c 100644
--- a/doc/manuals/chapters/bts.adoc
+++ b/doc/manuals/chapters/bts.adoc
@@ -105,7 +105,7 @@
 
 network
  bts 0
-  type sysmobts
+  type osmo-bts
   band DCS1800
   description The new BTS in Baikonur
   location_area_code 2342
diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 91eaee0..eebfc33 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -2342,6 +2342,20 @@
return CMD_SUCCESS;
 }

+DEFUN_DEPRECATED(cfg_bts_type_sysmobts,
+cfg_bts_type_sysmobts_cmd,
+"type sysmobts",
+"Set the BTS type\n"
+"Deprecated alias for 'osmo-bts'\n")
+{
+   const char *args[] = { "osmo-bts" };
+
+   vty_out(vty, "%% BTS type 'sysmobts' is deprecated, "
+   "use 'type osmo-bts' instead.%s", VTY_NEWLINE);
+
+   return cfg_bts_type(self, vty, 1, args);
+}
+
 DEFUN_USRATTR(cfg_bts_band,
  cfg_bts_band_cmd,
  X(BSC_VTY_ATTR_RESTART_ABIS_OML_LINK),
@@ -7659,6 +7673,7 @@
install_element(GSMNET_NODE, _bts_cmd);
install_node(_node, config_write_bts);
install_element(BTS_NODE, _bts_type_cmd);
+   install_element(BTS_NODE, _bts_type_sysmobts_cmd);
install_element(BTS_NODE, _description_cmd);
install_element(BTS_NODE, _no_description_cmd);
install_element(BTS_NODE, _bts_band_cmd);
diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c
index b5b7136..471829c 100644
--- a/src/osmo-bsc/bts.c
+++ b/src/osmo-bsc/bts.c
@@ -67,7 +67,7 @@
{ GSM_BTS_TYPE_NANOBTS, "nanobts" },
{ GSM_BTS_TYPE_RBS2000, "rbs2000" },
{ GSM_BTS_TYPE_NOKIA_SITE,  "nokia_site" },
-   { GSM_BTS_TYPE_OSMOBTS, "sysmobts" },
+   { GSM_BTS_TYPE_OSMOBTS, "osmo-bts" },
{ 0, NULL }
 };

@@ -77,7 +77,7 @@
{ GSM_BTS_TYPE_NANOBTS, "ip.access nanoBTS or compatible" },
{ GSM_BTS_TYPE_RBS2000, "Ericsson RBS2000 Series" },
{ GSM_BTS_TYPE_NOKIA_SITE,  "Nokia {Metro,Ultra,In}Site" },
-   { GSM_BTS_TYPE_OSMOBTS, "sysmocom sysmoBTS" },
+   { GSM_BTS_TYPE_OSMOBTS, "Osmocom Base Transceiver Station" },
{ 0,NULL }
 };

diff --git a/tests/ctrl/osmo-bsc-neigh-test.cfg 
b/tests/ctrl/osmo-bsc-neigh-test.cfg
index 7ef8271..93d7fca 100644
--- a/tests/ctrl/osmo-bsc-neigh-test.cfg
+++ b/tests/ctrl/osmo-bsc-neigh-test.cfg
@@ -26,7 +26,7 @@
  periodic location update 30
  neighbor-resolution bind 127.0.0.1
  bts 0
-  type sysmobts
+  type osmo-bts
   band DCS1800
   cell_identity 6969
   location_area_code 1
@@ -83,7 +83,7 @@
 phys_chan_config TCH/F
 hopping enabled 0
  bts 1
-  type sysmobts
+  type osmo-bts
   band DCS1800
   cell_identity 123
   location_area_code 1
diff --git a/tests/neighbor_ident.vty b/tests/neighbor_ident.vty
index b1429d8..950d852 100644
--- 

Change in osmo-bsc[master]: stats: Count transitions from BORKEN state due to LCHAN_EV_TS_ERROR s...

2021-04-04 Thread keith
keith has uploaded a new patch set (#4) to the change originally created by 
ipse. ( https://gerrit.osmocom.org/c/osmo-bsc/+/18703 )

Change subject: stats: Count transitions from BORKEN state due to 
LCHAN_EV_TS_ERROR signal.
..

stats: Count transitions from BORKEN state due to LCHAN_EV_TS_ERROR signal.

Change-Id: Ice3379020039dc3634aa3887939740729d720dee
---
M include/osmocom/bsc/bts.h
M src/osmo-bsc/bts.c
M src/osmo-bsc/lchan_fsm.c
3 files changed, 11 insertions(+), 0 deletions(-)


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ice3379020039dc3634aa3887939740729d720dee
Gerrit-Change-Number: 18703
Gerrit-PatchSet: 4
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: keith 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-bsc[master]: stats: Count transitions from BORKEN state due to LCHAN_EV_TS_ERROR s...

2021-04-04 Thread keith
keith has uploaded a new patch set (#3) to the change originally created by 
ipse. ( https://gerrit.osmocom.org/c/osmo-bsc/+/18703 )

Change subject: stats: Count transitions from BORKEN state due to 
LCHAN_EV_TS_ERROR signal.
..

stats: Count transitions from BORKEN state due to LCHAN_EV_TS_ERROR signal.

Change-Id: Ice3379020039dc3634aa3887939740729d720dee
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/lchan_fsm.c
2 files changed, 142 insertions(+), 0 deletions(-)


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ice3379020039dc3634aa3887939740729d720dee
Gerrit-Change-Number: 18703
Gerrit-PatchSet: 3
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: keith 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in simtrace2[master]: cardem: currently simtrace does not support cardem

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

Change subject: cardem: currently simtrace does not support cardem
..

cardem: currently simtrace does not support cardem

the SIMtrace board does not support the current card emulation
application because this uses a timer counter to handle the
timeouts, but on the SIMtrace board this is not connected to the
CLK signal

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

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



diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 8268bcf..1d6ff37 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -28,7 +28,7 @@
 export LD_LIBRARY_PATH="$inst/lib"

 BUILDS=""
-BUILDS+="simtrace/dfu simtrace/cardem simtrace/trace " # simtrace/triple_play
+BUILDS+="simtrace/dfu simtrace/trace "
 BUILDS+="qmod/dfu qmod/cardem "
 BUILDS+="owhw/dfu owhw/cardem "


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Idd09ea534179f0ede705573e1373dbd045c9828a
Gerrit-Change-Number: 23619
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-MessageType: merged


Change in simtrace2[master]: cardem: use USART timeout for waiting time

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

Change subject: cardem: use USART timeout for waiting time
..


Patch Set 1:

(5 comments)

https://gerrit.osmocom.org/c/simtrace2/+/23620/1/firmware/libboard/simtrace/include/board.h
File firmware/libboard/simtrace/include/board.h:

https://gerrit.osmocom.org/c/simtrace2/+/23620/1/firmware/libboard/simtrace/include/board.h@156
PS1, Line 156: #ifdef APPLICATION_trace
I don't like that kind of change.  The goal has always been to move to a 
triple-play firmware.  So this file should define the board's physical 
capabilities, while the application #defines specify which code to include in 
the build.


https://gerrit.osmocom.org/c/simtrace2/+/23620/1/firmware/libcommon/include/tc_etu.h
File firmware/libcommon/include/tc_etu.h:

https://gerrit.osmocom.org/c/simtrace2/+/23620/1/firmware/libcommon/include/tc_etu.h@a11
PS1, Line 11: extern void tc_etu_wtime_expired(void *handle);
this will breaks the tests, as they call the functions.


https://gerrit.osmocom.org/c/simtrace2/+/23620/1/firmware/libcommon/source/mode_cardemu.c
File firmware/libcommon/source/mode_cardemu.c:

https://gerrit.osmocom.org/c/simtrace2/+/23620/1/firmware/libcommon/source/mode_cardemu.c@217
PS1, Line 217: ("%
not sure we want to make this a non-fatal error. Clearly this should never 
happen...


https://gerrit.osmocom.org/c/simtrace2/+/23620/1/firmware/libcommon/source/tc_etu.c
File firmware/libcommon/source/tc_etu.c:

https://gerrit.osmocom.org/c/simtrace2/+/23620/1/firmware/libcommon/source/tc_etu.c@91
PS1, Line 91: card_emu_wt_halfed
see the other comment; the tests need to be updated accordingly.

/usr/bin/ld: 
/space/home/laforge/projects/git/simtrace2/firmware/test/../libcommon/source/card_emu.c:845:
 undefined reference to `card_emu_uart_update_wt'


https://gerrit.osmocom.org/c/simtrace2/+/23620/1/firmware/libosmocore/include/osmocom/core/utils.h
File firmware/libosmocore/include/osmocom/core/utils.h:

https://gerrit.osmocom.org/c/simtrace2/+/23620/1/firmware/libosmocore/include/osmocom/core/utils.h@78
PS1, Line 78:  * \param[in] newstr String that will be copied to newly 
allocated string */
unrelated spelling fixes, should go in separate commit.



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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ibcb2c8cace9137695adf5fb3de43566f7cfb93b5
Gerrit-Change-Number: 23620
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: tsaitgaist 
Gerrit-Comment-Date: Sun, 04 Apr 2021 18:16:14 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in simtrace2[master]: cardem: use USART timeout for waiting time

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

Change subject: cardem: use USART timeout for waiting time
..


Patch Set 1:

(2 comments)

https://gerrit.osmocom.org/c/simtrace2/+/23620/1/firmware/apps/cardem/Makefile
File firmware/apps/cardem/Makefile:

https://gerrit.osmocom.org/c/simtrace2/+/23620/1/firmware/apps/cardem/Makefile@3
PS1, Line 3: tc_etu
tc_etu.c here is only needed for non-simtrace boards.  We should probably 
compile it only conditionally, unless we move away from tc_etu altogether.


https://gerrit.osmocom.org/c/simtrace2/+/23620/1/firmware/apps/cardem/main.c
File firmware/apps/cardem/main.c:

https://gerrit.osmocom.org/c/simtrace2/+/23620/1/firmware/apps/cardem/main.c@168
PS1, Line 168: #if 1
looks like an unrelated change



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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ibcb2c8cace9137695adf5fb3de43566f7cfb93b5
Gerrit-Change-Number: 23620
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: tsaitgaist 
Gerrit-Comment-Date: Sun, 04 Apr 2021 18:09:17 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in simtrace2[master]: cardem: currently simtrace does not support cardem

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

Change subject: cardem: currently simtrace does not support cardem
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Idd09ea534179f0ede705573e1373dbd045c9828a
Gerrit-Change-Number: 23619
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-Comment-Date: Sun, 04 Apr 2021 18:06:58 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: make sim switch board specific

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

Change subject: make sim switch board specific
..


Patch Set 1:

the point here is that not only the type of switch is different, but also its 
functionality.

On simtrace, we have
* one UART connected to the SIM side
* one UART connected to the phone/modem side
* a "SPST" bus-switch to connect both together (basically implementing bypass)

On owhw/qmod, we have
* two UARTs each connected to a phone/modem
* a "SPDT" swithc to route the phone to either "its" UART on the SAM3s, or to 
the physical SIM


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ieaf2ed4761fc3e04f33f9aac5c04a768c9a6f71e
Gerrit-Change-Number: 23618
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: tsaitgaist 
Gerrit-Comment-Date: Sun, 04 Apr 2021 18:06:32 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in simtrace2[master]: cardemu: different init for simtrace board which uses uart timers

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

Change subject: cardemu: different init for simtrace board which uses uart 
timers
..


Patch Set 1:

the goal is probably to move away from the tc_etu for all of the boards. I will 
review this and take it further.

One problem with this patch is that it means tc_etu.o is still required for 
some boards (qemu, owhw) but not  for others (simtrace).


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I464f0ce1ec5e60be5f9377186b7d13a5e6dc637e
Gerrit-Change-Number: 23617
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: tsaitgaist 
Gerrit-Comment-Date: Sun, 04 Apr 2021 18:03:15 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in simtrace2[master]: different voltage comparison on powerup

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

Change subject: different voltage comparison on powerup
..


Patch Set 1:

needs a better description in the commit log. I will work on this.


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I71b703162219484e43638f1f2f692e9dd554ef55
Gerrit-Change-Number: 23616
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: tsaitgaist 
Gerrit-Comment-Date: Sun, 04 Apr 2021 18:02:04 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in simtrace2[master]: minor add comments

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

Change subject: minor add comments
..


Patch Set 1: Code-Review-1

the general coding style in Osmcoom is /* not //, I will re-work this.


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I045286836176da729cc8c863866d6f6aa3836592
Gerrit-Change-Number: 23615
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-Comment-Date: Sun, 04 Apr 2021 18:01:21 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: rename PIN_PHONE_IO to PIN_USIM1_IO

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

Change subject: rename PIN_PHONE_IO to PIN_USIM1_IO
..


Patch Set 1:

IMHO it doesn't make sense to rename only the IO pin but keep the "PHONE" name 
for the CLK and other #defines in that same file.

Furthermore, there's of course always the rationale to keep naming as close as 
possible to the naming in the schematics.

So in general, I'm not sure if we want to merge it. But if we do, then we want 
all PHONE to be renamed.


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I486b14260faec897e8c8698c4b7987bf36492497
Gerrit-Change-Number: 23614
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: tsaitgaist 
Gerrit-Comment-Date: Sun, 04 Apr 2021 18:00:43 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in simtrace2[master]: add ISO 7816-3 library to remsim project

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

Change subject: add ISO 7816-3 library to remsim project
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I99f3fecbc00d2379c3a6dc457b047c6fee41c292
Gerrit-Change-Number: 23613
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-Comment-Date: Sun, 04 Apr 2021 17:58:09 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: cardem: choose a more reasonable default ATR

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

Change subject: cardem: choose a more reasonable default ATR
..

cardem: choose a more reasonable default ATR

PCSCd does not like invalid ATRs

Change-Id: I1eebfdc06be55931c2e80e2b515ac3a559737c38
---
M firmware/libcommon/source/card_emu.c
M host/src/simtrace2-cardem-pcsc.c
2 files changed, 38 insertions(+), 3 deletions(-)

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



diff --git a/firmware/libcommon/source/card_emu.c 
b/firmware/libcommon/source/card_emu.c
index cad24b8..269c7c6 100644
--- a/firmware/libcommon/source/card_emu.c
+++ b/firmware/libcommon/source/card_emu.c
@@ -1179,8 +1179,23 @@
}
 }

-/* shortest ATR possible (uses default speed and no options) */
-static const uint8_t default_atr[] = { 0x3B, 0x00 };
+/* reasonable ATR offering all protocols and voltages
+ * smartphones might not care, but other readers do
+ *
+ * TS =0x3BDirect Convention
+ * T0 =0x80Y(1): b1000, K: 0 (historical bytes)
+ * TD(1) = 0x80Y(i+1) = b1000, Protocol T=0
+ * 
+ * TD(2) = 0x81Y(i+1) = b1000, Protocol T=1
+ * 
+ * TD(3) = 0x1FY(i+1) = b0001, Protocol T=15
+ * 
+ * TA(4) = 0xC7Clock stop: no preference - Class accepted by the card: 
(3G) A 5V B 3V C 1.8V
+ * 
+ * Historical bytes
+ * TCK =   0x59correct checksum
+ */
+static const uint8_t default_atr[] = { 0x3B, 0x80, 0x80, 0x81 , 0x1F, 0xC7, 
0x59 };

 static struct card_handle card_handles[NUM_SLOTS];

diff --git a/host/src/simtrace2-cardem-pcsc.c b/host/src/simtrace2-cardem-pcsc.c
index 883bad1..f11330c 100644
--- a/host/src/simtrace2-cardem-pcsc.c
+++ b/host/src/simtrace2-cardem-pcsc.c
@@ -52,6 +52,26 @@

 #define ATR_MAX_LEN 33

+
+/* reasonable ATR offering all protocols and voltages
+ * smartphones might not care, but other readers do
+ *
+ * TS =0x3BDirect Convention
+ * T0 =0x80Y(1): b1000, K: 0 (historical bytes)
+ * TD(1) = 0x80Y(i+1) = b1000, Protocol T=0
+ * 
+ * TD(2) = 0x81Y(i+1) = b1000, Protocol T=1
+ * 
+ * TD(3) = 0x1FY(i+1) = b0001, Protocol T=15
+ * 
+ * TA(4) = 0xC7Clock stop: no preference - Class accepted by the card: 
(3G) A 5V B 3V C 1.8V
+ * 
+ * Historical bytes
+ * TCK =   0x59correct checksum
+ */
+#define DEFAULT_ATR_STR "3B8080811FC759"
+
+
 static void atr_update_csum(uint8_t *atr, unsigned int atr_len)
 {
uint8_t csum = 0;
@@ -274,7 +294,7 @@
int rc;
int c, ret = 1;
int skip_atr = 0;
-   char *atr = "3b00";
+   char *atr = DEFAULT_ATR_STR;
uint8_t real_atr[ATR_MAX_LEN];
int atr_len;
int keep_running = 0;

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I1eebfdc06be55931c2e80e2b515ac3a559737c38
Gerrit-Change-Number: 23611
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Hoernchen 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in simtrace2[master]: cardem: choose a more reasonable default ATR

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

Change subject: cardem: choose a more reasonable default ATR
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I1eebfdc06be55931c2e80e2b515ac3a559737c38
Gerrit-Change-Number: 23611
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Hoernchen 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Sun, 04 Apr 2021 17:56:31 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: cardem: choose a more reasonable default ATR

2021-04-04 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/23611 )

Change subject: cardem: choose a more reasonable default ATR
..


Patch Set 2: Code-Review+1

Looks good to me now.


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I1eebfdc06be55931c2e80e2b515ac3a559737c38
Gerrit-Change-Number: 23611
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Hoernchen 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Comment-Date: Sun, 04 Apr 2021 17:56:15 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: bts_osmobts: update the list of supported features

2021-04-04 Thread fixeria
fixeria has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18617 )

Change subject: bts_osmobts: update the list of supported features
..


Abandoned

Ok, I see. This change is just a result of my misunderstanding.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18617
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I431c8ab9478cbc40179903edc21043623d805da1
Gerrit-Change-Number: 18617
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge 
Gerrit-MessageType: abandon


Change in simtrace2[master]: cardem: choose a more reasonable default ATR

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

Change subject: cardem: choose a more reasonable default ATR
..


Patch Set 1:

(2 comments)

https://gerrit.osmocom.org/c/simtrace2/+/23611/1/firmware/libcommon/source/card_emu.c
File firmware/libcommon/source/card_emu.c:

https://gerrit.osmocom.org/c/simtrace2/+/23611/1/firmware/libcommon/source/card_emu.c@1199
PS1, Line 1199: 0x59};
> missing space
Done


https://gerrit.osmocom.org/c/simtrace2/+/23611/1/host/src/simtrace2-cardem-pcsc.c
File host/src/simtrace2-cardem-pcsc.c:

https://gerrit.osmocom.org/c/simtrace2/+/23611/1/host/src/simtrace2-cardem-pcsc.c@56
PS1, Line 56: reasonable ATR offering all protocols and voltages
> Weird comment formatting. I would prefer to have it consistent with the GPL 
> license header.
Done



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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I1eebfdc06be55931c2e80e2b515ac3a559737c38
Gerrit-Change-Number: 23611
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Hoernchen 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria 
Gerrit-Comment-Date: Sun, 04 Apr 2021 17:55:00 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


Change in simtrace2[master]: cardem: ensure VCC_PHONE is floating

2021-04-04 Thread laforge
Hello tsaitgaist,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: cardem: ensure VCC_PHONE is floating
..

cardem: ensure VCC_PHONE is floating

this change is mainly relevant for the SIMtrace board, but also
affects the others.
First we ensure VCC_PHONE is not forwarded to VCC_SIM because the
card could affect the signal (card could draw too much current or
feed back current in).
next we disable VCC_SIM. the card slot does not need to be
powered, and the FPF2019 leaks current back to VCC_PHONE, even
with forwarding disabled (the reverse current protection only
kicks in when VCC_PHONE is briefly shorted to ground, but still
leaks 0.6V).
enable the ADC channels normally used to measure VCC, even if
not used. the dedicated ADC pins leak current when left
unconfigured. enabling them puts them in high impedance.

Change-Id: If1487c1c191838aaa08b654e49cd31c7180ffc19

XX pin reconfig

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



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/21/23621/1

diff --git a/firmware/libboard/simtrace/include/board.h 
b/firmware/libboard/simtrace/include/board.h
index 65e6197..bdc1eb7 100644
--- a/firmware/libboard/simtrace/include/board.h
+++ b/firmware/libboard/simtrace/include/board.h
@@ -120,6 +120,14 @@
 /* ISO7816-communication related pins */
 #define PINS_ISO7816PIN_SIM_IO,  PIN_SIM_CLK,  PIN_ISO7816_RSTMC 
// SIM_PWEN_PIN, PIN_SIM_IO2, PIN_SIM_CLK2

+/** card emulation configuration */
+/* Disable power converter 4.5-6V to 3.3V (active high) */
+#define PIN_SIM_PWEN_CARDEMU   {PIO_PA5, PIOA, ID_PIOA, PIO_OUTPUT_0, 
PIO_DEFAULT}
+/* Disable power switch to forward VCC_PHONE to VCC_SIM (active high) */
+#define PIN_VCC_FWD_CARDEMU{PIO_PA26, PIOA, ID_PIOA, PIO_OUTPUT_0, 
PIO_DEFAULT}
+/* Disable power to SIM */
+#define PINS_PWR_CARDEMUPIN_SIM_PWEN_CARDEMU, PIN_VCC_FWD_CARDEMU
+
 /** External SPI flash interface   **/
 /* SPI MISO pin definition */
 #define PIN_SPI_MISO  {PIO_PA12A_MISO, PIOA, PIOA, PIO_PERIPH_A, PIO_PULLUP}
diff --git a/firmware/libcommon/source/mode_cardemu.c 
b/firmware/libcommon/source/mode_cardemu.c
index 32d3b17..50fe668 100644
--- a/firmware/libcommon/source/mode_cardemu.c
+++ b/firmware/libcommon/source/mode_cardemu.c
@@ -546,12 +546,20 @@

TRACE_ENTRY();

+#ifdef PINS_PWR_CARDEMU
+   // enable power on required peripherals, else disable
+   Pin pins_pwr_cardemu[] = { PINS_PWR_CARDEMU };
+   PIO_Configure(pins_pwr_cardemu, PIO_LISTSIZE(pins_pwr_cardemu));
+#endif /* PINS_PWR_CARDEMU */
 #ifdef PINS_CARDSIM
PIO_Configure(pins_cardsim, PIO_LISTSIZE(pins_cardsim));
 #endif
+   // ADC channel 6 and 7 are used to measure VCC (else they are grounded)
+   ADC->ADC_CHER |= ADC_CHER_CH6 | ADC_CHER_CH7; // enable the ADC 
channels to put them in high impedance (else they leak current)
 #ifdef DETECT_VCC_BY_ADC
-   card_vcc_adc_init();
+   card_vcc_adc_init(); // configure the ADC to measure VCC
 #endif /* DETECT_VCC_BY_ADC */
+   // TODO pull SIMtrace board SIM lines low, else they can leak current 
back to VCC

INIT_LLIST_HEAD(_inst[0].usb_out_queue);
rbuf_reset(_inst[0].rb);

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ib261073e3779ae7d98de18ce78b34ff37eafeaa2
Gerrit-Change-Number: 23621
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-MessageType: newchange


Change in simtrace2[master]: cardem: fix TPDU state check

2021-04-04 Thread laforge
Hello tsaitgaist,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: cardem: fix TPDU state check
..

cardem: fix TPDU state check

this change allows to initialize the TPDU state while in
ISO_S_WAIT_TPDU, before actually entering ISO_S_TPDU

Change-Id: I505d3add32a43de31499b800bc53442f99f65931
---
M firmware/libcommon/source/card_emu.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/22/23622/1

diff --git a/firmware/libcommon/source/card_emu.c 
b/firmware/libcommon/source/card_emu.c
index fb532d5..259d48e 100644
--- a/firmware/libcommon/source/card_emu.c
+++ b/firmware/libcommon/source/card_emu.c
@@ -826,7 +826,7 @@
 {
if (ch->tpdu.state == new_ts)
return;
-   if (ISO_S_IN_TPDU != ch->state) {
+   if (ISO_S_IN_TPDU != ch->state && ISO_S_WAIT_TPDU != ch->state) {
TRACE_ERROR("%u: setting TPDU state in %s state\r\n", ch->num,
get_value_string(iso7816_3_card_state_names, 
ch->state));
}

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I505d3add32a43de31499b800bc53442f99f65931
Gerrit-Change-Number: 23622
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-CC: Jenkins Builder
Gerrit-MessageType: newchange


Change in simtrace2[master]: Revert "cardem: disable upload for simtrace2"

2021-04-04 Thread laforge
Hello Hoernchen,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: Revert "cardem: disable upload for simtrace2"
..

Revert "cardem: disable upload for simtrace2"

This reverts commit baa62777c845c3466fae5d80729e6b2bd754eea8.
cardem w/ simtrae board should now work.

Change-Id: I1bce9a57ad2960695c31b8879f5d4ded27bc
---
M contrib/jenkins.sh
1 file changed, 0 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/24/23624/1

diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 3f2eb7e..f3e13c0 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -63,8 +63,6 @@
 #  make -C "$base/doc/manuals" publish
 #fi

-rm -rf $TOPDIR/firmware/bin/simtrace-cardem*
-
 if [ "x$publish" = "x--publish" ]; then
echo
echo "=== UPLOAD BUILD  =="

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I1bce9a57ad2960695c31b8879f5d4ded27bc
Gerrit-Change-Number: 23624
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Hoernchen 
Gerrit-CC: Jenkins Builder
Gerrit-MessageType: newchange


Change in simtrace2[master]: cardem: ignore set ATR

2021-04-04 Thread laforge
Hello tsaitgaist,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: cardem: ignore set ATR
..

cardem: ignore set ATR

the PPS procedure with baud rate change has not been tested.
by keeping the default ATR instead of applying the ATR sent by
the host software, no other baud rate choice is offered.

Change-Id: Ibf7c6b83d2cf68172c7aa25116d838e24a95d5fe
---
M firmware/libcommon/source/card_emu.c
1 file changed, 4 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/23/23623/1

diff --git a/firmware/libcommon/source/card_emu.c 
b/firmware/libcommon/source/card_emu.c
index 259d48e..f84f334 100644
--- a/firmware/libcommon/source/card_emu.c
+++ b/firmware/libcommon/source/card_emu.c
@@ -1238,17 +1238,20 @@
if (len > sizeof(ch->atr.atr))
return -1;

+/* ignore new ATR for now since we PPS has not been tested
memcpy(ch->atr.atr, atr, len);
ch->atr.len = len;
ch->atr.idx = 0;
+*/

 #if TRACE_LEVEL >= TRACE_LEVEL_INFO
uint8_t i;
TRACE_INFO("%u: ATR set: ", ch->num);
-   for (i = 0; i < ch->atr.len; i++) {
+   for (i = 0; i < len; i++) {
TRACE_INFO_WP("%02x ", atr[i]);
}
TRACE_INFO_WP("\n\r");
+   TRACE_INFO("%u: ATR set currently ignored\n\r", ch->num);
 #endif
/* FIXME: race condition with transmitting ATR to reader? */


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ibf7c6b83d2cf68172c7aa25116d838e24a95d5fe
Gerrit-Change-Number: 23623
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-CC: Jenkins Builder
Gerrit-MessageType: newchange


Change in simtrace2[master]: cardem: currently simtrace does not support cardem

2021-04-04 Thread laforge
Hello tsaitgaist,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: cardem: currently simtrace does not support cardem
..

cardem: currently simtrace does not support cardem

the SIMtrace board does not support the current card emulation
application because this uses a timer counter to handle the
timeouts, but on the SIMtrace board this is not connected to the
CLK signal

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



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/19/23619/1

diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 8268bcf..1d6ff37 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -28,7 +28,7 @@
 export LD_LIBRARY_PATH="$inst/lib"

 BUILDS=""
-BUILDS+="simtrace/dfu simtrace/cardem simtrace/trace " # simtrace/triple_play
+BUILDS+="simtrace/dfu simtrace/trace "
 BUILDS+="qmod/dfu qmod/cardem "
 BUILDS+="owhw/dfu owhw/cardem "


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Idd09ea534179f0ede705573e1373dbd045c9828a
Gerrit-Change-Number: 23619
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-MessageType: newchange


Change in simtrace2[master]: cardem: use USART timeout for waiting time

2021-04-04 Thread laforge
Hello tsaitgaist,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: cardem: use USART timeout for waiting time
..

cardem: use USART timeout for waiting time

the reset/ATR handling has been heavily updated/fixed.
instead of using the timer counter peripheral to handle
the waiting time and corresponding timeout, the USART peripheral
internal timeout mechanism is used.
this is particularly important for the SIMtrace board since the
clock signal is not connected to the timer counter.
thus this change adds card emulation support for SIMtrace boards.

Fi and Di have been properly rename to F and D since the "i"
stands only for an "indicated" value, not the actual value.
this does not change the USB protocol (the variable have just been
renamed).
additional variables store more information about the card
capabilities

NOTE: it has only be tested for the SIMtrace board

Change-Id: Ibcb2c8cace9137695adf5fb3de43566f7cfb93b5
---
M contrib/jenkins.sh
M firmware/apps/cardem/Makefile
M firmware/apps/cardem/main.c
M firmware/apps/trace/Makefile
M firmware/libboard/qmod/include/board.h
M firmware/libboard/simtrace/include/board.h
M firmware/libcommon/include/card_emu.h
M firmware/libcommon/include/simtrace_prot.h
M firmware/libcommon/include/tc_etu.h
M firmware/libcommon/source/card_emu.c
M firmware/libcommon/source/mode_cardemu.c
M firmware/libcommon/source/tc_etu.c
M firmware/libosmocore/include/osmocom/core/utils.h
M host/src/simtrace2-cardem-pcsc.c
14 files changed, 365 insertions(+), 66 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/20/23620/1

diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 1d6ff37..3f2eb7e 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -28,7 +28,7 @@
 export LD_LIBRARY_PATH="$inst/lib"

 BUILDS=""
-BUILDS+="simtrace/dfu simtrace/trace "
+BUILDS+="simtrace/dfu simtrace/trace simtrace/cardem "
 BUILDS+="qmod/dfu qmod/cardem "
 BUILDS+="owhw/dfu owhw/cardem "

diff --git a/firmware/apps/cardem/Makefile b/firmware/apps/cardem/Makefile
index d5f68a5..d2039a5 100644
--- a/firmware/apps/cardem/Makefile
+++ b/firmware/apps/cardem/Makefile
@@ -1,3 +1,3 @@
 C_FILES += $(C_LIBUSB_RT)

-C_FILES += card_emu.c cciddriver.c iso7816_3.c iso7816_4.c iso7816_fidi.c 
mitm.c mode_cardemu.c mode_ccid.c simtrace_iso7816.c sniffer.c tc_etu.c usb.c
+C_FILES += card_emu.c iso7816_fidi.c iso7816_3.c iso7816_4.c mode_cardemu.c 
simtrace_iso7816.c tc_etu.c usb.c
diff --git a/firmware/apps/cardem/main.c b/firmware/apps/cardem/main.c
index a30a211..e1ab8fb 100644
--- a/firmware/apps/cardem/main.c
+++ b/firmware/apps/cardem/main.c
@@ -165,7 +165,7 @@
while (USBD_GetState() < USBD_STATE_CONFIGURED) {
WDT_Restart(WDT);
check_exec_dbg_cmd();
-#if 0
+#if 1
if (i >= MAX_USB_ITER * 3) {
TRACE_ERROR("Resetting board (USB could "
"not be configured)\n\r");
diff --git a/firmware/apps/trace/Makefile b/firmware/apps/trace/Makefile
index 75c43e8..ddea898 100644
--- a/firmware/apps/trace/Makefile
+++ b/firmware/apps/trace/Makefile
@@ -1,3 +1,3 @@
 C_FILES += $(C_LIBUSB_RT)

-C_FILES += card_emu.c cciddriver.c iso7816_4.c iso7816_fidi.c mitm.c 
mode_cardemu.c mode_ccid.c simtrace_iso7816.c sniffer.c tc_etu.c usb.c
+C_FILES += iso7816_4.c iso7816_fidi.c simtrace_iso7816.c sniffer.c usb.c
diff --git a/firmware/libboard/qmod/include/board.h 
b/firmware/libboard/qmod/include/board.h
index 5165434..6f95d12 100644
--- a/firmware/libboard/qmod/include/board.h
+++ b/firmware/libboard/qmod/include/board.h
@@ -111,4 +111,7 @@
 #define CARDEMU_SECOND_UART
 #define DETECT_VCC_BY_ADC

+/** sysmoQMOD only supports card emulation */
+#ifdef APPLICATION_cardem
 #define HAVE_CARDEM
+#endif
diff --git a/firmware/libboard/simtrace/include/board.h 
b/firmware/libboard/simtrace/include/board.h
index 5302c8b..65e6197 100644
--- a/firmware/libboard/simtrace/include/board.h
+++ b/firmware/libboard/simtrace/include/board.h
@@ -153,10 +153,18 @@

 /** Supported modes */
 /* SIMtrace board supports sniffer mode */
+#ifdef APPLICATION_trace
 #define HAVE_SNIFFER
+#endif
 /* SIMtrace board supports CCID mode */
+#ifdef APPLICATION_ccid
 //#define HAVE_CCID
+#endif
 /* SIMtrace board supports card emulation mode */
-//#define HAVE_CARDEM
+#ifdef APPLICATION_cardem
+#define HAVE_CARDEM
+#endif
 /* SIMtrace board supports man-in-the-middle mode */
+#ifdef APPLICATION_mitm
 //#define HAVE_MITM
+#endif
diff --git a/firmware/libcommon/include/card_emu.h 
b/firmware/libcommon/include/card_emu.h
index 8a73d5c..494d1e6 100644
--- a/firmware/libcommon/include/card_emu.h
+++ b/firmware/libcommon/include/card_emu.h
@@ -58,10 +58,43 @@
 void card_emu_have_new_uart_tx(struct card_handle *ch);
 void card_emu_report_status(struct card_handle *ch, 

Change in simtrace2[master]: make sim switch board specific

2021-04-04 Thread laforge
Hello tsaitgaist,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: make sim switch board specific
..

make sim switch board specific

the simtrace board uses a bus switch not used on qmod and owhw to
switch the SIM between physical and virtual

Change-Id: Ieaf2ed4761fc3e04f33f9aac5c04a768c9a6f71e
---
M firmware/libboard/common/include/sim_switch.h
R firmware/libboard/owhw/source/sim_switch.c
C firmware/libboard/qmod/source/sim_switch.c
A firmware/libboard/simtrace/source/sim_switch.c
4 files changed, 71 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/18/23618/1

diff --git a/firmware/libboard/common/include/sim_switch.h 
b/firmware/libboard/common/include/sim_switch.h
index 3d131f2..4439fa5 100644
--- a/firmware/libboard/common/include/sim_switch.h
+++ b/firmware/libboard/common/include/sim_switch.h
@@ -14,5 +14,13 @@
  */
 #pragma once

+/** switch card lines to use physical or emulated card
+ *  @param[in] nr card interface number (i.e. slot)
+ *  @param[in] physical which physical interface to switch to (e.g. 0: 
physical, 1: virtual)
+ *  @return 0 on success, negative else
+ */
 int sim_switch_use_physical(unsigned int nr, int physical);
+/** initialise card switching capabilities
+ *  @return number of switchable card interfaces
+ */
 int sim_switch_init(void);
diff --git a/firmware/libboard/common/source/sim_switch.c 
b/firmware/libboard/owhw/source/sim_switch.c
similarity index 100%
rename from firmware/libboard/common/source/sim_switch.c
rename to firmware/libboard/owhw/source/sim_switch.c
diff --git a/firmware/libboard/common/source/sim_switch.c 
b/firmware/libboard/qmod/source/sim_switch.c
similarity index 100%
copy from firmware/libboard/common/source/sim_switch.c
copy to firmware/libboard/qmod/source/sim_switch.c
diff --git a/firmware/libboard/simtrace/source/sim_switch.c 
b/firmware/libboard/simtrace/source/sim_switch.c
new file mode 100644
index 000..38886b1
--- /dev/null
+++ b/firmware/libboard/simtrace/source/sim_switch.c
@@ -0,0 +1,63 @@
+/* Code to switch between local (physical) and remote (emulated) SIM
+ *
+ * (C) 2015-2017 by Harald Welte 
+ * (C) 2018, sysmocom -s.f.m.c. GmbH, Author: Kevin Redon 
+ *
+ * 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; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA
+ */
+#include "board.h"
+#include "trace.h"
+#include "led.h"
+#include "sim_switch.h"
+
+#ifdef PIN_SIM_SWITCH1
+static const Pin pin_conn_usim1 = {PIO_PA20, PIOA, ID_PIOA, PIO_OUTPUT_0, 
PIO_DEFAULT};
+#endif
+#ifdef PIN_SIM_SWITCH2
+static const Pin pin_conn_usim2 = {PIO_PA28, PIOA, ID_PIOA, PIO_OUTPUT_0, 
PIO_DEFAULT};
+#endif
+
+static int initialized = 0;
+
+int sim_switch_use_physical(unsigned int nr, int physical)
+{
+   const Pin pin_sc = PIN_SC_SW_DEFAULT; // pin to control bus switch for 
VCC/RST/CLK signals
+   const Pin pin_io = PIN_IO_SW_DEFAULT; // pin to control bus switch for 
I/O signal
+
+   if (nr > 0) {
+   TRACE_ERROR("SIM interface for Modem %d can't be switched\r\n", 
nr);
+   return -1;
+   }
+
+   TRACE_INFO("Modem %u: %s SIM\n\r", nr, physical ? "physical" : 
"virtual");
+
+   if (physical) {
+   TRACE_INFO("%u: Use local/physical SIM\r\n", nr);
+   PIO_Set(_sc);
+   PIO_Set(_io);
+   } else {
+   TRACE_INFO("%u: Use remote/emulated SIM\r\n", nr);
+   PIO_Clear(_sc);
+   PIO_Clear(_io);
+   }
+
+   return 0;
+}
+
+int sim_switch_init(void)
+{
+   // the bus switch is already initialised
+   return 1; // SIMtrace hardware has only one switchable interface
+}

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ieaf2ed4761fc3e04f33f9aac5c04a768c9a6f71e
Gerrit-Change-Number: 23618
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-MessageType: newchange


Change in simtrace2[master]: different voltage comparison on powerup

2021-04-04 Thread laforge
Hello tsaitgaist,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: different voltage comparison on powerup
..

different voltage comparison on powerup

Change-Id: I71b703162219484e43638f1f2f692e9dd554ef55
---
M firmware/libcommon/source/mode_cardemu.c
1 file changed, 8 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/16/23616/1

diff --git a/firmware/libcommon/source/mode_cardemu.c 
b/firmware/libcommon/source/mode_cardemu.c
index 7a37317..1dbd2d3 100644
--- a/firmware/libcommon/source/mode_cardemu.c
+++ b/firmware/libcommon/source/mode_cardemu.c
@@ -62,6 +62,7 @@
const Pin pin_insert;
 #ifdef DETECT_VCC_BY_ADC
uint32_t vcc_uv;
+   uint32_t vcc_uv_last;
 #endif
bool vcc_active;
bool vcc_active_last;
@@ -197,6 +198,7 @@
 /* FIXME: integrate this with actual irq handler */
 static void usart_irq_rx(uint8_t inst_num)
 {
+   OSMO_ASSERT(inst_num < ARRAY_SIZE(cardem_inst));
Usart *usart = get_usart_by_chan(inst_num);
struct cardem_inst *ci = _inst[inst_num];
uint32_t csr;
@@ -319,10 +321,14 @@

 static void process_vcc_adc(struct cardem_inst *ci)
 {
-   if (ci->vcc_uv >= VCC_UV_THRESH_3V)
+   if (ci->vcc_uv >= VCC_UV_THRESH_3V &&
+   ci->vcc_uv_last < VCC_UV_THRESH_3V) {
ci->vcc_active = true;
-   else
+   } else if (ci->vcc_uv < VCC_UV_THRESH_3V &&
+ci->vcc_uv_last >= VCC_UV_THRESH_3V) {
ci->vcc_active = false;
+   }
+   ci->vcc_uv_last = ci->vcc_uv;
 }

 void ADC_IrqHandler(void)

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I71b703162219484e43638f1f2f692e9dd554ef55
Gerrit-Change-Number: 23616
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-MessageType: newchange


Change in simtrace2[master]: cardemu: different init for simtrace board which uses uart timers

2021-04-04 Thread laforge
Hello tsaitgaist,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: cardemu: different init for simtrace board which uses uart 
timers
..

cardemu: different init for simtrace board which uses uart timers

Change-Id: I464f0ce1ec5e60be5f9377186b7d13a5e6dc637e
---
M firmware/libcommon/source/mode_cardemu.c
1 file changed, 13 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/17/23617/1

diff --git a/firmware/libcommon/source/mode_cardemu.c 
b/firmware/libcommon/source/mode_cardemu.c
index 1dbd2d3..c6c129d 100644
--- a/firmware/libcommon/source/mode_cardemu.c
+++ b/firmware/libcommon/source/mode_cardemu.c
@@ -429,7 +429,20 @@

/* configure USART as ISO-7816 slave (e.g. card) */
ISO7816_Init(_inst[0].usart_info, CLK_SLAVE);
+#ifdef BOARD_simtrace
+   /* simtrace board uses uart timeouts */
+
+   /*  don't use receive timeout timer for now */
+   cardem_inst[0].usart_info.base->US_RTOR = 0;
+   /* enable interrupts to indicate when data has been received or timeout 
occurred */
+   USART_EnableIt(cardem_inst[0].usart_info.base, US_IER_RXRDY | 
US_IER_TIMEOUT);
+#else
+   /* enable interrupts to indicate when data has been received */
+   USART_EnableIt(cardem_inst[0].usart_info.base, US_IER_RXRDY );
+#endif
+   /*  enable interrupt requests for the USART peripheral */
NVIC_EnableIRQ(USART1_IRQn);
+
PIO_ConfigureIt(_usim1_rst, usim1_rst_irqhandler);
PIO_EnableIt(_usim1_rst);


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I464f0ce1ec5e60be5f9377186b7d13a5e6dc637e
Gerrit-Change-Number: 23617
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-MessageType: newchange


Change in simtrace2[master]: minor add comments

2021-04-04 Thread laforge
Hello tsaitgaist,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: minor add comments
..

minor add comments

this is just to better understand the flow

Change-Id: I045286836176da729cc8c863866d6f6aa3836592
---
M firmware/libcommon/source/mode_cardemu.c
1 file changed, 24 insertions(+), 15 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/15/23615/1

diff --git a/firmware/libcommon/source/mode_cardemu.c 
b/firmware/libcommon/source/mode_cardemu.c
index 6a8d98f..7a37317 100644
--- a/firmware/libcommon/source/mode_cardemu.c
+++ b/firmware/libcommon/source/mode_cardemu.c
@@ -1,7 +1,7 @@
 /* card emulation mode
  *
  * (C) 2015-2017 by Harald Welte 
- * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon 

+ * (C) 2018-2019 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon 

  *
  * 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
@@ -202,32 +202,33 @@
uint32_t csr;
uint8_t byte = 0;

-   csr = usart->US_CSR & usart->US_IMR;
+   csr = usart->US_CSR & usart->US_IMR; // save state/flags before they 
get changed
 
-   if (csr & US_CSR_RXRDY) {
-   byte = (usart->US_RHR) & 0xFF;
-   if (rbuf_write(>rb, byte) < 0)
-   TRACE_ERROR("rbuf overrun\r\n");
+   if (csr & US_CSR_RXRDY) { // bytes has been received
+   byte = (usart->US_RHR) & 0xFF; // ready out byte
+   if (rbuf_write(>rb, byte) < 0) // store byte in buffer
+   TRACE_ERROR("rbuf overrun\r\n"); // error if could not 
store in buffer
}

-   if (csr & US_CSR_TXRDY) {
-   if (card_emu_tx_byte(ci->ch) == 0)
-   USART_DisableIt(usart, US_IER_TXRDY);
+   if (csr & US_CSR_TXRDY) { // ready to transmit the next byte
+   if (card_emu_tx_byte(ci->ch) == 0) // transmit next byte, and 
check if a byte is being transmitted
+   USART_DisableIt(usart, US_IER_TXRDY); // stop the TX 
ready signal if not byte has been transmitted
}

-   if (csr & (US_CSR_OVRE|US_CSR_FRAME|US_CSR_PARE|
-  US_CSR_TIMEOUT|US_CSR_NACK|(1<<10))) {
-   usart->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK;
-   TRACE_ERROR("%u e 0x%x st: 0x%lx\n", ci->num, byte, csr);
+   if (csr & 
(US_CSR_OVRE|US_CSR_FRAME|US_CSR_PARE|US_CSR_TIMEOUT|US_CSR_NACK|(1<<10))) { // 
error flag set
+   usart->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; // 
reset UART state to clear flag
+   TRACE_ERROR("%u USART error on 0x%x status: 0x%lx\n", ci->num, 
byte, csr); // warn user about error
}
 }

+/*! ISR called for USART0 */
 void mode_cardemu_usart0_irq(void)
 {
/* USART0 == Instance 1 == USIM 2 */
usart_irq_rx(1);
 }

+/*! ISR called for USART1 */
 void mode_cardemu_usart1_irq(void)
 {
/* USART1 == Instance 0 == USIM 1 */
@@ -419,15 +420,21 @@
INIT_LLIST_HEAD(_inst[0].usb_out_queue);
rbuf_reset(_inst[0].rb);
PIO_Configure(pins_usim1, PIO_LISTSIZE(pins_usim1));
+
+   /* configure USART as ISO-7816 slave (e.g. card) */
ISO7816_Init(_inst[0].usart_info, CLK_SLAVE);
NVIC_EnableIRQ(USART1_IRQn);
PIO_ConfigureIt(_usim1_rst, usim1_rst_irqhandler);
PIO_EnableIt(_usim1_rst);
-   usim1_rst_irqhandler(_usim1_rst); /* obtain current RST state */
+
+   /* obtain current RST state */
+   usim1_rst_irqhandler(_usim1_rst);
 #ifndef DETECT_VCC_BY_ADC
PIO_ConfigureIt(_usim1_vcc, usim1_vcc_irqhandler);
PIO_EnableIt(_usim1_vcc);
-   usim1_vcc_irqhandler(_usim1_vcc); /* obtain current VCC state */
+
+   /* obtain current VCC state */
+   usim1_vcc_irqhandler(_usim1_vcc);
 #else
do {} while (!adc_triggered); /* wait for first ADC reading */
 #endif /* DETECT_VCC_BY_ADC */
@@ -442,6 +449,7 @@
rbuf_reset(_inst[1].rb);
PIO_Configure(pins_usim2, PIO_LISTSIZE(pins_usim2));
ISO7816_Init(_inst[1].usart_info, CLK_SLAVE);
+   // TODO enable timeout
NVIC_EnableIRQ(USART0_IRQn);
PIO_ConfigureIt(_usim2_rst, usim2_rst_irqhandler);
PIO_EnableIt(_usim2_rst);
@@ -458,6 +466,7 @@
  SIMTRACE_CARDEM_USB_EP_USIM2_INT, 
cardem_inst[1].vcc_active,
  cardem_inst[1].rst_active, 
cardem_inst[1].vcc_active);
sim_switch_use_physical(1, 1);
+   // TODO check rst and vcc
 #endif /* CARDEMU_SECOND_UART */
 }


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

Gerrit-Project: simtrace2
Gerrit-Branch: 

Change in simtrace2[master]: rename PIN_PHONE_IO to PIN_USIM1_IO

2021-04-04 Thread laforge
Hello tsaitgaist,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: rename PIN_PHONE_IO to PIN_USIM1_IO
..

rename PIN_PHONE_IO to PIN_USIM1_IO

this matches the naming scheme used for USIM2

Change-Id: I486b14260faec897e8c8698c4b7987bf36492497
---
M firmware/libboard/simtrace/include/board.h
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/14/23614/1

diff --git a/firmware/libboard/simtrace/include/board.h 
b/firmware/libboard/simtrace/include/board.h
index 35c9426..5302c8b 100644
--- a/firmware/libboard/simtrace/include/board.h
+++ b/firmware/libboard/simtrace/include/board.h
@@ -78,11 +78,11 @@
 /* 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_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}
+#define PIN_USIM1_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 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_USIM1_IO, PIN_PHONE_CLK, 
PIN_PHONE_CLK_INPUT, PIN_USIM1_VCC, PIN_PHONE_IO_INPUT, PIN_USIM1_nRST
 /* 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) */

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I486b14260faec897e8c8698c4b7987bf36492497
Gerrit-Change-Number: 23614
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-MessageType: newchange


Change in simtrace2[master]: add library providing ISO 7816-3 utilities

2021-04-04 Thread laforge
Hello tsaitgaist,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: add library providing ISO 7816-3 utilities
..

add library providing ISO 7816-3 utilities

this will become part of libosmocore since it it common to smart
card related projects (such as osmo-ccid-firmware)

Change-Id: I3d4c65d137fc4555fcb256443feadd1c695de73d
---
A firmware/libcommon/include/iso7816_3.h
A firmware/libcommon/source/iso7816_3.c
2 files changed, 221 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/12/23612/1

diff --git a/firmware/libcommon/include/iso7816_3.h 
b/firmware/libcommon/include/iso7816_3.h
new file mode 100644
index 000..738d2a2
--- /dev/null
+++ b/firmware/libcommon/include/iso7816_3.h
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2019 sysmocom -s.f.m.c. GmbH, Author: Kevin Redon 

+ *
+ * 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; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
USA.
+*/
+/* this library provides utilities to handle the ISO-7816 part 3 communication 
aspects (e.g. related to F and D) */
+#pragma once
+
+#include 
+#include 
+
+/** default clock rate conversion integer Fd
+ *  @implements ISO/IEC 7816-3:2006(E) section 8.1
+ */
+#define ISO7816_3_DEFAULT_FD 372
+/** default baud rate adjustment factor Dd
+ *  @implements ISO/IEC 7816-3:2006(E) section 8.1
+ */
+#define ISO7816_3_DEFAULT_DD 1
+/** default clock rate conversion integer Fi
+ *  @implements ISO/IEC 7816-3:2006(E) section 8.3
+ *  @note non-default value is optionally specified in TA1
+ */
+#define ISO7816_3_DEFAULT_FI 372
+/** default baud rate adjustment factor Di
+ *  @implements ISO/IEC 7816-3:2006(E) section 8.3
+ *  @note non-default value is optionally specified in TA1
+ */
+#define ISO7816_3_DEFAULT_DI 1
+/** default maximum clock frequency, in Hz
+ *  @implements ISO/IEC 7816-3:2006(E) section 8.3
+ *  @note non-default value is optionally specified in TA1
+ */
+#define ISO7816_3_DEFAULT_FMAX 500UL
+/** default Waiting Integer (WI) value for T=0
+ *  @implements ISO/IEC 7816-3:2006(E) section 10.2
+ *  @note non-default value is optionally specified in TC2
+ */
+#define ISO7816_3_DEFAULT_WI 10
+/** default Waiting Time (WT) value, in ETU
+ *  @implements ISO/IEC 7816-3:2006(E) section 8.1
+ *  @note depends on Fi, Di, and WI if protocol T=0 is selected
+ */
+#define ISO7816_3_DEFAULT_WT 9600
+
+/** Table encoding the clock rate conversion integer Fi
+ *  @note Fi is indicated in TA1, but the same table is used for F and Fn 
during PPS
+ *  @implements ISO/IEC 7816-3:2006(E) table 7
+ */
+extern const uint16_t iso7816_3_fi_table[];
+
+/** Table encoding the maximum clock frequency f_max in Hz
+ *  @implements ISO/IEC 7816-3:2006(E) table 7
+ *  @note f_max is indicated in TA1, but the same table is used for F and Fn 
during PPS
+ */
+extern const uint32_t iso7816_3_fmax_table[];
+
+/** Table encoding the baud rate adjust integer Di
+ *  @implements ISO/IEC 7816-3:2006(E) table 8
+ *  @note Di is indicated in TA1, but the same table is used for D and Dn 
during PPS
+ */
+extern const uint8_t iso7816_3_di_table[];
+
+/* verify if the clock rate conversion integer F value is valid
+ * @param[in] f F value to be validated
+ * @return if F value is valid
+ * @note only values in ISO/IEC 7816-3:2006(E) table 7 are valid
+ */
+bool iso7816_3_valid_f(uint16_t f);
+/* verify if the baud rate adjustment factor D value is valid
+ * @param[in] d D value to be validated
+ * @return if D value is valid
+ * @note only values in ISO/IEC 7816-3:2006(E) table 8 are valid
+ */
+bool iso7816_3_valid_d(uint8_t d);
+/** calculate Waiting Time (WT)
+ *  @param[in] wi Waiting Integer
+ *  @param[in] fi clock rate conversion integer Fi value
+ *  @param[in] di baud rate adjustment factor Di value
+ *  @param[in] f clock rate conversion integer F value
+ *  @param[in] d baud rate adjustment factor D value
+ *  @return Waiting Time WT, in ETU, or < 0 on error (see code for return 
codes)
+ *  @note this should happen after reset and T=0 protocol select (through PPS 
or implicit)
+ *  @implements ISO/IEC 7816-3:2006(E) section 8.1 and 10.2
+ */
+int32_t iso7816_3_calculate_wt(uint8_t wi, uint16_t fi, uint8_t di, 

Change in simtrace2[master]: cardem: choose a more reasonable default ATR

2021-04-04 Thread laforge
Hello Jenkins Builder, Hoernchen,

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

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

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

Change subject: cardem: choose a more reasonable default ATR
..

cardem: choose a more reasonable default ATR

PCSCd does not like invalid ATRs

Change-Id: I1eebfdc06be55931c2e80e2b515ac3a559737c38
---
M firmware/libcommon/source/card_emu.c
M host/src/simtrace2-cardem-pcsc.c
2 files changed, 38 insertions(+), 3 deletions(-)


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I1eebfdc06be55931c2e80e2b515ac3a559737c38
Gerrit-Change-Number: 23611
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Hoernchen 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria 
Gerrit-MessageType: newpatchset


Change in simtrace2[master]: add ISO 7816-3 library to remsim project

2021-04-04 Thread laforge
Hello tsaitgaist,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: add ISO 7816-3 library to remsim project
..

add ISO 7816-3 library to remsim project

Change-Id: I99f3fecbc00d2379c3a6dc457b047c6fee41c292
---
M firmware/apps/cardem/Makefile
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/13/23613/1

diff --git a/firmware/apps/cardem/Makefile b/firmware/apps/cardem/Makefile
index 75c43e8..d5f68a5 100644
--- a/firmware/apps/cardem/Makefile
+++ b/firmware/apps/cardem/Makefile
@@ -1,3 +1,3 @@
 C_FILES += $(C_LIBUSB_RT)

-C_FILES += card_emu.c cciddriver.c iso7816_4.c iso7816_fidi.c mitm.c 
mode_cardemu.c mode_ccid.c simtrace_iso7816.c sniffer.c tc_etu.c usb.c
+C_FILES += card_emu.c cciddriver.c iso7816_3.c iso7816_4.c iso7816_fidi.c 
mitm.c mode_cardemu.c mode_ccid.c simtrace_iso7816.c sniffer.c tc_etu.c usb.c

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I99f3fecbc00d2379c3a6dc457b047c6fee41c292
Gerrit-Change-Number: 23613
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-MessageType: newchange


Change in osmo-bsc[master]: abis_nm: rework warnings about unknown / not supported features

2021-04-04 Thread fixeria
Hello Jenkins Builder, laforge,

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

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

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

Change subject: abis_nm: rework warnings about unknown / not supported features
..

abis_nm: rework warnings about unknown / not supported features

The reported feature vector may contain new features the BSC is
not aware of.  Report each of them individually as NOTICE.

It's normal when some BTS feature is considered as not supported
by the BSC, but a BTS reports that it is - do not log this.

Change-Id: I2f925bcdb010cb10d074bf7c82619e3ae1f8818b
---
M src/osmo-bsc/abis_nm.c
1 file changed, 14 insertions(+), 5 deletions(-)


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I2f925bcdb010cb10d074bf7c82619e3ae1f8818b
Gerrit-Change-Number: 18599
Gerrit-PatchSet: 7
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: newpatchset


Change in osmo-bsc[master]: abis_nm: cosmetic: use osmo_bts_feature_name()

2021-04-04 Thread fixeria
Hello Jenkins Builder, laforge,

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

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

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

Change subject: abis_nm: cosmetic: use osmo_bts_feature_name()
..

abis_nm: cosmetic: use osmo_bts_feature_name()

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


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I15078ac030b0b824a554239b19bc501c624e2a87
Gerrit-Change-Number: 18604
Gerrit-PatchSet: 6
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: newpatchset


Change in osmo-bsc[master]: bts_osmobts: update the list of supported features

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

Change subject: bts_osmobts: update the list of supported features
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/c/osmo-bsc/+/18617/1/src/osmo-bsc/bts_osmobts.c
File src/osmo-bsc/bts_osmobts.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/18617/1/src/osmo-bsc/bts_osmobts.c@54
PS1, Line 54: osmo_bts_set_feature(>features, BTS_FEAT_OML_ALERTS);
:   osmo_bts_set_feature(>features, BTS_FEAT_CBCH);
:   osmo_bts_set_feature(>features, BTS_FEAT_SPEECH_F_V1);
:   osmo_bts_set_feature(>features, BTS_FEAT_SPEECH_H_V1);
:   osmo_bts_set_feature(>features, BTS_FEAT_SPEECH_F_EFR);
:   osmo_bts_set_feature(>features, BTS_FEAT_SPEECH_F_AMR);
:   osmo_bts_set_feature(>features, BTS_FEAT_SPEECH_H_AMR);
:   osmo_bts_set_feature(>features, BTS_FEAT_ETWS_PN);
> how do you know that those are supported by the (remote, possibly old) 
> osmo-bts version?  The point  […]
I think I am not understanding the point of having this list of 'expected' 
features in osmo-bsc. When I was working on this patch, I thought this is what 
we expect the recent osmo-bts to support. From your response, it now feels more 
like it's a set of features that any, even a very old osmo-bts version would 
support. We have EGPRS here, but not SPEECH_* features? Was EGPRS support 
introduced even earlier than FR/HR/AMR speech coding? I am confused.



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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I431c8ab9478cbc40179903edc21043623d805da1
Gerrit-Change-Number: 18617
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge 
Gerrit-Comment-Date: Sun, 04 Apr 2021 17:33:49 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge 
Gerrit-MessageType: comment


Change in libosmocore[master]: gprs_ns2: add vty `nse <0-65535> restart sns`

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

Change subject: gprs_ns2: add vty `nse <0-65535> restart sns`
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/c/libosmocore/+/23184/1/src/gb/gprs_ns2_vty.c
File src/gb/gprs_ns2_vty.c:

https://gerrit.osmocom.org/c/libosmocore/+/23184/1/src/gb/gprs_ns2_vty.c@1920
PS1, Line 1920: gprs_ns2_free_nsvcs(nse);
> The SGSN cannot re-start SNS.  Only the BSS can do this by sending SNS-SIZE. 
> […]
The code was there before the SGSN SNS code :)
So should we have 2 vty commands, one for BSS and one for SGSN?
The code should work for both. But right, there is no restart for SGSN.



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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Icb55d8449908d348ab10572eebcf971737fba00d
Gerrit-Change-Number: 23184
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-CC: laforge 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Sun, 04 Apr 2021 17:27:15 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: daniel 
Gerrit-MessageType: comment


Change in osmo-bsc[master]: abis_nm: rework warnings about unknown / not supported features

2021-04-04 Thread fixeria
Hello Jenkins Builder, laforge,

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

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

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

Change subject: abis_nm: rework warnings about unknown / not supported features
..

abis_nm: rework warnings about unknown / not supported features

The reported feature vector may contain new features the BSC is
not aware of.  Report each of them individually as NOTICE.

It's normal when some BTS feature is considered as not supported
by the BSC, but a BTS reports that it is - do not log this.

Change-Id: I2f925bcdb010cb10d074bf7c82619e3ae1f8818b
---
M src/osmo-bsc/abis_nm.c
1 file changed, 15 insertions(+), 5 deletions(-)


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I2f925bcdb010cb10d074bf7c82619e3ae1f8818b
Gerrit-Change-Number: 18599
Gerrit-PatchSet: 6
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: newpatchset


Change in osmo-bsc[master]: abis_nm: cosmetic: use osmo_bts_feature_name()

2021-04-04 Thread fixeria
Hello Jenkins Builder, laforge,

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

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

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

Change subject: abis_nm: cosmetic: use osmo_bts_feature_name()
..

abis_nm: cosmetic: use osmo_bts_feature_name()

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


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I15078ac030b0b824a554239b19bc501c624e2a87
Gerrit-Change-Number: 18604
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: newpatchset


Change in osmo-bsc[master]: abis_nm: rework warnings about unknown / not supported features

2021-04-04 Thread fixeria
Hello Jenkins Builder, laforge,

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

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

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

Change subject: abis_nm: rework warnings about unknown / not supported features
..

abis_nm: rework warnings about unknown / not supported features

The reported feature vector may contain new features the BSC is
not aware of.  Report each of them individually as NOTICE.

It's normal when some BTS feature is considered as not supported
by the BSC, but a BTS reports that it is - do not log this.

Change-Id: I2f925bcdb010cb10d074bf7c82619e3ae1f8818b
---
M src/osmo-bsc/abis_nm.c
1 file changed, 16 insertions(+), 5 deletions(-)


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I2f925bcdb010cb10d074bf7c82619e3ae1f8818b
Gerrit-Change-Number: 18599
Gerrit-PatchSet: 5
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: newpatchset


Change in osmo-dev[master]: net/templates/osmo-sgsn.cfg: update format

2021-04-04 Thread lynxis lazus
lynxis lazus has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-dev/+/23418 )

Change subject: net/templates/osmo-sgsn.cfg: update format
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: Ie0a6d4a55f725ebcc6a55b6bd71c52ad72accbd2
Gerrit-Change-Number: 23418
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Assignee: neels 
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-CC: neels 
Gerrit-Comment-Date: Sun, 04 Apr 2021 17:01:50 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-dev[master]: net/templates/osmo-gbproxy.cfg: update format

2021-04-04 Thread lynxis lazus
lynxis lazus has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-dev/+/23419 )

Change subject: net/templates/osmo-gbproxy.cfg: update format
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: Ia7008d6d2d26030aa4c35439f1525a53957443a1
Gerrit-Change-Number: 23419
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Assignee: neels 
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-CC: neels 
Gerrit-Comment-Date: Sun, 04 Apr 2021 17:01:39 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: ns2: Dump frame relay state to VTY during "show ns"

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

Change subject: ns2: Dump frame relay state to VTY during "show ns"
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/c/libosmocore/+/23546/1/src/gb/gprs_ns2_vty.c
File src/gb/gprs_ns2_vty.c:

https://gerrit.osmocom.org/c/libosmocore/+/23546/1/src/gb/gprs_ns2_vty.c@2022
PS1, Line 2022: osmo_fr_network_dump_vty(vty, vty_fr_network);
> very nice catch. […]
it shouldn't be deprecated. It would be also great to have a separate command 
to show only the fr.



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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I798af3e97dc014b6e0fcde86560a1809852f7510
Gerrit-Change-Number: 23546
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Sun, 04 Apr 2021 17:00:26 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: dexter 
Gerrit-MessageType: comment


Change in osmo-bsc[master]: abis_nm: properly warn about unknown / not supported features

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

Change subject: abis_nm: properly warn about unknown / not supported features
..


Patch Set 4:

(1 comment)

https://gerrit.osmocom.org/c/osmo-bsc/+/18599/3//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/c/osmo-bsc/+/18599/3//COMMIT_MSG@12
PS3, Line 12: Vice versa, when some BTS feature is considered as supported
: by the BSC, but a BTS reports that it is not, is definitely
: a problem that requires some attention. Report this as ERROR.
> ping?
Sorry for very slow reply. I am now trying to remember the context and trying 
to understand your question. This change itself is rather cosmetic: we 
basically make osmo-bsc print something that is a bit easier to understand when 
the feature vectors are different.

AFAIU, you're against using LOGL_ERROR for features which the BSC does expect, 
but the BTS does not support? In general, I agree, it's not an error. I will 
change it to NOTICE and will also remove "Please fix", because it's not a bug 
or something than can be easily fixed in code / configuration file. Do you 
agree?



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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I2f925bcdb010cb10d074bf7c82619e3ae1f8818b
Gerrit-Change-Number: 18599
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Sun, 04 Apr 2021 16:34:23 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge 
Gerrit-MessageType: comment


Change in osmo-bsc[master]: debug log, lchan_fsm: explain leaving wait_rll_rtp_establish state

2021-04-04 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/21644 )

Change subject: debug log, lchan_fsm: explain leaving wait_rll_rtp_establish 
state
..

debug log, lchan_fsm: explain leaving wait_rll_rtp_establish state

Before, it is not clear whether the RTP is already done setting up or
the RTP is skipped entirely. This log message clarifies that.

Change-Id: I18ffcf93e82ee47413e4b2f741ffbfbb18322e1d
---
M src/osmo-bsc/lchan_fsm.c
1 file changed, 6 insertions(+), 1 deletion(-)

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



diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c
index 9c7ecaf..6f0fd63 100644
--- a/src/osmo-bsc/lchan_fsm.c
+++ b/src/osmo-bsc/lchan_fsm.c
@@ -861,8 +861,13 @@

case LCHAN_EV_RLL_ESTABLISH_IND:
if (!lchan->activate.info.requires_voice_stream
-   || lchan_rtp_established(lchan))
+   || lchan_rtp_established(lchan)) {
+   LOG_LCHAN(lchan, LOGL_DEBUG,
+ "%s\n",
+ (lchan->activate.info.requires_voice_stream ?
+  "RTP already established earlier" : "no 
voice stream required"));
lchan_fsm_state_chg(LCHAN_ST_ESTABLISHED);
+   }
return;

case LCHAN_EV_RTP_READY:

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I18ffcf93e82ee47413e4b2f741ffbfbb18322e1d
Gerrit-Change-Number: 21644
Gerrit-PatchSet: 6
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in osmo-bsc[master]: Ignore CHANnel ReQuireD with Access Delay IE > 63

2021-04-04 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/23574 )

Change subject: Ignore CHANnel ReQuireD with Access Delay IE > 63
..

Ignore CHANnel ReQuireD with Access Delay IE > 63

It is observed that a CHANnel ReQuireD with access delay
greater than 63 can be received from the Ericsson RBS.
This results in osmo-bsc sending back a CHANnel ACTIVation with
a Timing Advance IE containing the access delay value.
The RBS NACKs this, leading to a BORKEN Channel.

This patch makes the maximum acceptable access delay vty-configurable
and Ignores CHANnel ReQuireD RSL Messages with Access Delay IE greater
than that configured. Default value is 63.

Related: OS#5096
Change-Id: Ie8987bcc0e43921bc753162b77a0efc68799b3ce
---
M include/osmocom/bsc/bts.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts.c
4 files changed, 33 insertions(+), 0 deletions(-)

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



diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index f40aa3e..c8cf8b3 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -28,6 +28,7 @@
BTS_CTR_CHREQ_ATTEMPTED_UNKNOWN,
BTS_CTR_CHREQ_SUCCESSFUL,
BTS_CTR_CHREQ_NO_CHANNEL,
+   BTS_CTR_CHREQ_MAX_DELAY_EXCEEDED,
BTS_CTR_CHAN_RF_FAIL,
BTS_CTR_CHAN_RF_FAIL_TCH,
BTS_CTR_CHAN_RF_FAIL_SDCCH,
@@ -529,6 +530,9 @@
/* MS/BS Power Control parameters */
struct gsm_power_ctrl_params ms_power_ctrl;
struct gsm_power_ctrl_params bs_power_ctrl;
+
+   /* We will ignore CHAN RQD with access delay greater than 
rach_max_delay */
+   uint8_t rach_max_delay;
 };

 #define GSM_BTS_SI2Q(bts, i)   (struct gsm48_system_information_type_2quater 
*)((bts)->si_buf[SYSINFO_TYPE_2quater][i])
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 67e7d27..6445b6d 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -1526,6 +1526,13 @@
return -EINVAL;
}
rqd->ta = rqd_hdr->data[sizeof(struct gsm48_req_ref)+2];
+   if (rqd->ta > bts->rach_max_delay) {
+   LOG_BTS(bts, DRSL, LOGL_INFO, "Ignoring CHAN RQD: Access 
Delay(%d) greater than %u\n",
+   rqd->ta, bts->rach_max_delay);
+   
rate_ctr_inc(>bts_ctrs->ctr[BTS_CTR_CHREQ_MAX_DELAY_EXCEEDED]);
+   talloc_free(rqd);
+   return -EINVAL;
+   }

/* Determine channel request cause code */
rqd->reason = get_reason_by_chreq(rqd->ref.ra, bts->network->neci);
diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 280fe9f..91eaee0 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -433,6 +433,8 @@
vty_out(vty, "  RACH Max transmissions: %u%s",
rach_max_trans_raw2val(bts->si_common.rach_control.max_trans),
VTY_NEWLINE);
+   vty_out(vty, "  RACH Max Delay (Max Access Delay IE in CHANnel 
ReQuireD): %u%s",
+   bts->rach_max_delay, VTY_NEWLINE);
if (bts->si_common.rach_control.cell_bar)
vty_out(vty, "  CELL IS BARRED%s", VTY_NEWLINE);
if (bts->dtxu != GSM48_DTX_SHALL_NOT_BE_USED)
@@ -1041,6 +1043,7 @@
vty_out(vty, "  rach max transmission %u%s",
rach_max_trans_raw2val(bts->si_common.rach_control.max_trans),
VTY_NEWLINE);
+   vty_out(vty, "  rach max-delay %u%s", bts->rach_max_delay, VTY_NEWLINE);

vty_out(vty, "  channel-description attach %u%s",
bts->si_common.chan_desc.att, VTY_NEWLINE);
@@ -2746,6 +2749,19 @@
return CMD_SUCCESS;
 }

+DEFUN_ATTR(cfg_bts_rach_max_delay,
+  cfg_bts_rach_max_delay_cmd,
+  "rach max-delay <1-127>",
+  RACH_STR
+  "Set the max Access Delay IE value to accept in CHANnel ReQuireD\n"
+  "Maximum Access Delay IE value to accept in CHANnel ReQuireD\n",
+  CMD_ATTR_IMMEDIATE)
+{
+   struct gsm_bts *bts = vty->index;
+   bts->rach_max_delay = atoi(argv[0]);
+   return CMD_SUCCESS;
+}
+
 #define REP_ACCH_STR "FACCH/SACCH repetition\n"

 DEFUN_USRATTR(cfg_bts_rep_dl_facch,
@@ -7668,6 +7684,7 @@
install_element(BTS_NODE, _bts_challoc_cmd);
install_element(BTS_NODE, _bts_rach_tx_integer_cmd);
install_element(BTS_NODE, _bts_rach_max_trans_cmd);
+   install_element(BTS_NODE, _bts_rach_max_delay_cmd);
install_element(BTS_NODE, _bts_chan_desc_att_cmd);
install_element(BTS_NODE, _bts_chan_dscr_att_cmd);
install_element(BTS_NODE, _bts_chan_desc_bs_pa_mfrms_cmd);
diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c
index 398f26f..b5b7136 100644
--- a/src/osmo-bsc/bts.c
+++ b/src/osmo-bsc/bts.c
@@ -357,6 +357,8 @@
bts->bs_power_ctrl = power_ctrl_params_def;
bts->bs_power_ctrl.dir = GSM_PWR_CTRL_DIR_DL;

+   

Change in osmo-bsc[master]: Ignore CHANnel ReQuireD with Access Delay IE > 63

2021-04-04 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/23574 )

Change subject: Ignore CHANnel ReQuireD with Access Delay IE > 63
..


Patch Set 8:

(1 comment)

https://gerrit.osmocom.org/c/osmo-bsc/+/23574/7/src/osmo-bsc/bsc_vty.c
File src/osmo-bsc/bsc_vty.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/23574/7/src/osmo-bsc/bsc_vty.c@2752 
PS7, Line 2752: DEFUN_USRATTR
> Indeed, you cannot use a global command attribute as a user-/library-defined 
> one. […]
we could probably assign different numeric ranges (like use some MSBs to 
distinguish the enum types, and the LSBs for the enum member) and then have 
some compile-time comparisons in the macro, something like a static_assert() 
that validates the enum member falls within the permitted range of that enum.



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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ie8987bcc0e43921bc753162b77a0efc68799b3ce
Gerrit-Change-Number: 23574
Gerrit-PatchSet: 8
Gerrit-Owner: keith 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-CC: laforge 
Gerrit-Comment-Date: Sun, 04 Apr 2021 16:19:25 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


Change in simtrace2[master]: firmware: allow verbose builds

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

Change subject: firmware: allow verbose builds
..

firmware: allow verbose builds

make V=1 can be used to echo all compilation commands, which is useful
because it allows IDEs to parse the gcc output in oder to properly index
the source files using the actual defines passed to the compiler.

Change-Id: I25c41dff89302a73ddd2a4aaba7cb14912fac3b8
---
M firmware/Makefile
1 file changed, 14 insertions(+), 6 deletions(-)

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



diff --git a/firmware/Makefile b/firmware/Makefile
index cc40673..2d0f62c 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -33,6 +33,14 @@
 #User-modifiable options
 
#---

+# verbosity
+V ?= 0
+ifneq ("$(V)","0")
+SILENT :=
+else
+SILENT := @
+endif
+
 # Chip & board used for compilation
 # (can be overriden by adding CHIP=chip and BOARD=board to the command-line)
 CHIP  ?= sam3s4
@@ -210,18 +218,18 @@
 ASM_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(ASM_OBJECTS))

 $(1): $$(ASM_OBJECTS_$(1)) $$(C_OBJECTS_$(1))
-   @$(CC) $(LDFLAGS) $(LD_OPTIONAL) 
-T"libboard/common/resources/$(CHIP)/$$@.ld" -Wl,-Map,$(OUTPUT)-$$@.map -o 
$(OUTPUT)-$$@.elf $$^ $(LIBS)
-   @$(NM) $(OUTPUT)-$$@.elf >$(OUTPUT)-$$@.elf.txt
-   @$(OBJCOPY) -O binary $(OUTPUT)-$$@.elf $(OUTPUT)-$$@.bin
-   @$(SIZE) $$^ $(OUTPUT)-$$@.elf
+   $(SILENT)$(CC) $(LDFLAGS) $(LD_OPTIONAL) 
-T"libboard/common/resources/$(CHIP)/$$@.ld" -Wl,-Map,$(OUTPUT)-$$@.map -o 
$(OUTPUT)-$$@.elf $$^ $(LIBS)
+   $(SILENT)$(NM) $(OUTPUT)-$$@.elf >$(OUTPUT)-$$@.elf.txt
+   $(SILENT)$(OBJCOPY) -O binary $(OUTPUT)-$$@.elf $(OUTPUT)-$$@.bin
+   $(SILENT)$(SIZE) $$^ $(OUTPUT)-$$@.elf

 $$(C_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.c Makefile $(OBJ) $(BIN)
@echo [COMPILING $$<]
-   @$(CC) $(CFLAGS) -DENVIRONMENT_$(1) -DENVIRONMENT=\"$(1)\" 
-Wa,-ahlms=$(BIN)/$$*.lst -c -o $$@ $$<
+   $(SILENT)$(CC) $(CFLAGS) -DENVIRONMENT_$(1) -DENVIRONMENT=\"$(1)\" 
-Wa,-ahlms=$(BIN)/$$*.lst -c -o $$@ $$<

 $$(ASM_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.S Makefile $(OBJ) $(BIN)
@echo [ASSEMBLING $$@]
-   @$(CC) $(ASFLAGS) -DENVIRONMENT_$(1) -DENVIRONMENT=\"$(1)\" -c -o $$@ 
$$<
+   $(SILENT)@$(CC) $(ASFLAGS) -DENVIRONMENT_$(1) -DENVIRONMENT=\"$(1)\" -c 
-o $$@ $$<

 debug_$(1): $(1)
$(GDB) -x "$(BOARD_LIB)/resources/gcc/$(BOARD)_$(1).gdb" -ex "reset" 
-readnow -se $(OUTPUT)-$(1).elf

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I25c41dff89302a73ddd2a4aaba7cb14912fac3b8
Gerrit-Change-Number: 23610
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Hoernchen 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in simtrace2[master]: firmware: do not allow undefined symbols

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

Change subject: firmware: do not allow undefined symbols
..

firmware: do not allow undefined symbols

For some reason undefined symbols were downgraded to warnings, which
means building a firmware that calls missing functions  (= address zero)
was perfectly fine, which of course made development more exciting

This applies to builtins, too, printf of one char gets downgraded to
putchar, which we don't have, so disable builtins.

Change-Id: I492f41ad4162b9d07b1881ae4aed019db2dff8b5
---
M firmware/Makefile
M firmware/libboard/common/source/board_lowlevel.c
2 files changed, 7 insertions(+), 2 deletions(-)

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



diff --git a/firmware/Makefile b/firmware/Makefile
index ccf5843..cc40673 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -164,14 +164,14 @@
 # -mlong-calls  -Wall
 #CFLAGS += -save-temps -fverbose-asm
 #CFLAGS += -Wa,-a,-ad
-CFLAGS += -D__ARM
+CFLAGS += -D__ARM -fno-builtin
 CFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb # 
-mfix-cortex-m3-ldrd
 CFLAGS += -ffunction-sections -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) 
-DTRACE_LEVEL=$(TRACE_LEVEL) -DALLOW_PEER_ERASE=$(ALLOW_PEER_ERASE)
 CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
 CFLAGS += -DBOARD=\"$(BOARD)\" -DBOARD_$(BOARD)
 CFLAGS += -DAPPLICATION=\"$(APP)\" -DAPPLICATION_$(APP)
 ASFLAGS = -mcpu=cortex-m3 -mthumb -Wall -g $(OPTIMIZATION) $(INCLUDES) 
-D$(CHIP) -D__ASSEMBLY__
-LDFLAGS = -mcpu=cortex-m3 -mthumb -Wl,--cref -Wl,--check-sections 
-Wl,--gc-sections -Wl,--entry=ResetException 
-Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align 
-Wl,--warn-unresolved-symbols -Wl,--print-memory-usage $(LIB)
+LDFLAGS = -mcpu=cortex-m3 -mthumb -Wl,--cref -Wl,--check-sections 
-Wl,--gc-sections -Wl,--entry=ResetException 
-Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align 
-Wl,--print-memory-usage -Wl,--no-undefined $(LIB)
 #LD_OPTIONAL=-Wl,--print-gc-sections -Wl,--stats

 # Append BIN directories to output filename
diff --git a/firmware/libboard/common/source/board_lowlevel.c 
b/firmware/libboard/common/source/board_lowlevel.c
index b4d7d32..1ddbcba 100644
--- a/firmware/libboard/common/source/board_lowlevel.c
+++ b/firmware/libboard/common/source/board_lowlevel.c
@@ -218,3 +218,8 @@
do {
} while ((jiffies - jiffies_start) < msecs);
 }
+
+void abort() {
+   NVIC_SystemReset();
+   while(1) {};
+}

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I492f41ad4162b9d07b1881ae4aed019db2dff8b5
Gerrit-Change-Number: 23609
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Hoernchen 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in simtrace2[master]: minor: use same LED pattern for cardem as other applications

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

Change subject: minor: use same LED pattern for cardem as other applications
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I5608c3312b648c0d59f79338ef1f97b6fe08f5b9
Gerrit-Change-Number: 23608
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-Comment-Date: Sun, 04 Apr 2021 16:16:18 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: minor: use same LED pattern for cardem as other applications

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

Change subject: minor: use same LED pattern for cardem as other applications
..

minor: use same LED pattern for cardem as other applications

Change-Id: I5608c3312b648c0d59f79338ef1f97b6fe08f5b9
---
M firmware/apps/cardem/main.c
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/firmware/apps/cardem/main.c b/firmware/apps/cardem/main.c
index 3476af2..a30a211 100644
--- a/firmware/apps/cardem/main.c
+++ b/firmware/apps/cardem/main.c
@@ -147,7 +147,8 @@
unsigned int i = 0;

led_init();
-   led_blink(LED_RED, BLINK_3O_5F);
+   led_blink(LED_RED, BLINK_ALWAYS_ON);
+   led_blink(LED_GREEN, BLINK_ALWAYS_ON);

/* Enable watchdog for 2000ms, with no window */
WDT_Enable(WDT, WDT_MR_WDRSTEN | WDT_MR_WDDBGHLT | WDT_MR_WDIDLEHLT |

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I5608c3312b648c0d59f79338ef1f97b6fe08f5b9
Gerrit-Change-Number: 23608
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-MessageType: merged


Change in simtrace2[master]: firmware: do not allow undefined symbols

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

Change subject: firmware: do not allow undefined symbols
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I492f41ad4162b9d07b1881ae4aed019db2dff8b5
Gerrit-Change-Number: 23609
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Hoernchen 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Sun, 04 Apr 2021 16:15:46 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: firmware: allow verbose builds

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

Change subject: firmware: allow verbose builds
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I25c41dff89302a73ddd2a4aaba7cb14912fac3b8
Gerrit-Change-Number: 23610
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Hoernchen 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Sun, 04 Apr 2021 16:15:48 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: debug log, lchan_fsm: explain leaving wait_rll_rtp_establish state

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

Change subject: debug log, lchan_fsm: explain leaving wait_rll_rtp_establish 
state
..


Patch Set 5: Code-Review+2


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I18ffcf93e82ee47413e4b2f741ffbfbb18322e1d
Gerrit-Change-Number: 21644
Gerrit-PatchSet: 5
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Sun, 04 Apr 2021 15:58:30 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: cardem: choose a more reasonable default ATR

2021-04-04 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/23611 )

Change subject: cardem: choose a more reasonable default ATR
..


Patch Set 1:

(2 comments)

https://gerrit.osmocom.org/c/simtrace2/+/23611/1/firmware/libcommon/source/card_emu.c
File firmware/libcommon/source/card_emu.c:

https://gerrit.osmocom.org/c/simtrace2/+/23611/1/firmware/libcommon/source/card_emu.c@1199
PS1, Line 1199: 0x59};
missing space


https://gerrit.osmocom.org/c/simtrace2/+/23611/1/host/src/simtrace2-cardem-pcsc.c
File host/src/simtrace2-cardem-pcsc.c:

https://gerrit.osmocom.org/c/simtrace2/+/23611/1/host/src/simtrace2-cardem-pcsc.c@56
PS1, Line 56: reasonable ATR offering all protocols and voltages
Weird comment formatting. I would prefer to have it consistent with the GPL 
license header.



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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I1eebfdc06be55931c2e80e2b515ac3a559737c38
Gerrit-Change-Number: 23611
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Hoernchen 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria 
Gerrit-Comment-Date: Sun, 04 Apr 2021 15:08:19 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in simtrace2[master]: firmware: allow verbose builds

2021-04-04 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/23610 )

Change subject: firmware: allow verbose builds
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I25c41dff89302a73ddd2a4aaba7cb14912fac3b8
Gerrit-Change-Number: 23610
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Hoernchen 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Comment-Date: Sun, 04 Apr 2021 15:06:10 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: firmware: do not allow undefined symbols

2021-04-04 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/23609 )

Change subject: firmware: do not allow undefined symbols
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I492f41ad4162b9d07b1881ae4aed019db2dff8b5
Gerrit-Change-Number: 23609
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Hoernchen 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Comment-Date: Sun, 04 Apr 2021 15:04:40 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: minor: use same LED pattern for cardem as other applications

2021-04-04 Thread laforge
Hello tsaitgaist,

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

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

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

Change subject: minor: use same LED pattern for cardem as other applications
..

minor: use same LED pattern for cardem as other applications

Change-Id: I5608c3312b648c0d59f79338ef1f97b6fe08f5b9
---
M firmware/apps/cardem/main.c
1 file changed, 2 insertions(+), 1 deletion(-)


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I5608c3312b648c0d59f79338ef1f97b6fe08f5b9
Gerrit-Change-Number: 23608
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-CC: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in simtrace2[master]: firmware: do not allow undefined symbols

2021-04-04 Thread laforge
Hello Hoernchen,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: firmware: do not allow undefined symbols
..

firmware: do not allow undefined symbols

For some reason undefined symbols were downgraded to warnings, which
means building a firmware that calls missing functions  (= address zero)
was perfectly fine, which of course made development more exciting

This applies to builtins, too, printf of one char gets downgraded to
putchar, which we don't have, so disable builtins.

Change-Id: I492f41ad4162b9d07b1881ae4aed019db2dff8b5
---
M firmware/Makefile
M firmware/libboard/common/source/board_lowlevel.c
2 files changed, 7 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/09/23609/1

diff --git a/firmware/Makefile b/firmware/Makefile
index ccf5843..cc40673 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -164,14 +164,14 @@
 # -mlong-calls  -Wall
 #CFLAGS += -save-temps -fverbose-asm
 #CFLAGS += -Wa,-a,-ad
-CFLAGS += -D__ARM
+CFLAGS += -D__ARM -fno-builtin
 CFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb # 
-mfix-cortex-m3-ldrd
 CFLAGS += -ffunction-sections -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) 
-DTRACE_LEVEL=$(TRACE_LEVEL) -DALLOW_PEER_ERASE=$(ALLOW_PEER_ERASE)
 CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
 CFLAGS += -DBOARD=\"$(BOARD)\" -DBOARD_$(BOARD)
 CFLAGS += -DAPPLICATION=\"$(APP)\" -DAPPLICATION_$(APP)
 ASFLAGS = -mcpu=cortex-m3 -mthumb -Wall -g $(OPTIMIZATION) $(INCLUDES) 
-D$(CHIP) -D__ASSEMBLY__
-LDFLAGS = -mcpu=cortex-m3 -mthumb -Wl,--cref -Wl,--check-sections 
-Wl,--gc-sections -Wl,--entry=ResetException 
-Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align 
-Wl,--warn-unresolved-symbols -Wl,--print-memory-usage $(LIB)
+LDFLAGS = -mcpu=cortex-m3 -mthumb -Wl,--cref -Wl,--check-sections 
-Wl,--gc-sections -Wl,--entry=ResetException 
-Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align 
-Wl,--print-memory-usage -Wl,--no-undefined $(LIB)
 #LD_OPTIONAL=-Wl,--print-gc-sections -Wl,--stats

 # Append BIN directories to output filename
diff --git a/firmware/libboard/common/source/board_lowlevel.c 
b/firmware/libboard/common/source/board_lowlevel.c
index b4d7d32..1ddbcba 100644
--- a/firmware/libboard/common/source/board_lowlevel.c
+++ b/firmware/libboard/common/source/board_lowlevel.c
@@ -218,3 +218,8 @@
do {
} while ((jiffies - jiffies_start) < msecs);
 }
+
+void abort() {
+   NVIC_SystemReset();
+   while(1) {};
+}

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I492f41ad4162b9d07b1881ae4aed019db2dff8b5
Gerrit-Change-Number: 23609
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Hoernchen 
Gerrit-MessageType: newchange


Change in simtrace2[master]: cardem: choose a more reasonable default ATR

2021-04-04 Thread laforge
Hello Hoernchen,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: cardem: choose a more reasonable default ATR
..

cardem: choose a more reasonable default ATR

PCSCd does not like invalid ATRs

Change-Id: I1eebfdc06be55931c2e80e2b515ac3a559737c38
---
M firmware/libcommon/source/card_emu.c
M host/src/simtrace2-cardem-pcsc.c
2 files changed, 39 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/11/23611/1

diff --git a/firmware/libcommon/source/card_emu.c 
b/firmware/libcommon/source/card_emu.c
index cad24b8..099fed1 100644
--- a/firmware/libcommon/source/card_emu.c
+++ b/firmware/libcommon/source/card_emu.c
@@ -1179,8 +1179,24 @@
}
 }

-/* shortest ATR possible (uses default speed and no options) */
-static const uint8_t default_atr[] = { 0x3B, 0x00 };
+/* reasonable ATR offering all protocols and voltages
+ * smartphones might not care, but other readers do
+
+TS = 0x3B  Direct Convention
+T0 = 0x80  Y(1): b1000, K: 0 (historical bytes)
+TD(1) = 0x80   Y(i+1) = b1000, Protocol T=0
+
+TD(2) = 0x81   Y(i+1) = b1000, Protocol T=1
+
+TD(3) = 0x1F   Y(i+1) = b0001, Protocol T=15
+
+TA(4) = 0xC7   Clock stop: no preference - Class accepted by the card: (3G) A 
5V B 3V C 1.8V
+
+Historical bytes
+TCK = 0x59 correct checksum
+
+ * */
+static const uint8_t default_atr[] = { 0x3B, 0x80, 0x80, 0x81 , 0x1F, 0xC7, 
0x59};

 static struct card_handle card_handles[NUM_SLOTS];

diff --git a/host/src/simtrace2-cardem-pcsc.c b/host/src/simtrace2-cardem-pcsc.c
index 883bad1..ad3e0f3 100644
--- a/host/src/simtrace2-cardem-pcsc.c
+++ b/host/src/simtrace2-cardem-pcsc.c
@@ -52,6 +52,26 @@

 #define ATR_MAX_LEN 33

+/*
+reasonable ATR offering all protocols and voltages
+smartphones might not care, but other readers do
+
+TS = 0x3B  Direct Convention
+T0 = 0x80  Y(1): b1000, K: 0 (historical bytes)
+TD(1) = 0x80   Y(i+1) = b1000, Protocol T=0
+
+TD(2) = 0x81   Y(i+1) = b1000, Protocol T=1
+
+TD(3) = 0x1F   Y(i+1) = b0001, Protocol T=15
+
+TA(4) = 0xC7   Clock stop: no preference - Class accepted by the card: (3G) A 
5V B 3V C 1.8V
+
+Historical bytes
+TCK = 0x59 correct checksum
+*/
+#define DEFAULT_ATR_STR "3B8080811FC759"
+
+
 static void atr_update_csum(uint8_t *atr, unsigned int atr_len)
 {
uint8_t csum = 0;
@@ -274,7 +294,7 @@
int rc;
int c, ret = 1;
int skip_atr = 0;
-   char *atr = "3b00";
+   char *atr = DEFAULT_ATR_STR;
uint8_t real_atr[ATR_MAX_LEN];
int atr_len;
int keep_running = 0;

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I1eebfdc06be55931c2e80e2b515ac3a559737c38
Gerrit-Change-Number: 23611
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Hoernchen 
Gerrit-MessageType: newchange


Change in simtrace2[master]: firmware: allow verbose builds

2021-04-04 Thread laforge
Hello Hoernchen,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: firmware: allow verbose builds
..

firmware: allow verbose builds

make V=1 can be used to echo all compilation commands, which is useful
because it allows IDEs to parse the gcc output in oder to properly index
the source files using the actual defines passed to the compiler.

Change-Id: I25c41dff89302a73ddd2a4aaba7cb14912fac3b8
---
M firmware/Makefile
1 file changed, 14 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/10/23610/1

diff --git a/firmware/Makefile b/firmware/Makefile
index cc40673..2d0f62c 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -33,6 +33,14 @@
 #User-modifiable options
 
#---

+# verbosity
+V ?= 0
+ifneq ("$(V)","0")
+SILENT :=
+else
+SILENT := @
+endif
+
 # Chip & board used for compilation
 # (can be overriden by adding CHIP=chip and BOARD=board to the command-line)
 CHIP  ?= sam3s4
@@ -210,18 +218,18 @@
 ASM_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(ASM_OBJECTS))

 $(1): $$(ASM_OBJECTS_$(1)) $$(C_OBJECTS_$(1))
-   @$(CC) $(LDFLAGS) $(LD_OPTIONAL) 
-T"libboard/common/resources/$(CHIP)/$$@.ld" -Wl,-Map,$(OUTPUT)-$$@.map -o 
$(OUTPUT)-$$@.elf $$^ $(LIBS)
-   @$(NM) $(OUTPUT)-$$@.elf >$(OUTPUT)-$$@.elf.txt
-   @$(OBJCOPY) -O binary $(OUTPUT)-$$@.elf $(OUTPUT)-$$@.bin
-   @$(SIZE) $$^ $(OUTPUT)-$$@.elf
+   $(SILENT)$(CC) $(LDFLAGS) $(LD_OPTIONAL) 
-T"libboard/common/resources/$(CHIP)/$$@.ld" -Wl,-Map,$(OUTPUT)-$$@.map -o 
$(OUTPUT)-$$@.elf $$^ $(LIBS)
+   $(SILENT)$(NM) $(OUTPUT)-$$@.elf >$(OUTPUT)-$$@.elf.txt
+   $(SILENT)$(OBJCOPY) -O binary $(OUTPUT)-$$@.elf $(OUTPUT)-$$@.bin
+   $(SILENT)$(SIZE) $$^ $(OUTPUT)-$$@.elf

 $$(C_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.c Makefile $(OBJ) $(BIN)
@echo [COMPILING $$<]
-   @$(CC) $(CFLAGS) -DENVIRONMENT_$(1) -DENVIRONMENT=\"$(1)\" 
-Wa,-ahlms=$(BIN)/$$*.lst -c -o $$@ $$<
+   $(SILENT)$(CC) $(CFLAGS) -DENVIRONMENT_$(1) -DENVIRONMENT=\"$(1)\" 
-Wa,-ahlms=$(BIN)/$$*.lst -c -o $$@ $$<

 $$(ASM_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.S Makefile $(OBJ) $(BIN)
@echo [ASSEMBLING $$@]
-   @$(CC) $(ASFLAGS) -DENVIRONMENT_$(1) -DENVIRONMENT=\"$(1)\" -c -o $$@ 
$$<
+   $(SILENT)@$(CC) $(ASFLAGS) -DENVIRONMENT_$(1) -DENVIRONMENT=\"$(1)\" -c 
-o $$@ $$<

 debug_$(1): $(1)
$(GDB) -x "$(BOARD_LIB)/resources/gcc/$(BOARD)_$(1).gdb" -ex "reset" 
-readnow -se $(OUTPUT)-$(1).elf

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I25c41dff89302a73ddd2a4aaba7cb14912fac3b8
Gerrit-Change-Number: 23610
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Hoernchen 
Gerrit-MessageType: newchange


Change in simtrace2[master]: minor: use same LED pattern for cardem as other opplications

2021-04-04 Thread laforge
Hello tsaitgaist,

I'd like you to do a code review. Please visit

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

to review the following change.


Change subject: minor: use same LED pattern for cardem as other opplications
..

minor: use same LED pattern for cardem as other opplications

Change-Id: I5608c3312b648c0d59f79338ef1f97b6fe08f5b9
---
M firmware/apps/cardem/main.c
1 file changed, 2 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/08/23608/1

diff --git a/firmware/apps/cardem/main.c b/firmware/apps/cardem/main.c
index 3476af2..a30a211 100644
--- a/firmware/apps/cardem/main.c
+++ b/firmware/apps/cardem/main.c
@@ -147,7 +147,8 @@
unsigned int i = 0;

led_init();
-   led_blink(LED_RED, BLINK_3O_5F);
+   led_blink(LED_RED, BLINK_ALWAYS_ON);
+   led_blink(LED_GREEN, BLINK_ALWAYS_ON);

/* Enable watchdog for 2000ms, with no window */
WDT_Enable(WDT, WDT_MR_WDRSTEN | WDT_MR_WDDBGHLT | WDT_MR_WDIDLEHLT |

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I5608c3312b648c0d59f79338ef1f97b6fe08f5b9
Gerrit-Change-Number: 23608
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: tsaitgaist 
Gerrit-MessageType: newchange


Change in osmo-bsc[master]: Ignore CHANnel ReQuireD with Access Delay IE > 63

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

Change subject: Ignore CHANnel ReQuireD with Access Delay IE > 63
..


Patch Set 8: Code-Review+2

(1 comment)

I fixed it, LGTM.

https://gerrit.osmocom.org/c/osmo-bsc/+/23574/7/src/osmo-bsc/bsc_vty.c
File src/osmo-bsc/bsc_vty.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/23574/7/src/osmo-bsc/bsc_vty.c@2752
PS7, Line 2752: DEFUN_USRATTR
> This muts be DEFUN_ATTR() if you use a global (libosmocore defined) attribute 
> like CMD_ATTR_IMMEDIAT […]
Indeed, you cannot use a global command attribute as a user-/library-defined 
one. There are examples of using CMD_ATTR_IMMEDIATE in this file. This 
situation actually uncovers an interesting problem: one can mix different enum 
members and it will compile. Not sure if we can guard against this :/



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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ie8987bcc0e43921bc753162b77a0efc68799b3ce
Gerrit-Change-Number: 23574
Gerrit-PatchSet: 8
Gerrit-Owner: keith 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-CC: laforge 
Gerrit-Comment-Date: Sun, 04 Apr 2021 13:55:30 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: laforge 
Gerrit-MessageType: comment


Change in pysim[master]: docs: Documentation for classic pySim-{prog, read} tools

2021-04-04 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/23607 )


Change subject: docs: Documentation for classic pySim-{prog,read} tools
..

docs: Documentation for classic pySim-{prog,read} tools

Particularly the documentation for pySim-prog is far from being
complete, but it's a start.

Change-Id: Ic1932e62a5d7cf33e0dd74cb071cfa7f27c6e497
---
M docs/legacy.rst
1 file changed, 99 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/07/23607/1

diff --git a/docs/legacy.rst b/docs/legacy.rst
index 492be46..dad83d8 100644
--- a/docs/legacy.rst
+++ b/docs/legacy.rst
@@ -1,2 +1,101 @@
 Legacy tools
 
+
+*legacy tools* are the classic ``pySim-prog`` and ``pySim-read`` programs that
+existed long before ``pySim-shell``.
+
+pySim-prog
+--
+
+``pySim-prog`` was the first part of the pySim software suite.  It started as
+a tool to write ICCID, IMSI, MSISDN and Ki to very simplistic SIM cards, and
+was later extended to a variety of other cards.  As the number of features 
supported
+became no longer bearable to express with command-line arguments, 
`pySim-shell` was
+created.
+
+Basic use cases can still use `pySim-prog`.
+
+Program customizable SIMs
+~
+Two modes are possible:
+
+  - one where you specify every parameter manually :
+
+``./pySim-prog.py -n 26C3 -c 49 -x 262 -y 42 -i  -s ``
+
+
+  - one where they are generated from some minimal set :
+
+``./pySim-prog.py -n 26C3 -c 49 -x 262 -y 42 -z  -j 
``
+
+With  and , the soft will generate
+'predictable' IMSI and ICCID, so make sure you choose them so as not to
+conflict with anyone. (for eg. your name as  and
+0 1 2 ... for ).
+
+  You also need to enter some parameters to select the device :
+   -t TYPE : type of card (supersim, magicsim, fakemagicsim or try 'auto')
+   -d DEV  : Serial port device (default /dev/ttyUSB0)
+   -b BAUD : Baudrate (default 9600)
+
+
+pySim-read
+--
+
+``pySim-read`` allows you to read some data from a SIM card.  It will only 
some files
+of the card, and will only read files accessible to a normal user (without any 
special authentication)
+
+Specifically, pySim-read will dump the following:
+
+* MF
+
+ * EF.ICCID
+
+* DF.GSM
+
+ * EF,IMSI
+ * EF.GID1
+ * EF.GID2
+ * EF.SMSP
+ * EF.SPN
+ * EF.PLMNsel
+ * EF.PLMNwAcT
+ * EF.OPLMNwAcT
+ * EF.HPLMNAcT
+ * EF.ACC
+ * EF.MSISDN
+ * EF.AD
+ * EF.SST
+
+* ADF.USIM
+
+ * EF.EHPLMN
+ * EF.UST
+ * EF.ePDGId
+ * EF.ePDGSelection
+
+* ADF.ISIM
+
+ * EF.PCSCF
+ * EF.DOMAIN
+ * EF.IMPI
+ * EF.IMPU
+ * EF.UICCIARI
+ * EF.IST
+
+
+::
+
+  Usage: pySim-read.py [options]
+
+  Options:
+-h, --helpshow this help message and exit
+-d DEV, --device=DEV  Serial Device for SIM access [default: /dev/ttyUSB0]
+-b BAUD, --baud=BAUD  Baudrate used for SIM access [default: 9600]
+-p PCSC, --pcsc-device=PCSC
+  Which PC/SC reader number for SIM access
+--modem-device=DEVSerial port of modem for Generic SIM Access (3GPP TS
+  27.007)
+--modem-baud=BAUD Baudrate used for modem's port [default: 115200]
+--osmocon=PATHSocket path for Calypso (e.g. Motorola C1XX) based
+  reader (via OsmocomBB)

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ic1932e62a5d7cf33e0dd74cb071cfa7f27c6e497
Gerrit-Change-Number: 23607
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in pysim[master]: docs/shell.rst: Auto-generate shell comamnd reference

2021-04-04 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/23606 )


Change subject: docs/shell.rst: Auto-generate shell comamnd reference
..

docs/shell.rst: Auto-generate shell comamnd reference

We use a slightly modified version of sphinx-argparse
(with patch https://github.com/alex-rudakov/sphinx-argparse/pull/136 applied)
in order to generate the command reference for each shell command in the
manual.

As the upstream repository seems unmaintained for ~2 years, let's use
the osmcoom 'fork' with that above-mentioned patch applied.

Change-Id: I134f267cf53c7ecbc8cbfb33a8766d63bf4a8582
---
M contrib/jenkins.sh
M docs/conf.py
M docs/shell.rst
3 files changed, 55 insertions(+), 21 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/06/23606/1

diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index efb913e..60061e3 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -21,6 +21,7 @@
 # attempt to build documentation
 pip install sphinx
 pip install sphinxcontrib-napoleon
+pip3 install -e 
'git+https://github.com/osmocom/sphinx-argparse@master#egg=sphinx-argparse'
 (cd docs && make html)

 # run the test with physical cards
diff --git a/docs/conf.py b/docs/conf.py
index add26d8..2117172 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -29,6 +29,7 @@
 # ones.
 extensions = [
 "sphinx.ext.autodoc",
+"sphinxarg.ext",
 "sphinx.ext.autosectionlabel",
 "sphinx.ext.napoleon"
 ]
diff --git a/docs/shell.rst b/docs/shell.rst
index 314f633..6d3375f 100644
--- a/docs/shell.rst
+++ b/docs/shell.rst
@@ -85,32 +85,41 @@

 change_chv
 ~~
-
-This command allows you to change a CHV (PIN).
+.. argparse::
+   :module: pySim-shell
+   :func: Iso7816Commands.change_chv_parser


 disable_chv
 ~~~
+.. argparse::
+   :module: pySim-shell
+   :func: Iso7816Commands.disable_chv_parser

-This command allows you to disable a CHV (PIN).

 enable_chv
 ~~
-
-This command allows you to enable a CHV (PIN).
+.. argparse::
+   :module: pySim-shell
+   :func: Iso7816Commands.enable_chv_parser


 unblock_chv
 ~~~
+.. argparse::
+   :module: pySim-shell
+   :func: Iso7816Commands.unblock_chv_parser

-This command allows you to unblock a CHV (PIN) using the PUK.

 verify_chv
 ~~
-
 This command allows you to verify a CHV (PIN), which is how the specifications 
call
 it if you authenticate yourself with the said CHV/PIN.

+.. argparse::
+   :module: pySim-shell
+   :func: Iso7816Commands.verify_chv_parser
+


 pySim commands
@@ -128,30 +137,26 @@

 dir
 ~~~
-
-::
-
-  usage: dir [-h] [--fids] [--names] [--apps] [--all]
-
-  Show a listing of files available in currently selected DF or MF
-
-  optional arguments:
--h, --help  show this help message and exit
---fids  Show file identifiers
---names Show file names
---apps  Show applications
---all   Show all selectable identifiers and names
+.. argparse::
+   :module: pySim-shell
+   :func: PySimCommands.dir_parser


 export
 ~~
+.. argparse::
+   :module: pySim-shell
+   :func: PySimCommands.export_parser
+

 tree
 
+FIXME
+
 
 verify_adm
 ~~
-
+FIXME


 Linear Fixed EF commands
@@ -161,15 +166,30 @@

 read_record
 ~~~
+.. argparse::
+   :module: pySim.filesystem
+   :func: LinFixedEF.ShellCommands.read_rec_parser
+

 read_record_decoded
 ~~~
+.. argparse::
+   :module: pySim.filesystem
+   :func: LinFixedEF.ShellCommands.read_rec_dec_parser
+

 update_record
 ~
+.. argparse::
+   :module: pySim.filesystem
+   :func: LinFixedEF.ShellCommands.upd_rec_parser
+

 update_record_decoded
 ~
+.. argparse::
+   :module: pySim.filesystem
+   :func: LinFixedEF.ShellCommands.upd_rec_dec_parser



@@ -181,15 +201,27 @@

 read_binary
 ~~~
+.. argparse::
+   :module: pySim.filesystem
+   :func: TransparentEF.ShellCommands.read_bin_parser
+

 read_binary_decoded
 ~~~
+Read + decode data from a transparent EF

 update_binary
 ~
+.. argparse::
+   :module: pySim.filesystem
+   :func: TransparentEF.ShellCommands.upd_bin_parser
+

 update_binary_decoded
 ~
+.. argparse::
+   :module: pySim.filesystem
+   :func: TransparentEF.ShellCommands.upd_bin_dec_parser




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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I134f267cf53c7ecbc8cbfb33a8766d63bf4a8582
Gerrit-Change-Number: 23606
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in osmo-bsc[master]: Ignore CHANnel ReQuireD with Access Delay IE > 63

2021-04-04 Thread fixeria
fixeria has uploaded a new patch set (#8) to the change originally created by 
keith. ( https://gerrit.osmocom.org/c/osmo-bsc/+/23574 )

Change subject: Ignore CHANnel ReQuireD with Access Delay IE > 63
..

Ignore CHANnel ReQuireD with Access Delay IE > 63

It is observed that a CHANnel ReQuireD with access delay
greater than 63 can be received from the Ericsson RBS.
This results in osmo-bsc sending back a CHANnel ACTIVation with
a Timing Advance IE containing the access delay value.
The RBS NACKs this, leading to a BORKEN Channel.

This patch makes the maximum acceptable access delay vty-configurable
and Ignores CHANnel ReQuireD RSL Messages with Access Delay IE greater
than that configured. Default value is 63.

Related: OS#5096
Change-Id: Ie8987bcc0e43921bc753162b77a0efc68799b3ce
---
M include/osmocom/bsc/bts.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts.c
4 files changed, 33 insertions(+), 0 deletions(-)


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ie8987bcc0e43921bc753162b77a0efc68799b3ce
Gerrit-Change-Number: 23574
Gerrit-PatchSet: 8
Gerrit-Owner: keith 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-CC: laforge 
Gerrit-MessageType: newpatchset


  1   2   >