Change in osmo-ccid-firmware[master]: add sim-atr command

2019-04-16 Thread Kévin Redon
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/13681

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

Change subject: add sim-atr command
..

add sim-atr command

the sim-atr command resets the card and read the resulting
answer to reset.

Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee
---
M sysmoOCTSIM/main.c
1 file changed, 89 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/81/13681/2
--
To view, visit https://gerrit.osmocom.org/13681
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee
Gerrit-Change-Number: 13681
Gerrit-PatchSet: 2
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-ccid-firmware[master]: update ASFv4 library to 1.0.1465

2019-04-16 Thread Kévin Redon
Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/13688


Change subject: update ASFv4 library to 1.0.1465
..

update ASFv4 library to 1.0.1465

Change-Id: I828e87c7ededbb50a999d672cf0b738eef9a093a
---
M sysmoOCTSIM/atmel_start_config.atstart
M sysmoOCTSIM/hpl/dmac/hpl_dmac.c
2 files changed, 2 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/88/13688/1

diff --git a/sysmoOCTSIM/atmel_start_config.atstart 
b/sysmoOCTSIM/atmel_start_config.atstart
index f40c43a..4fda2f8 100644
--- a/sysmoOCTSIM/atmel_start_config.atstart
+++ b/sysmoOCTSIM/atmel_start_config.atstart
@@ -4,7 +4,7 @@
   api: '1.0'
   backend: 1.5.122
   commit: 820baecf7dd115d94b0d42ee3b0b9d6ba2da7113
-  content: 1.0.1405
+  content: 1.0.1465
   content_pack_name: acme-packs-all
   format: '2'
   frontend: 1.5.1826
diff --git a/sysmoOCTSIM/hpl/dmac/hpl_dmac.c b/sysmoOCTSIM/hpl/dmac/hpl_dmac.c
index 27021dd..b08448b 100644
--- a/sysmoOCTSIM/hpl/dmac/hpl_dmac.c
+++ b/sysmoOCTSIM/hpl/dmac/hpl_dmac.c
@@ -108,6 +108,7 @@
hri_dmac_write_CHPRILVL_reg(DMAC, i, _cfgs[i].prilvl);
hri_dmac_write_CHEVCTRL_reg(DMAC, i, _cfgs[i].evctrl);
hri_dmacdescriptor_write_BTCTRL_reg(&_descriptor_section[i], 
_cfgs[i].btctrl);
+   hri_dmacdescriptor_write_DESCADDR_reg(&_descriptor_section[i], 
0x0);
}

for (i = 0; i < 5; i++) {

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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I828e87c7ededbb50a999d672cf0b738eef9a093a
Gerrit-Change-Number: 13688
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 


Change in osmo-ccid-firmware[master]: minor: update atmel start project configuration

2019-04-16 Thread Kévin Redon
Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/13686


Change subject: minor: update atmel start project configuration
..

minor: update atmel start project configuration

Change-Id: I8e719f1687befb9a3657a2e582165dec3cd00094
---
M sysmoOCTSIM/atmel_start_config.atstart
1 file changed, 13 insertions(+), 13 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/86/13686/1

diff --git a/sysmoOCTSIM/atmel_start_config.atstart 
b/sysmoOCTSIM/atmel_start_config.atstart
index 51ec4f4..f40c43a 100644
--- a/sysmoOCTSIM/atmel_start_config.atstart
+++ b/sysmoOCTSIM/atmel_start_config.atstart
@@ -664,7 +664,7 @@
   enable_gclk_gen_11: true
   enable_gclk_gen_2: true
   enable_gclk_gen_3: true
-  enable_gclk_gen_4: false
+  enable_gclk_gen_4: true
   enable_gclk_gen_5: true
   enable_gclk_gen_6: false
   enable_gclk_gen_7: false
@@ -700,7 +700,7 @@
   gclk_arch_gen_3_oe: false
   gclk_arch_gen_3_oov: false
   gclk_arch_gen_3_runstdby: false
-  gclk_arch_gen_4_enable: false
+  gclk_arch_gen_4_enable: true
   gclk_arch_gen_4_idc: false
   gclk_arch_gen_4_oe: false
   gclk_arch_gen_4_oov: false
@@ -742,7 +742,7 @@
   gclk_gen_1_div: 1
   gclk_gen_1_div_sel: false
   gclk_gen_1_oscillator: Digital Frequency Locked Loop (DFLL48M)
-  gclk_gen_2_div: 1
+  gclk_gen_2_div: 30
   gclk_gen_2_div_sel: false
   gclk_gen_2_oscillator: Digital Phase Locked Loop (DPLL1)
   gclk_gen_3_div: 1
@@ -750,7 +750,7 @@
   gclk_gen_3_oscillator: 32kHz External Crystal Oscillator (XOSC32K)
   gclk_gen_4_div: 1
   gclk_gen_4_div_sel: false
-  gclk_gen_4_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+  gclk_gen_4_oscillator: Digital Phase Locked Loop (DPLL1)
   gclk_gen_5_div: 5
   gclk_gen_5_div_sel: false
   gclk_gen_5_oscillator: Digital Phase Locked Loop (DPLL1)
@@ -976,7 +976,7 @@
   usart_arch_ibon: false
   usart_arch_runstdby: false
   usart_arch_sfde: false
-  usart_baud_rate: 9600
+  usart_baud_rate: 6720
   usart_character_size: 8 bits
   usart_dsnack: The successive receive NACK is disable.
   usart_gtime: 2-bit times
@@ -1023,7 +1023,7 @@
   usart_arch_ibon: false
   usart_arch_runstdby: false
   usart_arch_sfde: false
-  usart_baud_rate: 9600
+  usart_baud_rate: 6720
   usart_character_size: 8 bits
   usart_dsnack: The successive receive NACK is disable.
   usart_gtime: 2-bit times
@@ -1070,7 +1070,7 @@
   usart_arch_ibon: false
   usart_arch_runstdby: false
   usart_arch_sfde: false
-  usart_baud_rate: 9600
+  usart_baud_rate: 6720
   usart_character_size: 8 bits
   usart_dsnack: The successive receive NACK is disable.
   usart_gtime: 2-bit times
@@ -1117,7 +1117,7 @@
   usart_arch_ibon: false
   usart_arch_runstdby: false
   usart_arch_sfde: false
-  usart_baud_rate: 9600
+  usart_baud_rate: 6720
   usart_character_size: 8 bits
   usart_dsnack: The successive receive NACK is disable.
   usart_gtime: 2-bit times
@@ -1164,7 +1164,7 @@
   usart_arch_ibon: false
   usart_arch_runstdby: false
   usart_arch_sfde: false
-  usart_baud_rate: 9600
+  usart_baud_rate: 6720
   usart_character_size: 8 bits
   usart_dsnack: The successive receive NACK is disable.
   usart_gtime: 2-bit times
@@ -1211,7 +1211,7 @@
   usart_arch_ibon: false
   usart_arch_runstdby: false
   usart_arch_sfde: false
-  usart_baud_rate: 9600
+  usart_baud_rate: 6720
   usart_character_size: 8 bits
   usart_dsnack: The successive receive NACK is disable.
   usart_gtime: 2-bit times
@@ -1258,7 +1258,7 @@
   usart_arch_ibon: false
   usart_arch_runstdby: false
   usart_arch_sfde: false
-  usart_baud_rate: 9600
+  usart_baud_rate: 6720
   usart_character_size: 8 bits
   usart_dsnack: The successive receive NACK is disable.
   usart_gtime: 2-bit times
@@ -1330,7 +1330,7 @@
   domain_group:
 nodes:
 - name: Core
-  input: Generic clock generator 2
+  input: Generic clock generator 4
   external: false
   external_frequency: 0
 - name: Slow
@@ -1338,7 +1338,7 @@
   external: false
   external_frequency: 0
 configuration:
-  core_gclk_selection: Generic clock generator 2
+  core_gclk_selection: Generic clock generator 4
   slow_gclk_selection: Generic clock generator 3
   USB_DEVICE_INSTANCE:
 user_label: USB_DEVICE_INSTANCE

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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: 

Change in osmo-ccid-firmware[master]: update CMSIS to 5.1.2

2019-04-16 Thread Kévin Redon
Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/13687


Change subject: update CMSIS to 5.1.2
..

update CMSIS to 5.1.2

this changes comes from Atmel START

Change-Id: Ib9b00107836c1604c7169d69ba607fead8c55355
---
M sysmoOCTSIM/AtmelStart.gpdsc
R sysmoOCTSIM/CMSIS/Core/Include/cmsis_armcc.h
R sysmoOCTSIM/CMSIS/Core/Include/cmsis_armclang.h
A sysmoOCTSIM/CMSIS/Core/Include/cmsis_compiler.h
R sysmoOCTSIM/CMSIS/Core/Include/cmsis_gcc.h
A sysmoOCTSIM/CMSIS/Core/Include/cmsis_iccarm.h
A sysmoOCTSIM/CMSIS/Core/Include/cmsis_version.h
R sysmoOCTSIM/CMSIS/Core/Include/core_armv8mbl.h
R sysmoOCTSIM/CMSIS/Core/Include/core_armv8mml.h
R sysmoOCTSIM/CMSIS/Core/Include/core_cm0.h
R sysmoOCTSIM/CMSIS/Core/Include/core_cm0plus.h
C sysmoOCTSIM/CMSIS/Core/Include/core_cm1.h
R sysmoOCTSIM/CMSIS/Core/Include/core_cm23.h
R sysmoOCTSIM/CMSIS/Core/Include/core_cm3.h
R sysmoOCTSIM/CMSIS/Core/Include/core_cm33.h
R sysmoOCTSIM/CMSIS/Core/Include/core_cm4.h
R sysmoOCTSIM/CMSIS/Core/Include/core_cm7.h
R sysmoOCTSIM/CMSIS/Core/Include/core_sc000.h
R sysmoOCTSIM/CMSIS/Core/Include/core_sc300.h
A sysmoOCTSIM/CMSIS/Core/Include/mpu_armv7.h
A sysmoOCTSIM/CMSIS/Core/Include/mpu_armv8.h
R sysmoOCTSIM/CMSIS/Core/Include/tz_context.h
M sysmoOCTSIM/CMSIS/Documentation/Core/html/index.html
D sysmoOCTSIM/CMSIS/Include/arm_common_tables.h
D sysmoOCTSIM/CMSIS/Include/arm_const_structs.h
D sysmoOCTSIM/CMSIS/Include/arm_math.h
D sysmoOCTSIM/CMSIS/Include/cmsis_compiler.h
M sysmoOCTSIM/gcc/Makefile
28 files changed, 29,295 insertions(+), 33,968 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/87/13687/1


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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9b00107836c1604c7169d69ba607fead8c55355
Gerrit-Change-Number: 13687
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 


Change in osmo-ccid-firmware[master]: minor: fix typo

2019-04-16 Thread Kévin Redon
Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/13682


Change subject: minor: fix typo
..

minor: fix typo

Change-Id: I57c743250af19713e7438606bc1c737cfe0c383c
---
M sysmoOCTSIM/hal/include/hal_usart_async.h
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/82/13682/1

diff --git a/sysmoOCTSIM/hal/include/hal_usart_async.h 
b/sysmoOCTSIM/hal/include/hal_usart_async.h
index 3a6de39..c883823 100644
--- a/sysmoOCTSIM/hal/include/hal_usart_async.h
+++ b/sysmoOCTSIM/hal/include/hal_usart_async.h
@@ -82,7 +82,7 @@
uint32_t flags;
/** Number of characters transmitted */
uint16_t txcnt;
-   /** Number of characters receviced */
+   /** Number of characters received */
uint16_t rxcnt;
 };


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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I57c743250af19713e7438606bc1c737cfe0c383c
Gerrit-Change-Number: 13682
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 


Change in osmo-ccid-firmware[master]: add ASFv4 M2M middleware

2019-04-16 Thread Kévin Redon
Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/13675


Change subject: add ASFv4 M2M middleware
..

add ASFv4 M2M middleware

Change-Id: Ib07755b2c5974af70817f5460fb0f358c631452a
---
M sysmoOCTSIM/AtmelStart.gpdsc
M sysmoOCTSIM/atmel_start.c
M sysmoOCTSIM/atmel_start.h
M sysmoOCTSIM/atmel_start_config.atstart
M sysmoOCTSIM/config/hpl_dmac_config.h
A sysmoOCTSIM/dma_m2m/dma_memory.c
A sysmoOCTSIM/dma_m2m/dma_memory.h
A sysmoOCTSIM/dma_m2m/dma_memory_config.h
A sysmoOCTSIM/documentation/dma_m2m.rst
M sysmoOCTSIM/gcc/Makefile
10 files changed, 359 insertions(+), 19 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/75/13675/1

diff --git a/sysmoOCTSIM/AtmelStart.gpdsc b/sysmoOCTSIM/AtmelStart.gpdsc
index 5d35944..05dcb15 100644
--- a/sysmoOCTSIM/AtmelStart.gpdsc
+++ b/sysmoOCTSIM/AtmelStart.gpdsc
@@ -164,6 +164,9 @@
 
 
 
+
+
+
 
 
 
@@ -210,6 +213,8 @@
 
 
 
+
+
 
 
 
@@ -225,6 +230,7 @@
 
 
 
+
 
 
 
@@ -251,6 +257,8 @@
 
 
 
+
+
 
 
 
diff --git a/sysmoOCTSIM/atmel_start.c b/sysmoOCTSIM/atmel_start.c
index fc6016a..fd566dd 100644
--- a/sysmoOCTSIM/atmel_start.c
+++ b/sysmoOCTSIM/atmel_start.c
@@ -1,5 +1,11 @@
 #include 

+/** Memory to memory DMA callback */
+static void M2M_DMA_complete_cb(void)
+{
+   dma_m2m_complete_flag = true;
+}
+
 /**
  * Initializes MCU, drivers and middleware in the project
  **/
@@ -7,5 +13,7 @@
 {
system_init();
usb_init();
+   dma_memory_init();
+   dma_memory_register_callback(DMA_MEMORY_COMPLETE_CB, 
M2M_DMA_complete_cb);
stdio_redirect_init();
 }
diff --git a/sysmoOCTSIM/atmel_start.h b/sysmoOCTSIM/atmel_start.h
index 92afa47..4892cbd 100644
--- a/sysmoOCTSIM/atmel_start.h
+++ b/sysmoOCTSIM/atmel_start.h
@@ -5,10 +5,15 @@
 extern "C" {
 #endif

+#include 
+
 #include "driver_init.h"
 #include "usb_start.h"
 #include "stdio_start.h"

+/** flag set when the memory to memory DMA is complete */
+volatile bool dma_m2m_complete_flag;
+
 /**
  * Initializes MCU, drivers and middleware in the project
  **/
diff --git a/sysmoOCTSIM/atmel_start_config.atstart 
b/sysmoOCTSIM/atmel_start_config.atstart
index 290fa89..51ec4f4 100644
--- a/sysmoOCTSIM/atmel_start_config.atstart
+++ b/sysmoOCTSIM/atmel_start_config.atstart
@@ -82,6 +82,15 @@
 dependencies:
   USB Device Stack Core Instance: USB_DEVICE_STACK_CORE_INSTANCE
   USB Class CDC: USB_CLASS_CDC
+  M2M_DMA_0:
+user_label: M2M_DMA_0
+configuration:
+  conf_channel: 0
+definition: Atmel:MEMORY_DMA:0.0.1::M2M_DMA
+functionality: M2M_DMA
+api: DMA:M2M:Core
+dependencies:
+  DMAC: DMAC
   STDIO_REDIRECT_0:
 user_label: STDIO_REDIRECT_0
 configuration: {}
@@ -209,7 +218,7 @@
 the transaction
   dmac_blockact_9: Channel will be disabled if it is the last block 
transfer in
 the transaction
-  dmac_channel_0_settings: false
+  dmac_channel_0_settings: true
   dmac_channel_10_settings: false
   dmac_channel_11_settings: false
   dmac_channel_12_settings: false
@@ -242,7 +251,7 @@
   dmac_channel_8_settings: false
   dmac_channel_9_settings: false
   dmac_dbgrun: false
-  dmac_dstinc_0: false
+  dmac_dstinc_0: true
   dmac_dstinc_1: false
   dmac_dstinc_10: false
   dmac_dstinc_11: false
@@ -274,7 +283,7 @@
   dmac_dstinc_7: false
   dmac_dstinc_8: false
   dmac_dstinc_9: false
-  dmac_enable: false
+  dmac_enable: true
   dmac_evact_0: No action
   dmac_evact_1: No action
   dmac_evact_10: No action
@@ -479,7 +488,7 @@
   dmac_runstdby_7: false
   dmac_runstdby_8: false
   dmac_runstdby_9: false
-  dmac_srcinc_0: false
+  dmac_srcinc_0: true
   dmac_srcinc_1: false
   dmac_srcinc_10: false
   dmac_srcinc_11: false
diff --git a/sysmoOCTSIM/config/hpl_dmac_config.h 
b/sysmoOCTSIM/config/hpl_dmac_config.h
index 90499fc..c736778 100644
--- a/sysmoOCTSIM/config/hpl_dmac_config.h
+++ b/sysmoOCTSIM/config/hpl_dmac_config.h
@@ -8,7 +8,7 @@
 //  Indicates whether dmac is enabled or not
 //  dmac_enable
 #ifndef CONF_DMAC_ENABLE
-#define CONF_DMAC_ENABLE 0
+#define CONF_DMAC_ENABLE 1
 #endif

 //  Priority Level 0
@@ -105,7 +105,7 @@
 //  Channel 0 settings
 //  dmac_channel_0_settings
 #ifndef CONF_DMAC_CHANNEL_0_SETTINGS
-#define CONF_DMAC_CHANNEL_0_SETTINGS 0
+#define CONF_DMAC_CHANNEL_0_SETTINGS 1
 #endif

 //  Channel Run in Standby
@@ -284,14 +284,14 @@
 //  Indicates whether the source address incrementation is enabled or not
 //  dmac_srcinc_0
 #ifndef CONF_DMAC_SRCINC_0
-#define CONF_DMAC_SRCINC_0 0
+#define CONF_DMAC_SRCINC_0 1
 

Change in osmo-ccid-firmware[master]: minor: improve documentation

2019-04-16 Thread Kévin Redon
Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/13683


Change subject: minor: improve documentation
..

minor: improve documentation

Change-Id: I250209d45a57c5ad7d1265a68aa71fc31ec06f69
---
M sysmoOCTSIM/ncn8025.h
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/83/13683/1

diff --git a/sysmoOCTSIM/ncn8025.h b/sysmoOCTSIM/ncn8025.h
index 89b7f86..48d2a58 100644
--- a/sysmoOCTSIM/ncn8025.h
+++ b/sysmoOCTSIM/ncn8025.h
@@ -15,8 +15,8 @@
 };

 struct ncn8025_settings {
-   bool rstin; /* high: active */
-   bool cmdvcc;/* high: active */
+   bool rstin; /* Reset signal (true: de-asserted high) */
+   bool cmdvcc;/* Command VCC pin. Activation sequence Enable (true: 
active low) */
bool simpres;   /* high: active */
bool led;   /* high: active */
bool interrupt; /* high: active */

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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I250209d45a57c5ad7d1265a68aa71fc31ec06f69
Gerrit-Change-Number: 13683
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 


Change in osmo-ccid-firmware[master]: remove SWO pin initialisation

2019-04-16 Thread Kévin Redon
Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/13674


Change subject: remove SWO pin initialisation
..

remove SWO pin initialisation

Change-Id: I199d6e356129526e65d5d1075a264eb35904d099
---
M sysmoOCTSIM/driver_init.c
1 file changed, 0 insertions(+), 47 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/74/13674/1

diff --git a/sysmoOCTSIM/driver_init.c b/sysmoOCTSIM/driver_init.c
index 0d5bb53..8a50925 100644
--- a/sysmoOCTSIM/driver_init.c
+++ b/sysmoOCTSIM/driver_init.c
@@ -723,53 +723,6 @@

gpio_set_pin_function(SDA1, GPIO_PIN_FUNCTION_OFF);

-   // GPIO on PB30
-
-   gpio_set_pin_direction(UART_TX,
-  //  Pin direction
-  //  pad_direction
-  //  Off
-  //  In
-  //  Out
-  GPIO_DIRECTION_OUT);
-
-   gpio_set_pin_level(UART_TX,
-  //  Initial level
-  //  pad_initial_level
-  //  Low
-  //  High
-  false);
-
-   gpio_set_pin_pull_mode(UART_TX,
-  //  Pull configuration
-  //  pad_pull_config
-  //  Off
-  //  Pull-up
-  //  Pull-down
-  GPIO_PULL_OFF);
-
-   gpio_set_pin_function(UART_TX,
- //  Pin function
- //  pad_function
- //  Auto : use driver pinmux if signal is 
imported by driver, else turn off function
- //  Auto
- //  Off
- //  A
- //  B
- //  C
- //  D
- //  E
- //  F
- //  G
- //  H
- //  I
- //  J
- //  K
- //  L
- //  M
- //  N
- GPIO_PIN_FUNCTION_H);
-
// GPIO on PC00

// Set pin direction to input

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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I199d6e356129526e65d5d1075a264eb35904d099
Gerrit-Change-Number: 13674
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 


Change in osmo-ccid-firmware[master]: minor: remove unnecessary hellow world command

2019-04-16 Thread Kévin Redon
Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/13685


Change subject: minor: remove unnecessary hellow world command
..

minor: remove unnecessary hellow world command

Change-Id: I414b2ddd0bacff692316fe212b9d3b506100a7ba
---
M sysmoOCTSIM/main.c
1 file changed, 0 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/85/13685/1

diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c
index 788343e..8d51161 100644
--- a/sysmoOCTSIM/main.c
+++ b/sysmoOCTSIM/main.c
@@ -68,12 +68,6 @@
}
 }

-DEFUN(hello_fn, cmd_hello,
-   "hello", "Hello World example command")
-{
-   printf("Hello World!\r\n");
-}
-
 static int validate_slotnr(int argc, char **argv, int idx)
 {
int slotnr;
@@ -308,7 +302,6 @@
board_init();

command_init("sysmoOCTSIM> ");
-   command_register(_hello);
command_register(_sim_status);
command_register(_sim_power);
command_register(_sim_reset);

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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I414b2ddd0bacff692316fe212b9d3b506100a7ba
Gerrit-Change-Number: 13685
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 


Change in osmo-ccid-firmware[master]: change SERCOM clock to 3.3 MHz

2019-04-16 Thread Kévin Redon
Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/13680


Change subject: change SERCOM clock to 3.3 MHz
..

change SERCOM clock to 3.3 MHz

we use the SERCOM peripheral for USART (in 7816 mode SIM card
communication) in synchronous mode (TX and RX clock are the same).
in this mode only the 8 least significant bits of the BAUD register
are used (see TRM 33.6.2.3 Clock Generation – Baud-Rate Generator).
When the SERCOM is clocked at 100 MHz the minimum resulting baud
rate would be 100E6 / (2 * 255 + 1) = 195694 bps.
clocking SERCOM at 3.33 MHz also to have a baud rate of 6720 bps
(~ 3.33E6 / (2 * 247 + 1)), used after reset to read the ATR.

Change-Id: Id60322e092a6652a89821fc737d5336d79a1420c
---
M sysmoOCTSIM/config/hpl_gclk_config.h
M sysmoOCTSIM/config/peripheral_clk_config.h
2 files changed, 12 insertions(+), 12 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/80/13680/1

diff --git a/sysmoOCTSIM/config/hpl_gclk_config.h 
b/sysmoOCTSIM/config/hpl_gclk_config.h
index 6b7586c..71c26e1 100644
--- a/sysmoOCTSIM/config/hpl_gclk_config.h
+++ b/sysmoOCTSIM/config/hpl_gclk_config.h
@@ -226,7 +226,7 @@
 // Generic clock generator 2 division <0x-0x>
 //  gclk_gen_2_div
 #ifndef CONF_GCLK_GEN_2_DIV
-#define CONF_GCLK_GEN_2_DIV 1
+#define CONF_GCLK_GEN_2_DIV 30
 #endif
 // 
 // 
@@ -311,7 +311,7 @@
 //  Indicates whether generic clock 4 configuration is enabled or not
 //  enable_gclk_gen_4
 #ifndef CONF_GCLK_GENERATOR_4_CONFIG
-#define CONF_GCLK_GENERATOR_4_CONFIG 0
+#define CONF_GCLK_GENERATOR_4_CONFIG 1
 #endif

 //  Generic Clock Generator Control
@@ -328,7 +328,7 @@
 //  This defines the clock source for generic clock generator 4
 //  gclk_gen_4_oscillator
 #ifndef CONF_GCLK_GEN_4_SOURCE
-#define CONF_GCLK_GEN_4_SOURCE GCLK_GENCTRL_SRC_XOSC1
+#define CONF_GCLK_GEN_4_SOURCE GCLK_GENCTRL_SRC_DPLL1
 #endif

 //  Run in Standby
@@ -370,7 +370,7 @@
 //  Indicates whether Generic Clock Generator Enable is enabled or not
 //  gclk_arch_gen_4_enable
 #ifndef CONF_GCLK_GEN_4_GENEN
-#define CONF_GCLK_GEN_4_GENEN 0
+#define CONF_GCLK_GEN_4_GENEN 1
 #endif
 // 

diff --git a/sysmoOCTSIM/config/peripheral_clk_config.h 
b/sysmoOCTSIM/config/peripheral_clk_config.h
index 91c5c86..4bff6ff 100644
--- a/sysmoOCTSIM/config/peripheral_clk_config.h
+++ b/sysmoOCTSIM/config/peripheral_clk_config.h
@@ -81,7 +81,7 @@
  * \brief SERCOM0's Core Clock frequency
  */
 #ifndef CONF_GCLK_SERCOM0_CORE_FREQUENCY
-#define CONF_GCLK_SERCOM0_CORE_FREQUENCY 1
+#define CONF_GCLK_SERCOM0_CORE_FREQUENCY 333
 #endif

 /**
@@ -161,7 +161,7 @@
  * \brief SERCOM1's Core Clock frequency
  */
 #ifndef CONF_GCLK_SERCOM1_CORE_FREQUENCY
-#define CONF_GCLK_SERCOM1_CORE_FREQUENCY 1
+#define CONF_GCLK_SERCOM1_CORE_FREQUENCY 333
 #endif

 /**
@@ -241,7 +241,7 @@
  * \brief SERCOM2's Core Clock frequency
  */
 #ifndef CONF_GCLK_SERCOM2_CORE_FREQUENCY
-#define CONF_GCLK_SERCOM2_CORE_FREQUENCY 1
+#define CONF_GCLK_SERCOM2_CORE_FREQUENCY 333
 #endif

 /**
@@ -321,7 +321,7 @@
  * \brief SERCOM3's Core Clock frequency
  */
 #ifndef CONF_GCLK_SERCOM3_CORE_FREQUENCY
-#define CONF_GCLK_SERCOM3_CORE_FREQUENCY 1
+#define CONF_GCLK_SERCOM3_CORE_FREQUENCY 333
 #endif

 /**
@@ -401,7 +401,7 @@
  * \brief SERCOM4's Core Clock frequency
  */
 #ifndef CONF_GCLK_SERCOM4_CORE_FREQUENCY
-#define CONF_GCLK_SERCOM4_CORE_FREQUENCY 1
+#define CONF_GCLK_SERCOM4_CORE_FREQUENCY 333
 #endif

 /**
@@ -481,7 +481,7 @@
  * \brief SERCOM5's Core Clock frequency
  */
 #ifndef CONF_GCLK_SERCOM5_CORE_FREQUENCY
-#define CONF_GCLK_SERCOM5_CORE_FREQUENCY 1
+#define CONF_GCLK_SERCOM5_CORE_FREQUENCY 333
 #endif

 /**
@@ -561,7 +561,7 @@
  * \brief SERCOM6's Core Clock frequency
  */
 #ifndef CONF_GCLK_SERCOM6_CORE_FREQUENCY
-#define CONF_GCLK_SERCOM6_CORE_FREQUENCY 1
+#define CONF_GCLK_SERCOM6_CORE_FREQUENCY 333
 #endif

 /**
@@ -601,7 +601,7 @@

 //  Select the clock source for CORE.
 #ifndef CONF_GCLK_SERCOM7_CORE_SRC
-#define CONF_GCLK_SERCOM7_CORE_SRC GCLK_PCHCTRL_GEN_GCLK2_Val
+#define CONF_GCLK_SERCOM7_CORE_SRC GCLK_PCHCTRL_GEN_GCLK4_Val
 #endif

 //  Slow Clock Source

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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id60322e092a6652a89821fc737d5336d79a1420c
Gerrit-Change-Number: 13680
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 


Change in osmo-ccid-firmware[master]: minor: change variable type to remove compiler warning

2019-04-16 Thread Kévin Redon
Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/13684


Change subject: minor: change variable type to remove compiler warning
..

minor: change variable type to remove compiler warning

Change-Id: I8f537d6cbec820ad0406ec2ff0c9735759169fc0
---
M sysmoOCTSIM/command.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/84/13684/1

diff --git a/sysmoOCTSIM/command.c b/sysmoOCTSIM/command.c
index 327a1a0..8fbaec4 100644
--- a/sysmoOCTSIM/command.c
+++ b/sysmoOCTSIM/command.c
@@ -78,7 +78,7 @@
/* yield CPU after maximum of 10 received characters */
while (usart_async_rings_is_rx_not_empty(_debug) && (i < 10)) {
gpio_toggle_pin_level(USER_LED); // toggle LED to show we 
received something
-   int c = getchar();
+   char c = getchar();
if (c < 0)
return;
putchar(c);

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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f537d6cbec820ad0406ec2ff0c9735759169fc0
Gerrit-Change-Number: 13684
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 


Change in osmo-ccid-firmware[master]: UART_debug now uses the async library with tx ring

2019-04-16 Thread Kévin Redon
Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/13678


Change subject: UART_debug now uses the async library with tx ring
..

UART_debug now uses the async library with tx ring

Change-Id: I4cf689a8d3dc292201f1e2ce6c013aa1686ad6bc
---
M sysmoOCTSIM/command.c
M sysmoOCTSIM/driver_init.c
M sysmoOCTSIM/driver_init.h
M sysmoOCTSIM/stdio_start.c
4 files changed, 12 insertions(+), 17 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/78/13678/1

diff --git a/sysmoOCTSIM/command.c b/sysmoOCTSIM/command.c
index 7ac5662..327a1a0 100644
--- a/sysmoOCTSIM/command.c
+++ b/sysmoOCTSIM/command.c
@@ -76,7 +76,7 @@
unsigned int i = 0;

/* yield CPU after maximum of 10 received characters */
-   while (usart_async_is_rx_not_empty(_debug) && (i < 10)) {
+   while (usart_async_rings_is_rx_not_empty(_debug) && (i < 10)) {
gpio_toggle_pin_level(USER_LED); // toggle LED to show we 
received something
int c = getchar();
if (c < 0)
diff --git a/sysmoOCTSIM/driver_init.c b/sysmoOCTSIM/driver_init.c
index 8a50925..0b6b190 100644
--- a/sysmoOCTSIM/driver_init.c
+++ b/sysmoOCTSIM/driver_init.c
@@ -33,7 +33,7 @@
 #define SIM6_BUFFER_SIZE 16

 /*! The buffer size for USART */
-#define UART_DEBUG_BUFFER_SIZE 32
+#define UART_DEBUG_BUFFER_SIZE 256

 struct usart_async_descriptor SIM0;
 struct usart_async_descriptor SIM1;
@@ -51,9 +51,10 @@
 static uint8_t SIM5_buffer[SIM5_BUFFER_SIZE];
 static uint8_t SIM6_buffer[SIM6_BUFFER_SIZE];

-struct usart_async_descriptor UART_debug;
+struct usart_async_rings_descriptor UART_debug;

-static uint8_t UART_DEBUG_buffer[UART_DEBUG_BUFFER_SIZE];
+static uint8_t UART_DEBUG_buffer_rx[UART_DEBUG_BUFFER_SIZE];
+static uint8_t UART_DEBUG_buffer_tx[UART_DEBUG_BUFFER_SIZE];

 /**
  * \brief USART Clock initialization function
@@ -349,7 +350,7 @@
 void UART_debug_init(void)
 {
UART_debug_CLOCK_init();
-   usart_async_init(_debug, SERCOM7, UART_DEBUG_buffer, 
UART_DEBUG_BUFFER_SIZE, (void *)NULL);
+   usart_async_rings_init(_debug, SERCOM7, UART_DEBUG_buffer_rx, 
UART_DEBUG_BUFFER_SIZE, UART_DEBUG_buffer_tx, UART_DEBUG_BUFFER_SIZE, (void 
*)NULL);
UART_debug_PORT_init();
 }

diff --git a/sysmoOCTSIM/driver_init.h b/sysmoOCTSIM/driver_init.h
index 9d009b9..6c4f3a1 100644
--- a/sysmoOCTSIM/driver_init.h
+++ b/sysmoOCTSIM/driver_init.h
@@ -21,15 +21,9 @@
 #include 
 #include 

-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
 #include 
+#include 
+#include 

 #include "hal_usb_device.h"

@@ -40,7 +34,7 @@
 extern struct usart_async_descriptor SIM4;
 extern struct usart_async_descriptor SIM5;
 extern struct usart_async_descriptor SIM6;
-extern struct usart_async_descriptor UART_debug;
+extern struct usart_async_rings_descriptor UART_debug;

 void SIM0_PORT_init(void);
 void SIM0_CLOCK_init(void);
diff --git a/sysmoOCTSIM/stdio_start.c b/sysmoOCTSIM/stdio_start.c
index e2fb0c2..8a15c88 100644
--- a/sysmoOCTSIM/stdio_start.c
+++ b/sysmoOCTSIM/stdio_start.c
@@ -9,13 +9,13 @@
 #include "atmel_start.h"
 #include "stdio_start.h"

-static void UART_debug_rx_cb(const struct usart_async_descriptor *const 
io_descr)
+static void UART_debug_rx_cb(const struct usart_async_rings_descriptor *const 
io_descr)
 {
 }

 void stdio_redirect_init(void)
 {
-   usart_async_register_callback(_debug, USART_ASYNC_RXC_CB, 
UART_debug_rx_cb); // if no callback function is registered receive won't work, 
even if the callback does nothing
-   usart_async_enable(_debug);
+   usart_async_rings_register_callback(_debug, USART_ASYNC_RXC_CB, 
UART_debug_rx_cb); // if no callback function is registered receive won't work, 
even if the callback does nothing
+   usart_async_rings_enable(_debug);
stdio_io_init(_debug.io);
 }

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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4cf689a8d3dc292201f1e2ce6c013aa1686ad6bc
Gerrit-Change-Number: 13678
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 


Change in osmo-ccid-firmware[master]: add async library with ring on TX

2019-04-16 Thread Kévin Redon
Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/13677


Change subject: add async library with ring on TX
..

add async library with ring on TX

the standard async library expected the caller to wait until the
transmission was complete (by counting using the transmit callback
or checking using usart_async_get_status) before freeing/reusing
the memory holding the data to be transmitted.
this is not practical when using stdio on top of the peripheral
since printf returns directly and reuses the memory.
the new USART async library has a ring buffer for the data to be
transmitted (similar to the data being received).

WARNING: the ring buffer library overwrites old data when the
buffer size is exceeded. We do not prevent this since don't want
to block. To prevent this behaviour, provide a large enough buffer
of check the buffer status yourself using usart_async_get_status.

Change-Id: Iafd5295b90ef9f428f640314c24f6c31ee82c9d6
---
M sysmoOCTSIM/gcc/Makefile
A sysmoOCTSIM/hal/include/hal_usart_async_rings.h
A sysmoOCTSIM/hal/src/hal_usart_async_rings.c
3 files changed, 767 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/77/13677/1

diff --git a/sysmoOCTSIM/gcc/Makefile b/sysmoOCTSIM/gcc/Makefile
index bd4bdb0..046970f 100644
--- a/sysmoOCTSIM/gcc/Makefile
+++ b/sysmoOCTSIM/gcc/Makefile
@@ -84,6 +84,7 @@
 hpl/osc32kctrl/hpl_osc32kctrl.o \
 driver_init.o \
 hal/src/hal_usart_async.o \
+hal/src/hal_usart_async_rings.o \
 hpl/sercom/hpl_sercom.o \
 hal/utils/src/utils_ringbuffer.o \
 main.o \
@@ -131,6 +132,7 @@
 "hpl/osc32kctrl/hpl_osc32kctrl.o" \
 "driver_init.o" \
 "hal/src/hal_usart_async.o" \
+"hal/src/hal_usart_async_rings.o" \
 "hpl/sercom/hpl_sercom.o" \
 "hal/utils/src/utils_ringbuffer.o" \
 "main.o" \
@@ -177,6 +179,7 @@
 "driver_init.d" \
 "stdio_redirect/gcc/read.d" \
 "hal/src/hal_usart_async.d" \
+"hal/src/hal_usart_async_rings.d" \
 "hpl/osc32kctrl/hpl_osc32kctrl.d" \
 "i2c_bitbang.d" \
 "octsim_i2c.d" \
diff --git a/sysmoOCTSIM/hal/include/hal_usart_async_rings.h 
b/sysmoOCTSIM/hal/include/hal_usart_async_rings.h
new file mode 100644
index 000..c66e21c
--- /dev/null
+++ b/sysmoOCTSIM/hal/include/hal_usart_async_rings.h
@@ -0,0 +1,341 @@
+/**
+ * \file
+ *
+ * \brief USART related functionality declaration.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ * Copyright (C) 2019 sysmocom -s.f.m.c. GmbH, Author: Kevin Redon 

+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms 
applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE.  TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HAL_USART_ASYNC_RINGS_H_INCLUDED
+#define _HAL_USART_ASYNC_RINGS_H_INCLUDED
+
+#include "hal_io.h"
+#include 
+#include 
+
+/**
+ * \addtogroup doc_driver_hal_usart_async
+ *
+ * @{
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief USART descriptor
+ *
+ * The USART descriptor forward declaration.
+ */
+struct usart_async_rings_descriptor;
+
+/**
+ * \brief USART callback type
+ */
+typedef void (*usart_rings_cb_t)(const struct usart_async_rings_descriptor 
*const descr);
+
+/**
+ * \brief USART callback types
+ */
+enum usart_async_rings_callback_type { USART_ASYNC_RINGS_RXC_CB, 
USART_ASYNC_RINGS_TXC_CB, USART_ASYNC_RINGS_ERROR_CB };
+
+/**
+ * \brief USART callbacks
+ */
+struct usart_async_rings_callbacks {
+   usart_rings_cb_t tx_done;
+   usart_rings_cb_t rx_done;
+   usart_rings_cb_t error;
+};
+
+/** \brief USART status
+ *  Status descriptor holds the current status of transfer.
+ */
+struct usart_async_rings_status {
+   /** Status flags */
+   uint32_t flags;
+   /** Number of characters transmitted */
+   uint16_t txcnt;
+   /** Number of characters receviced */
+   uint16_t rxcnt;
+};
+
+/**
+ * \brief Asynchronous USART 

Change in osmo-ccid-firmware[master]: remove example code

2019-04-16 Thread Kévin Redon
Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/13676


Change subject: remove example code
..

remove example code

as the code will use alternative libraries, the examples will not
be able to compile anymore.
plus they are not required for the firmware and the example code
can be downloaded from atmel start.

Change-Id: If53df47089de9eb8498734c19d6a0420c1e79031
---
D sysmoOCTSIM/examples/driver_examples.c
D sysmoOCTSIM/examples/driver_examples.h
M sysmoOCTSIM/gcc/Makefile
3 files changed, 3 insertions(+), 284 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/76/13676/1

diff --git a/sysmoOCTSIM/examples/driver_examples.c 
b/sysmoOCTSIM/examples/driver_examples.c
deleted file mode 100644
index 14f1ae5..000
--- a/sysmoOCTSIM/examples/driver_examples.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Code generated from Atmel Start.
- *
- * This file will be overwritten when reconfiguring your Atmel Start project.
- * Please copy examples or other code you want to keep to a separate file
- * to avoid losing it when reconfiguring.
- */
-
-#include "driver_examples.h"
-#include "driver_init.h"
-#include "utils.h"
-
-/**
- * Example of using SIM0 to write "Hello World" using the IO abstraction.
- *
- * Since the driver is asynchronous we need to use statically allocated memory 
for string
- * because driver initiates transfer and then returns before the transmission 
is completed.
- *
- * Once transfer has been completed the tx_cb function will be called.
- */
-
-static uint8_t example_SIM0[12] = "Hello World!";
-
-static void tx_cb_SIM0(const struct usart_async_descriptor *const io_descr)
-{
-   /* Transfer completed */
-}
-
-void SIM0_example(void)
-{
-   struct io_descriptor *io;
-
-   usart_async_register_callback(, USART_ASYNC_TXC_CB, tx_cb_SIM0);
-   /*usart_async_register_callback(, USART_ASYNC_RXC_CB, rx_cb);
-   usart_async_register_callback(, USART_ASYNC_ERROR_CB, err_cb);*/
-   usart_async_get_io_descriptor(, );
-   usart_async_enable();
-
-   io_write(io, example_SIM0, 12);
-}
-
-/**
- * Example of using SIM1 to write "Hello World" using the IO abstraction.
- *
- * Since the driver is asynchronous we need to use statically allocated memory 
for string
- * because driver initiates transfer and then returns before the transmission 
is completed.
- *
- * Once transfer has been completed the tx_cb function will be called.
- */
-
-static uint8_t example_SIM1[12] = "Hello World!";
-
-static void tx_cb_SIM1(const struct usart_async_descriptor *const io_descr)
-{
-   /* Transfer completed */
-}
-
-void SIM1_example(void)
-{
-   struct io_descriptor *io;
-
-   usart_async_register_callback(, USART_ASYNC_TXC_CB, tx_cb_SIM1);
-   /*usart_async_register_callback(, USART_ASYNC_RXC_CB, rx_cb);
-   usart_async_register_callback(, USART_ASYNC_ERROR_CB, err_cb);*/
-   usart_async_get_io_descriptor(, );
-   usart_async_enable();
-
-   io_write(io, example_SIM1, 12);
-}
-
-/**
- * Example of using SIM2 to write "Hello World" using the IO abstraction.
- *
- * Since the driver is asynchronous we need to use statically allocated memory 
for string
- * because driver initiates transfer and then returns before the transmission 
is completed.
- *
- * Once transfer has been completed the tx_cb function will be called.
- */
-
-static uint8_t example_SIM2[12] = "Hello World!";
-
-static void tx_cb_SIM2(const struct usart_async_descriptor *const io_descr)
-{
-   /* Transfer completed */
-}
-
-void SIM2_example(void)
-{
-   struct io_descriptor *io;
-
-   usart_async_register_callback(, USART_ASYNC_TXC_CB, tx_cb_SIM2);
-   /*usart_async_register_callback(, USART_ASYNC_RXC_CB, rx_cb);
-   usart_async_register_callback(, USART_ASYNC_ERROR_CB, err_cb);*/
-   usart_async_get_io_descriptor(, );
-   usart_async_enable();
-
-   io_write(io, example_SIM2, 12);
-}
-
-/**
- * Example of using SIM3 to write "Hello World" using the IO abstraction.
- *
- * Since the driver is asynchronous we need to use statically allocated memory 
for string
- * because driver initiates transfer and then returns before the transmission 
is completed.
- *
- * Once transfer has been completed the tx_cb function will be called.
- */
-
-static uint8_t example_SIM3[12] = "Hello World!";
-
-static void tx_cb_SIM3(const struct usart_async_descriptor *const io_descr)
-{
-   /* Transfer completed */
-}
-
-void SIM3_example(void)
-{
-   struct io_descriptor *io;
-
-   usart_async_register_callback(, USART_ASYNC_TXC_CB, tx_cb_SIM3);
-   /*usart_async_register_callback(, USART_ASYNC_RXC_CB, rx_cb);
-   usart_async_register_callback(, USART_ASYNC_ERROR_CB, err_cb);*/
-   usart_async_get_io_descriptor(, );
-   usart_async_enable();
-
-   io_write(io, example_SIM3, 12);
-}
-
-/**
- * Example of using SIM4 to 

Change in osmo-ccid-firmware[master]: change ISO baud rate default to 6720 bps

2019-04-16 Thread Kévin Redon
Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/13679


Change subject: change ISO baud rate default to 6720 bps
..

change ISO baud rate default to 6720 bps

the ISO7816 I/O baud rate is f / (Fd / Dd), with Fd 372, Dd = 1.
f_max is 4 MHz, but we will use the minimum 20 / 8 = 2.5 MHz,
thus the baud rate after reset will be 6720 bps.

Change-Id: I9165575404f070c7429daaa3593838d08a5c5e10
---
M sysmoOCTSIM/config/hpl_sercom_config.h
1 file changed, 7 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/79/13679/1

diff --git a/sysmoOCTSIM/config/hpl_sercom_config.h 
b/sysmoOCTSIM/config/hpl_sercom_config.h
index 735fdc2..beac040 100644
--- a/sysmoOCTSIM/config/hpl_sercom_config.h
+++ b/sysmoOCTSIM/config/hpl_sercom_config.h
@@ -59,7 +59,7 @@
 //  USART baud rate setting
 //  usart_baud_rate
 #ifndef CONF_SERCOM_0_USART_BAUD
-#define CONF_SERCOM_0_USART_BAUD 9600
+#define CONF_SERCOM_0_USART_BAUD 6720
 #endif
 // 

@@ -331,7 +331,7 @@
 //  USART baud rate setting
 //  usart_baud_rate
 #ifndef CONF_SERCOM_1_USART_BAUD
-#define CONF_SERCOM_1_USART_BAUD 9600
+#define CONF_SERCOM_1_USART_BAUD 6720
 #endif
 // 

@@ -603,7 +603,7 @@
 //  USART baud rate setting
 //  usart_baud_rate
 #ifndef CONF_SERCOM_2_USART_BAUD
-#define CONF_SERCOM_2_USART_BAUD 9600
+#define CONF_SERCOM_2_USART_BAUD 6720
 #endif
 // 

@@ -875,7 +875,7 @@
 //  USART baud rate setting
 //  usart_baud_rate
 #ifndef CONF_SERCOM_3_USART_BAUD
-#define CONF_SERCOM_3_USART_BAUD 9600
+#define CONF_SERCOM_3_USART_BAUD 6720
 #endif
 // 

@@ -1147,7 +1147,7 @@
 //  USART baud rate setting
 //  usart_baud_rate
 #ifndef CONF_SERCOM_4_USART_BAUD
-#define CONF_SERCOM_4_USART_BAUD 9600
+#define CONF_SERCOM_4_USART_BAUD 6720
 #endif
 // 

@@ -1419,7 +1419,7 @@
 //  USART baud rate setting
 //  usart_baud_rate
 #ifndef CONF_SERCOM_5_USART_BAUD
-#define CONF_SERCOM_5_USART_BAUD 9600
+#define CONF_SERCOM_5_USART_BAUD 6720
 #endif
 // 

@@ -1691,7 +1691,7 @@
 //  USART baud rate setting
 //  usart_baud_rate
 #ifndef CONF_SERCOM_6_USART_BAUD
-#define CONF_SERCOM_6_USART_BAUD 9600
+#define CONF_SERCOM_6_USART_BAUD 6720
 #endif
 // 


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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9165575404f070c7429daaa3593838d08a5c5e10
Gerrit-Change-Number: 13679
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 


Change in osmo-ccid-firmware[master]: switch UART_debug to ASYNC

2019-04-16 Thread Kévin Redon
Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/13673


Change subject: switch UART_debug to ASYNC
..

switch UART_debug to ASYNC

using the synchronous HAL library causes RX overflow after 5 bytes
on bulk incoming data (e.g. pasted).
this mainly due to printing synchronously the character, but to
further prevent congestion we switch to asynchronous (e.g.
interrupt driven) communication.

The RX part works great now (no overflow), but the TX part is
malfunctioning because the HAL Async library does not buffer the
data to be transmitted and expects it to be in memory until
the transmission is complete (which printf does not do).

This change will not be reflected in Atmel START since it does not
allow to set the underlying STDIO redirect peripheral to async.

Change-Id: If18883e96f336aa9f6b11607859260da5e1503c7
---
M sysmoOCTSIM/command.c
M sysmoOCTSIM/driver_init.c
M sysmoOCTSIM/driver_init.h
M sysmoOCTSIM/examples/driver_examples.c
M sysmoOCTSIM/hpl/sercom/hpl_sercom.c
M sysmoOCTSIM/main.c
M sysmoOCTSIM/stdio_start.c
7 files changed, 94 insertions(+), 28 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/73/13673/1

diff --git a/sysmoOCTSIM/command.c b/sysmoOCTSIM/command.c
index 9502f05..7ac5662 100644
--- a/sysmoOCTSIM/command.c
+++ b/sysmoOCTSIM/command.c
@@ -76,7 +76,8 @@
unsigned int i = 0;

/* yield CPU after maximum of 10 received characters */
-   while (usart_sync_is_rx_not_empty(_debug) && (i < 10)) {
+   while (usart_async_is_rx_not_empty(_debug) && (i < 10)) {
+   gpio_toggle_pin_level(USER_LED); // toggle LED to show we 
received something
int c = getchar();
if (c < 0)
return;
diff --git a/sysmoOCTSIM/driver_init.c b/sysmoOCTSIM/driver_init.c
index 06184ee..0d5bb53 100644
--- a/sysmoOCTSIM/driver_init.c
+++ b/sysmoOCTSIM/driver_init.c
@@ -32,6 +32,9 @@
 /*! The buffer size for USART */
 #define SIM6_BUFFER_SIZE 16

+/*! The buffer size for USART */
+#define UART_DEBUG_BUFFER_SIZE 32
+
 struct usart_async_descriptor SIM0;
 struct usart_async_descriptor SIM1;
 struct usart_async_descriptor SIM2;
@@ -48,7 +51,9 @@
 static uint8_t SIM5_buffer[SIM5_BUFFER_SIZE];
 static uint8_t SIM6_buffer[SIM6_BUFFER_SIZE];

-struct usart_sync_descriptor UART_debug;
+struct usart_async_descriptor UART_debug;
+
+static uint8_t UART_DEBUG_buffer[UART_DEBUG_BUFFER_SIZE];

 /**
  * \brief USART Clock initialization function
@@ -309,7 +314,26 @@
SIM6_PORT_init();
 }

-void UART_debug_PORT_init(void)
+/**
+ * \brief USART Clock initialization function
+ *
+ * Enables register interface and peripheral clock
+ */
+void UART_debug_CLOCK_init()
+{
+
+   hri_gclk_write_PCHCTRL_reg(GCLK, SERCOM7_GCLK_ID_CORE, 
CONF_GCLK_SERCOM7_CORE_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos));
+   hri_gclk_write_PCHCTRL_reg(GCLK, SERCOM7_GCLK_ID_SLOW, 
CONF_GCLK_SERCOM7_SLOW_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos));
+
+   hri_mclk_set_APBDMASK_SERCOM7_bit(MCLK);
+}
+
+/**
+ * \brief USART pinmux initialization function
+ *
+ * Set each required pin to USART functionality
+ */
+void UART_debug_PORT_init()
 {

gpio_set_pin_function(UART_TX, PINMUX_PB30C_SERCOM7_PAD0);
@@ -317,18 +341,15 @@
gpio_set_pin_function(UART_RX, PINMUX_PB31C_SERCOM7_PAD1);
 }

-void UART_debug_CLOCK_init(void)
-{
-   hri_gclk_write_PCHCTRL_reg(GCLK, SERCOM7_GCLK_ID_CORE, 
CONF_GCLK_SERCOM7_CORE_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos));
-   hri_gclk_write_PCHCTRL_reg(GCLK, SERCOM7_GCLK_ID_SLOW, 
CONF_GCLK_SERCOM7_SLOW_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos));
-
-   hri_mclk_set_APBDMASK_SERCOM7_bit(MCLK);
-}
-
+/**
+ * \brief USART initialization function
+ *
+ * Enables USART peripheral, clocks and initializes USART driver
+ */
 void UART_debug_init(void)
 {
UART_debug_CLOCK_init();
-   usart_sync_init(_debug, SERCOM7, (void *)NULL);
+   usart_async_init(_debug, SERCOM7, UART_DEBUG_buffer, 
UART_DEBUG_BUFFER_SIZE, (void *)NULL);
UART_debug_PORT_init();
 }

diff --git a/sysmoOCTSIM/driver_init.h b/sysmoOCTSIM/driver_init.h
index d809db8..9d009b9 100644
--- a/sysmoOCTSIM/driver_init.h
+++ b/sysmoOCTSIM/driver_init.h
@@ -40,8 +40,7 @@
 extern struct usart_async_descriptor SIM4;
 extern struct usart_async_descriptor SIM5;
 extern struct usart_async_descriptor SIM6;
-
-extern struct usart_sync_descriptor UART_debug;
+extern struct usart_async_descriptor UART_debug;

 void SIM0_PORT_init(void);
 void SIM0_CLOCK_init(void);
diff --git a/sysmoOCTSIM/examples/driver_examples.c 
b/sysmoOCTSIM/examples/driver_examples.c
index 4ab0ef4..14f1ae5 100644
--- a/sysmoOCTSIM/examples/driver_examples.c
+++ b/sysmoOCTSIM/examples/driver_examples.c
@@ -215,12 +215,29 @@
 
 /**
  * Example of using UART_debug to write "Hello World" using the IO abstraction.
+ *
+ * Since the driver is asynchronous we need to use 

Change in osmo-ccid-firmware[master]: add sim-atr command

2019-04-16 Thread Kévin Redon
Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/13681


Change subject: add sim-atr command
..

add sim-atr command

the sim-atr command resets the card and read the resulting
answer to reset.

Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee
---
M sysmoOCTSIM/main.c
1 file changed, 90 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/81/13681/1

diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c
index afd7bf2..788343e 100644
--- a/sysmoOCTSIM/main.c
+++ b/sysmoOCTSIM/main.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 

 #include "atmel_start.h"
 #include "atmel_start_pins.h"
@@ -31,6 +32,13 @@

 #include "command.h"

+// TODO put declaration in more global file
+// TODO for now SIM7 is not present because used for debug
+static struct usart_async_descriptor* SIM_peripheral_descriptors[] = {, 
, , , , , , NULL};
+
+static void SIM_rx_cb(const struct usart_async_descriptor *const io_descr)
+{
+}

 static void board_init()
 {
@@ -49,6 +57,15 @@
/* increase drive strength of 20Mhz SIM clock output to 8mA
 * (there are 8 inputs + traces to drive!) */
hri_port_set_PINCFG_DRVSTR_bit(PORT, 0, 11);
+
+   // enable SIM interfaces
+   for (uint8_t i = 0; i < ARRAY_SIZE(SIM_peripheral_descriptors); i++) {
+   if (NULL == SIM_peripheral_descriptors[i]) {
+   continue;
+   }
+   usart_async_register_callback(SIM_peripheral_descriptors[i], 
USART_ASYNC_RXC_CB, SIM_rx_cb); // required for RX to work, even if the 
callback does nothing
+   usart_async_enable(SIM_peripheral_descriptors[i]);
+   }
 }

 DEFUN(hello_fn, cmd_hello,
@@ -210,6 +227,78 @@
ncn8025_set(slotnr, );
 }

+DEFUN(sim_atr, cmd_sim_atr, "sim-atr", "Read ATR from SIM card")
+{
+   struct ncn8025_settings settings;
+   int slotnr = validate_slotnr(argc, argv, 1);
+
+   if (slotnr < 0 || slotnr >= ARRAY_SIZE(SIM_peripheral_descriptors) || 
NULL == SIM_peripheral_descriptors[slotnr]) {
+   return;
+   }
+
+   // check if card is present (and read current settings)
+   ncn8025_get(slotnr, );
+   if (!settings.simpres) {
+   printf("no card present in slot %d\r\n", slotnr);
+   return;
+   }
+
+   // switch card off (assert reset and disable power)
+   // note: ISO/IEC 7816-3:2006 section 6.4 provides the deactivation 
sequence, but not the minimum corresponding times
+   settings.rstin = false;
+   settings.cmdvcc = false;
+   ncn8025_set(slotnr, );
+   // TODO wait some time for card to be completely deactivated
+   usart_async_flush_rx_buffer(SIM_peripheral_descriptors[slotnr]); // 
flush RX buffer to start from scratch
+   //usart_async_set_baud_rate(SIM_peripheral_descriptors[slotnr], 250 
/ (372 / 1)); // set USART baud rate to match the interface (f = 2.5 MHz) and 
card default settings (Fd = 372, Dd = 1)
+   // set clock to lowest frequency (20 MHz / 8 = 2.5 MHz)
+   // note: according to ISO/IEC 7816-3:2006 section 5.2.3 the minimum 
value is 1 MHz, and maximum is 5 MHz during activation
+   settings.clkdiv = SIM_CLKDIV_8;
+   ncn8025_set(slotnr, );
+   // set card voltage to 3.0 V (the most supported)
+   // note: according to ISO/IEC 7816-3:2006 no voltage should damage the 
card, and you should cycle from low to high
+   settings.vsel = SIM_VOLT_3V0;
+   ncn8025_set(slotnr, );
+   // provide power (the NCN8025 should perform the activation according 
to spec)
+   // note: activation sequence is documented in ISO/IEC 7816-3:2006 
section 6.2
+   settings.cmdvcc = true;
+   ncn8025_set(slotnr, );
+   // wait for Tb=400 cycles before re-asserting reset
+   delay_us(400 * 1 / 2500); // 400 cycles * 1000 for us, 2.5 MHz / 
1000 for us
+   // de-assert reset to switch card back on
+   settings.rstin = true;
+   ncn8025_set(slotnr, );
+   // wait for Tc=4 cycles for transmission to start
+   uint32_t cycles = 4;
+   while (cycles && 
!usart_async_is_rx_not_empty(SIM_peripheral_descriptors[slotnr])) {
+   delay_us(10);
+   cycles -= 25; // 10 us = 25 cycles at 2.5 MHz
+   }
+   if (!usart_async_is_rx_not_empty(SIM_peripheral_descriptors[slotnr])) {
+   delay_us(12 * 372 / 1 / 2); // wait more than one byte 
(approximate freq down to 2 MHz)
+   }
+   // verify if one byte has been received
+   if (!usart_async_is_rx_not_empty(SIM_peripheral_descriptors[slotnr])) {
+   printf("card in slot %d is not responding\r\n", slotnr);
+   return;
+   }
+   // read ATR (just do it until there is no traffic anymore)
+   // TODO the ATR should be parsed to read the right number of bytes
+   

Change in osmo-trx[master]: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start

2019-04-16 Thread roh
roh has posted comments on this change. ( https://gerrit.osmocom.org/13662 )

Change subject: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open 
to start
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/13662/2/Transceiver52M/device/lms/LMSDevice.cpp
File Transceiver52M/device/lms/LMSDevice.cpp:

https://gerrit.osmocom.org/#/c/13662/2/Transceiver52M/device/lms/LMSDevice.cpp@373
PS2, Line 373:  lpfbw_tx = OSMO_MIN(OSMO_MAX(5.2e6, range_lpfbw_tx.min), 
range_lpfbw_tx.max);
> You forgot to apply my last comments regarding this section. […]
i actually would like to keep it this way.
otherwise i'll need to have the whole bw calculation inside whatever calls 
do_filters.
also do_filters is not simpler if it would have 2 more parameters (dir_tx and 
lpfwbw)



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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1090effdf0f43e5183a402e4c1a1ffe5abdefd37
Gerrit-Change-Number: 13662
Gerrit-PatchSet: 2
Gerrit-Owner: roh 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: roh 
Gerrit-Comment-Date: Tue, 16 Apr 2019 21:32:40 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Build failure of network:osmocom:nightly/libosmo-netif in Debian_9.0/armv7l

2019-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/Debian_9.0/armv7l

Package network:osmocom:nightly/libosmo-netif failed to build in 
Debian_9.0/armv7l

Check out the package for editing:
  osc checkout network:osmocom:nightly libosmo-netif

Last lines of build log:
[  198s] +non-reconnecting test step 0 [client OK, server OK], FD reg 1
[  198s] --- expout 2019-04-16 20:23:43.66500 +
[  198s] +++ /usr/src/packages/BUILD/tests/testsuite.dir/at-groups/1/stdout 
2019-04-16 20:23:52.72000 +
[  198s] @@ -44,8 +44,6 @@
[  198s]  [OK|OK] Server's read_cb_srv(): received 29(29) bytes: 44 6f 68 2c 20 
72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 73 65 72 76 65 72 20 3a 2d 44 
[  198s]  [OK|OK] Server's read_cb_srv(): sent 11 bytes message: 72 65 61 64 5f 
63 62 5f 73 72 76 
[  198s]  [OK|OK] Server's read_cb_srv(): force client disconnect on subsequent 
call
[  198s] -[OK] Client's read_cb_cli(): callback triggered
[  198s] -[OK] Client's read_cb_cli(): 0-byte read, auto-reconnect will be 
triggered if enabled
[  198s]  non-reconnecting test complete.
[  198s]  
[  198s]  Stream tests completed
[  198s] 1. testsuite.at:4: 1. stream_test (testsuite.at:4): FAILED 
(testsuite.at:8)
[  198s] debian/rules:27: recipe for target 'override_dh_auto_test' failed
[  198s] make[1]: *** [override_dh_auto_test] Error 1
[  198s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  198s] debian/rules:13: recipe for target 'build' failed
[  198s] make: *** [build] Error 2
[  198s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  198s] 
[  198s] armbuild24 failed "build libosmo-netif_0.4.0.25.e380.dsc" at Tue Apr 
16 20:23:54 UTC 2019.
[  198s] 
[  198s] ### VM INTERACTION START ###
[  200s] [  182.789567] sysrq: SysRq : Power Off
[  200s] [  182.807593] reboot: Power down
[  201s] ### VM INTERACTION END ###
[  201s] 
[  201s] armbuild24 failed "build libosmo-netif_0.4.0.25.e380.dsc" at Tue Apr 
16 20:23:58 UTC 2019.
[  201s] 

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


Change in gr-gsm[master]: grgsm_capture: Fix device arguments

2019-04-16 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/13672 )

Change subject: grgsm_capture: Fix device arguments
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2d1bcee835b695c91a5c44ec78a40b2d969f611c
Gerrit-Change-Number: 13672
Gerrit-PatchSet: 1
Gerrit-Owner: Vasil Velichkov 
Gerrit-Reviewer: Piotr Krysik 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Tue, 16 Apr 2019 19:42:37 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in gr-gsm[master]: Improve the TCH/H decoder logs

2019-04-16 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/13671 )

Change subject: Improve the TCH/H decoder logs
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/13671/1/lib/decoding/tch_h_decoder_impl.cc
File lib/decoding/tch_h_decoder_impl.cc:

https://gerrit.osmocom.org/#/c/13671/1/lib/decoding/tch_h_decoder_impl.cc@269
PS1, Line 269: //if (!d_boundary_check || d_boundary_decode) {
I would rather use:

  #if 0
...
  #endif



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

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I697ef944f30c4cabb62c888317dd3a7f8dcd5611
Gerrit-Change-Number: 13671
Gerrit-PatchSet: 1
Gerrit-Owner: Vasil Velichkov 
Gerrit-Reviewer: Piotr Krysik 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Tue, 16 Apr 2019 19:42:03 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in gr-gsm[master]: Improve the TCH/H decoder logs

2019-04-16 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/13671 )

Change subject: Improve the TCH/H decoder logs
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I697ef944f30c4cabb62c888317dd3a7f8dcd5611
Gerrit-Change-Number: 13671
Gerrit-PatchSet: 1
Gerrit-Owner: Vasil Velichkov 
Gerrit-Reviewer: Piotr Krysik 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Tue, 16 Apr 2019 19:41:08 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in gr-gsm[master]: grgsm_capture: Fix device arguments

2019-04-16 Thread Vasil Velichkov
Hello Piotr Krysik, Vadim Yanitskiy,

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

https://gerrit.osmocom.org/13672

to review the following change.


Change subject: grgsm_capture: Fix device arguments
..

grgsm_capture: Fix device arguments

We need a space between numchan=1 and the rest of the device arguments
otherwise when --args is specified it fails with RuntimeError: bad lexical cast

$ grgsm_capture --args=soapy

Traceback (most recent call last):
  File "/usr/local/bin/grgsm_capture", line 179, in 
device_args=options.device_args)
  File "/usr/local/bin/grgsm_capture", line 57, in __init__
osmosdr.source(args="numchan=1" + device_args )
  File "/usr/local/lib64/python2.7/site-packages/osmosdr/osmosdr_swig.py", line 
1170, in make
return _osmosdr_swig.source_make(*args, **kwargs)
RuntimeError: bad lexical cast: source type value could not be interpreted as 
target

Change-Id: I2d1bcee835b695c91a5c44ec78a40b2d969f611c
---
M apps/helpers/grgsm_capture
1 file changed, 2 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/gr-gsm refs/changes/72/13672/1

diff --git a/apps/helpers/grgsm_capture b/apps/helpers/grgsm_capture
index f698205..081544a 100755
--- a/apps/helpers/grgsm_capture
+++ b/apps/helpers/grgsm_capture
@@ -54,7 +54,8 @@
 ##

 self.sdr_source = \
-osmosdr.source(args="numchan=1" + device_args )
+osmosdr.source(args="numchan=" + str(1) + " " + 
device_args)
+
 self.sdr_source.set_sample_rate(samp_rate)
 self.sdr_source.set_center_freq(freq, 0)
 self.sdr_source.set_freq_corr(freq_corr, 0)

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

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d1bcee835b695c91a5c44ec78a40b2d969f611c
Gerrit-Change-Number: 13672
Gerrit-PatchSet: 1
Gerrit-Owner: Vasil Velichkov 
Gerrit-Reviewer: Piotr Krysik 
Gerrit-Reviewer: Vadim Yanitskiy 


Change in gr-gsm[master]: Improve the TCH/H decoder logs

2019-04-16 Thread Vasil Velichkov
Hello Piotr Krysik, Vadim Yanitskiy,

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

https://gerrit.osmocom.org/13671

to review the following change.


Change subject: Improve the TCH/H decoder logs
..

Improve the TCH/H decoder logs

- Change "6,90 kbit/s" to "5.9 kbit/s"
  A typo reported in github ptrkrysik/gr-gsm#456
- Comment out the "Error! frame_nr:" message as it turns out to confuse
  users more then it actually helps debugging.
- When voice-boundary detection is enabled write the name of decoded
  control channel messages

Change-Id: I697ef944f30c4cabb62c888317dd3a7f8dcd5611
---
M lib/decoding/tch_h_decoder_impl.cc
1 file changed, 10 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/gr-gsm refs/changes/71/13671/1

diff --git a/lib/decoding/tch_h_decoder_impl.cc 
b/lib/decoding/tch_h_decoder_impl.cc
index 11da907..96d6714 100644
--- a/lib/decoding/tch_h_decoder_impl.cc
+++ b/lib/decoding/tch_h_decoder_impl.cc
@@ -178,7 +178,7 @@
 std::cout<<"5,15 kbit/s codec rate: is part of the 
subset"

Change in osmo-trx[master]: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13662 )

Change subject: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open 
to start
..


Patch Set 2: Code-Review+1


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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1090effdf0f43e5183a402e4c1a1ffe5abdefd37
Gerrit-Change-Number: 13662
Gerrit-PatchSet: 2
Gerrit-Owner: roh 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 16 Apr 2019 19:24:17 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: lms: properly call close if set_antennas() fails, add some comments

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13667 )

Change subject: lms: properly call close if set_antennas() fails, add some 
comments
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9ebe986ee3a15842a15853424ee98e9a2fa6a5df
Gerrit-Change-Number: 13667
Gerrit-PatchSet: 2
Gerrit-Owner: roh 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 16 Apr 2019 19:23:29 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: lms: add device type detection and device specific gains

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13663 )

Change subject: lms: add device type detection and device specific gains
..


Patch Set 3: Code-Review+2


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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181
Gerrit-Change-Number: 13663
Gerrit-PatchSet: 3
Gerrit-Owner: roh 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 16 Apr 2019 19:23:08 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ccid-firmware[master]: manual_test.c: New manual board testing mode

2019-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13669 )

Change subject: manual_test.c: New manual board testing mode
..

manual_test.c: New manual board testing mode

Change-Id: I8fc94fa08521224eff79d0aa9d7b42ceeaa760c9
---
M sysmoOCTSIM/gcc/Makefile
M sysmoOCTSIM/main.c
A sysmoOCTSIM/manual_test.c
3 files changed, 260 insertions(+), 1 deletion(-)

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



diff --git a/sysmoOCTSIM/gcc/Makefile b/sysmoOCTSIM/gcc/Makefile
index 7496377..376ddaf 100644
--- a/sysmoOCTSIM/gcc/Makefile
+++ b/sysmoOCTSIM/gcc/Makefile
@@ -77,6 +77,7 @@
 gcc/gcc/startup_same54.o \
 hal/src/hal_usb_device.o \
 main.o \
+manual_test.o \
 i2c_bitbang.o \
 octsim_i2c.o \
 ncn8025.o \
@@ -124,6 +125,7 @@
 "gcc/gcc/startup_same54.o" \
 "hal/src/hal_usb_device.o" \
 "main.o" \
+"manual_test.o" \
 "i2c_bitbang.o" \
 "octsim_i2c.o" \
 "ncn8025.o" \
@@ -177,6 +179,7 @@
 "hal/src/hal_usart_async.d" \
 "hpl/osc32kctrl/hpl_osc32kctrl.d" \
 "main.d" \
+"manual_test.d" \
 "i2c_bitbang.d" \
 "octsim_i2c.d" \
 "ncn8025.d" \
diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c
index 93b90db..6c4e9e6 100644
--- a/sysmoOCTSIM/main.c
+++ b/sysmoOCTSIM/main.c
@@ -211,7 +211,7 @@



-
+extern void testmode_init(void);

 int main(void)
 {
@@ -230,6 +230,7 @@
command_register(_sim_clkdiv);
command_register(_sim_voltage);
command_register(_sim_led);
+   testmode_init();

printf("\r\n\r\nsysmocom sysmoOCTSIM\r\n");

diff --git a/sysmoOCTSIM/manual_test.c b/sysmoOCTSIM/manual_test.c
new file mode 100644
index 000..5cc9bca
--- /dev/null
+++ b/sysmoOCTSIM/manual_test.c
@@ -0,0 +1,255 @@
+/*
+ * Copyright (C) 2019 Harald Welte 
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; 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 
+
+#include "atmel_start.h"
+#include "atmel_start_pins.h"
+
+#include "i2c_bitbang.h"
+#include "octsim_i2c.h"
+#include "ncn8025.h"
+
+#include "command.h"
+
+enum testmode_test {
+   TEST_USER_LED,
+   /* test the per-slot LED by blinking it shortly */
+   TEST_LED,
+   /* test the voltages of the SIMVCC */
+   TEST_VOLTAGE,
+   /* test the clock rates of the SIMCLK pin */
+   TEST_CLOCK,
+   /* test the RST line by asserting it low and then back high */
+   TEST_RST,
+   /* test the RST line by asserting it low and then back high */
+   TEST_IO,
+   _NUM_TESTS
+};
+static const char *test_names[_NUM_TESTS] = {
+   [TEST_USER_LED] = "USER_LED",
+   [TEST_LED]  = "LED",
+   [TEST_VOLTAGE]  = "VOLTAGE",
+   [TEST_CLOCK]= "CLOCK",
+   [TEST_RST]  = "RST",
+   [TEST_IO]   = "IO",
+};
+
+struct testmode_state {
+   uint8_t slot;
+   enum testmode_test test_nr;
+   int test_int;
+   struct ncn8025_settings ncn;
+};
+static struct testmode_state g_tms;
+
+#define BLINK_MS 500
+
+static void set_slot(uint8_t slot)
+{
+   printf("changing slot to %u\r\n", slot);
+   g_tms.slot = slot;
+   g_tms.ncn = (struct ncn8025_settings) {
+   .rstin = false,
+   .cmdvcc = false,
+   .led = false,
+   .clkdiv = SIM_CLKDIV_8,
+   .vsel = SIM_VOLT_3V0,
+   };
+   ncn8025_set(g_tms.slot, _tms.ncn);
+   ncn8025_get(g_tms.slot, _tms.ncn);
+}
+
+static void next_test(void)
+{
+   g_tms.test_nr = (g_tms.test_nr + 1) % _NUM_TESTS;
+   g_tms.test_int = 0;
+   printf("changing test to %s\r\n", test_names[g_tms.test_nr]);
+}
+
+static void test_user_led(void)
+{
+   printf("blinking User LED\r\n");
+
+   gpio_set_pin_function(PIN_PC26, GPIO_PIN_FUNCTION_OFF);
+   gpio_set_pin_direction(PIN_PC26, GPIO_DIRECTION_OUT);
+   gpio_set_pin_level(PIN_PC26, true);
+   delay_ms(BLINK_MS);
+   gpio_set_pin_level(PIN_PC26, false);
+}
+
+static void test_led(void)
+{
+   printf("blinking Slot LED\r\n");
+
+   g_tms.ncn.led = true;
+   ncn8025_set(g_tms.slot, _tms.ncn);
+   delay_ms(BLINK_MS);
+   g_tms.ncn.led = false;
+   ncn8025_set(g_tms.slot, _tms.ncn);
+}
+
+static enum ncn8025_sim_voltage voltage[3] = { SIM_VOLT_1V8, SIM_VOLT_3V0, 
SIM_VOLT_5V0 };

Change in osmo-ccid-firmware[master]: ncn8025: Invert the software logic of RSTIN

2019-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13668 )

Change subject: ncn8025: Invert the software logic of RSTIN
..

ncn8025: Invert the software logic of RSTIN

In hardware, the Card RST pin is low-active.  There's a level
translator in the NCN8025, but there's no logic inversion, so RSTIN
is also low-active.  In software, we have the policy of all signals
being "true-active", i.e. true represents the active state, and false
the inactive state.

Hence, we must invert the logic of how we handle rstin.

Change-Id: Ia45246b7517b2e6ecb01d22b3af52aee7a51de64
---
M sysmoOCTSIM/ncn8025.c
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/sysmoOCTSIM/ncn8025.c b/sysmoOCTSIM/ncn8025.c
index 61509bc..711b082 100644
--- a/sysmoOCTSIM/ncn8025.c
+++ b/sysmoOCTSIM/ncn8025.c
@@ -21,7 +21,7 @@
 static uint8_t ncn8025_encode(const struct ncn8025_settings *set)
 {
uint8_t reg = 0;
-   if (set->rstin)
+   if (!set->rstin)
reg |= 0x01;
if (!set->cmdvcc)
reg |= 0x02;
@@ -43,7 +43,7 @@
 {
memset(set, 0, sizeof(*set));

-   if (reg & 0x01)
+   if (!(reg & 0x01))
set->rstin = true;
if (!(reg & 0x02))
set->cmdvcc = true;

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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia45246b7517b2e6ecb01d22b3af52aee7a51de64
Gerrit-Change-Number: 13668
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-ccid-firmware[master]: command.c: Print prompt when starting up

2019-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13670 )

Change subject: command.c: Print prompt when starting up
..

command.c: Print prompt when starting up

Change-Id: I18e4351609ab10c06a2fa197cb9f7a66269799a0
---
M sysmoOCTSIM/command.c
M sysmoOCTSIM/command.h
M sysmoOCTSIM/main.c
3 files changed, 8 insertions(+), 0 deletions(-)

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



diff --git a/sysmoOCTSIM/command.c b/sysmoOCTSIM/command.c
index 9502f05..3210b27 100644
--- a/sysmoOCTSIM/command.c
+++ b/sysmoOCTSIM/command.c
@@ -71,6 +71,11 @@
g_cmds.buf[g_cmds.buf_idx++] = c;
 }

+void command_print_prompt(void)
+{
+   printf(g_cmds.prompt);
+}
+
 void command_try_recv(void)
 {
unsigned int i = 0;
diff --git a/sysmoOCTSIM/command.h b/sysmoOCTSIM/command.h
index cdf256d..5d022dc 100644
--- a/sysmoOCTSIM/command.h
+++ b/sysmoOCTSIM/command.h
@@ -18,3 +18,4 @@
 void command_init(const char *prompt);
 int command_register(const struct command_fn *cmd);
 void command_try_recv(void);
+void command_print_prompt(void);
diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c
index 9dee504..93b90db 100644
--- a/sysmoOCTSIM/main.c
+++ b/sysmoOCTSIM/main.c
@@ -232,6 +232,8 @@
command_register(_sim_led);

printf("\r\n\r\nsysmocom sysmoOCTSIM\r\n");
+
+   command_print_prompt();
while (true) { // main loop
command_try_recv();
}

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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I18e4351609ab10c06a2fa197cb9f7a66269799a0
Gerrit-Change-Number: 13670
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-ccid-firmware[master]: manual_test.c: New manual board testing mode

2019-04-16 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13669 )

Change subject: manual_test.c: New manual board testing mode
..


Patch Set 3: Code-Review+2


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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I8fc94fa08521224eff79d0aa9d7b42ceeaa760c9
Gerrit-Change-Number: 13669
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Tue, 16 Apr 2019 19:14:12 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ccid-firmware[master]: manual_test.c: New manual board testing mode

2019-04-16 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/13669

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

Change subject: manual_test.c: New manual board testing mode
..

manual_test.c: New manual board testing mode

Change-Id: I8fc94fa08521224eff79d0aa9d7b42ceeaa760c9
---
M sysmoOCTSIM/gcc/Makefile
M sysmoOCTSIM/main.c
A sysmoOCTSIM/manual_test.c
3 files changed, 260 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/69/13669/3
--
To view, visit https://gerrit.osmocom.org/13669
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I8fc94fa08521224eff79d0aa9d7b42ceeaa760c9
Gerrit-Change-Number: 13669
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-ccid-firmware[master]: command.c: Print prompt when starting up

2019-04-16 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13670 )

Change subject: command.c: Print prompt when starting up
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I18e4351609ab10c06a2fa197cb9f7a66269799a0
Gerrit-Change-Number: 13670
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Comment-Date: Tue, 16 Apr 2019 19:12:45 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ccid-firmware[master]: ncn8025: Invert the software logic of RSTIN

2019-04-16 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13668 )

Change subject: ncn8025: Invert the software logic of RSTIN
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia45246b7517b2e6ecb01d22b3af52aee7a51de64
Gerrit-Change-Number: 13668
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Tue, 16 Apr 2019 19:12:57 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ccid-firmware[master]: manual_test.c: New manual board testing mode

2019-04-16 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/13669

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

Change subject: manual_test.c: New manual board testing mode
..

manual_test.c: New manual board testing mode

Change-Id: I8fc94fa08521224eff79d0aa9d7b42ceeaa760c9
---
M sysmoOCTSIM/gcc/Makefile
M sysmoOCTSIM/main.c
A sysmoOCTSIM/manual_test.c
3 files changed, 260 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/69/13669/2
--
To view, visit https://gerrit.osmocom.org/13669
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I8fc94fa08521224eff79d0aa9d7b42ceeaa760c9
Gerrit-Change-Number: 13669
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-ccid-firmware[master]: command.c: Print prompt when starting up

2019-04-16 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/13670


Change subject: command.c: Print prompt when starting up
..

command.c: Print prompt when starting up

Change-Id: I18e4351609ab10c06a2fa197cb9f7a66269799a0
---
M sysmoOCTSIM/command.c
M sysmoOCTSIM/command.h
M sysmoOCTSIM/main.c
3 files changed, 8 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/70/13670/1

diff --git a/sysmoOCTSIM/command.c b/sysmoOCTSIM/command.c
index 9502f05..3210b27 100644
--- a/sysmoOCTSIM/command.c
+++ b/sysmoOCTSIM/command.c
@@ -71,6 +71,11 @@
g_cmds.buf[g_cmds.buf_idx++] = c;
 }

+void command_print_prompt(void)
+{
+   printf(g_cmds.prompt);
+}
+
 void command_try_recv(void)
 {
unsigned int i = 0;
diff --git a/sysmoOCTSIM/command.h b/sysmoOCTSIM/command.h
index cdf256d..5d022dc 100644
--- a/sysmoOCTSIM/command.h
+++ b/sysmoOCTSIM/command.h
@@ -18,3 +18,4 @@
 void command_init(const char *prompt);
 int command_register(const struct command_fn *cmd);
 void command_try_recv(void);
+void command_print_prompt(void);
diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c
index 9dee504..93b90db 100644
--- a/sysmoOCTSIM/main.c
+++ b/sysmoOCTSIM/main.c
@@ -232,6 +232,8 @@
command_register(_sim_led);

printf("\r\n\r\nsysmocom sysmoOCTSIM\r\n");
+
+   command_print_prompt();
while (true) { // main loop
command_try_recv();
}

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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I18e4351609ab10c06a2fa197cb9f7a66269799a0
Gerrit-Change-Number: 13670
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in osmo-ccid-firmware[master]: manual_test.c: New manual board testing mode

2019-04-16 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/13669


Change subject: manual_test.c: New manual board testing mode
..

manual_test.c: New manual board testing mode

Change-Id: I8fc94fa08521224eff79d0aa9d7b42ceeaa760c9
---
M sysmoOCTSIM/gcc/Makefile
M sysmoOCTSIM/main.c
A sysmoOCTSIM/manual_test.c
3 files changed, 259 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/69/13669/1

diff --git a/sysmoOCTSIM/gcc/Makefile b/sysmoOCTSIM/gcc/Makefile
index 7496377..376ddaf 100644
--- a/sysmoOCTSIM/gcc/Makefile
+++ b/sysmoOCTSIM/gcc/Makefile
@@ -77,6 +77,7 @@
 gcc/gcc/startup_same54.o \
 hal/src/hal_usb_device.o \
 main.o \
+manual_test.o \
 i2c_bitbang.o \
 octsim_i2c.o \
 ncn8025.o \
@@ -124,6 +125,7 @@
 "gcc/gcc/startup_same54.o" \
 "hal/src/hal_usb_device.o" \
 "main.o" \
+"manual_test.o" \
 "i2c_bitbang.o" \
 "octsim_i2c.o" \
 "ncn8025.o" \
@@ -177,6 +179,7 @@
 "hal/src/hal_usart_async.d" \
 "hpl/osc32kctrl/hpl_osc32kctrl.d" \
 "main.d" \
+"manual_test.d" \
 "i2c_bitbang.d" \
 "octsim_i2c.d" \
 "ncn8025.d" \
diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c
index 9dee504..99dd44d 100644
--- a/sysmoOCTSIM/main.c
+++ b/sysmoOCTSIM/main.c
@@ -211,7 +211,7 @@



-
+extern void testmode_init(void);

 int main(void)
 {
@@ -230,6 +230,7 @@
command_register(_sim_clkdiv);
command_register(_sim_voltage);
command_register(_sim_led);
+   testmode_init();

printf("\r\n\r\nsysmocom sysmoOCTSIM\r\n");
while (true) { // main loop
diff --git a/sysmoOCTSIM/manual_test.c b/sysmoOCTSIM/manual_test.c
new file mode 100644
index 000..5354c1b
--- /dev/null
+++ b/sysmoOCTSIM/manual_test.c
@@ -0,0 +1,254 @@
+/*
+ * 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 
+
+#include "atmel_start.h"
+#include "atmel_start_pins.h"
+
+#include "i2c_bitbang.h"
+#include "octsim_i2c.h"
+#include "ncn8025.h"
+
+#include "command.h"
+
+enum testmode_test {
+   TEST_USER_LED,
+   /* test the per-slot LED by blinking it shortly */
+   TEST_LED,
+   /* test the voltages of the SIMVCC */
+   TEST_VOLTAGE,
+   /* test the clock rates of the SIMCLK pin */
+   TEST_CLOCK,
+   /* test the RST line by asserting it low and then back high */
+   TEST_RST,
+   /* test the RST line by asserting it low and then back high */
+   TEST_IO,
+   _NUM_TESTS
+};
+static const char *test_names[_NUM_TESTS] = {
+   [TEST_USER_LED] = "USER_LED",
+   [TEST_LED]  = "LED",
+   [TEST_VOLTAGE]  = "VOLTAGE",
+   [TEST_CLOCK]= "CLOCK",
+   [TEST_RST]  = "RST",
+   [TEST_IO]   = "IO",
+};
+
+struct testmode_state {
+   uint8_t slot;
+   enum testmode_test test_nr;
+   int test_int;
+   struct ncn8025_settings ncn;
+};
+static struct testmode_state g_tms;
+
+#define BLINK_MS 500
+
+static void set_slot(uint8_t slot)
+{
+   printf("changing slot to %u\r\n", slot);
+   g_tms.slot = slot;
+   g_tms.ncn = (struct ncn8025_settings) {
+   .rstin = false,
+   .cmdvcc = false,
+   .led = false,
+   .clkdiv = SIM_CLKDIV_8,
+   .vsel = SIM_VOLT_3V0,
+   };
+   ncn8025_set(g_tms.slot, _tms.ncn);
+   ncn8025_get(g_tms.slot, _tms.ncn);
+}
+
+static void next_test(void)
+{
+   g_tms.test_nr = (g_tms.test_nr + 1) % _NUM_TESTS;
+   g_tms.test_int = 0;
+   printf("changing test to %s\r\n", test_names[g_tms.test_nr]);
+}
+
+static void test_user_led(void)
+{
+   printf("blinking User LED\r\n");
+
+   gpio_set_pin_function(PIN_PC26, GPIO_PIN_FUNCTION_OFF);
+   gpio_set_pin_direction(PIN_PC26, GPIO_DIRECTION_OUT);
+   gpio_set_pin_level(PIN_PC26, true);
+   delay_ms(BLINK_MS);
+   gpio_set_pin_level(PIN_PC26, false);
+}
+
+static void test_led(void)
+{
+   printf("blinking Slot LED\r\n");
+
+   g_tms.ncn.led = true;
+   ncn8025_set(g_tms.slot, _tms.ncn);
+   delay_ms(BLINK_MS);
+   g_tms.ncn.led = false;
+   ncn8025_set(g_tms.slot, _tms.ncn);
+}
+
+static enum 

Change in osmo-ccid-firmware[master]: ncn8025: Invert the software logic of RSTIN

2019-04-16 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/13668


Change subject: ncn8025: Invert the software logic of RSTIN
..

ncn8025: Invert the software logic of RSTIN

In hardware, the Card RST pin is low-active.  There's a level
translator in the NCN8025, but there's no logic inversion, so RSTIN
is also low-active.  In software, we have the policy of all signals
being "true-active", i.e. true represents the active state, and false
the inactive state.

Hence, we must invert the logic of how we handle rstin.

Change-Id: Ia45246b7517b2e6ecb01d22b3af52aee7a51de64
---
M sysmoOCTSIM/ncn8025.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/68/13668/1

diff --git a/sysmoOCTSIM/ncn8025.c b/sysmoOCTSIM/ncn8025.c
index 61509bc..711b082 100644
--- a/sysmoOCTSIM/ncn8025.c
+++ b/sysmoOCTSIM/ncn8025.c
@@ -21,7 +21,7 @@
 static uint8_t ncn8025_encode(const struct ncn8025_settings *set)
 {
uint8_t reg = 0;
-   if (set->rstin)
+   if (!set->rstin)
reg |= 0x01;
if (!set->cmdvcc)
reg |= 0x02;
@@ -43,7 +43,7 @@
 {
memset(set, 0, sizeof(*set));

-   if (reg & 0x01)
+   if (!(reg & 0x01))
set->rstin = true;
if (!(reg & 0x02))
set->cmdvcc = true;

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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia45246b7517b2e6ecb01d22b3af52aee7a51de64
Gerrit-Change-Number: 13668
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in osmo-trx[master]: lms: add device type detection and device specific gains

2019-04-16 Thread roh
Hello Pau Espin Pedrol, Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/13663

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

Change subject: lms: add device type detection and device specific gains
..

lms: add device type detection and device specific gains

add device dependant max gain setup - limesdr mini and limenet micro need 
slightly reduced maximum gains to get a PASS on phase error measurements
rework clock reference setup - external clock needs to be selected before 
calling LMS_Init(), internal can only be set after.
remove now unused compat_LMS_VCTCXO* functions - we do not set the VCTXCO 
directly anymore

Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181
---
M Transceiver52M/device/lms/LMSDevice.cpp
M Transceiver52M/device/lms/LMSDevice.h
M configure.ac
3 files changed, 40 insertions(+), 58 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/63/13663/3
--
To view, visit https://gerrit.osmocom.org/13663
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181
Gerrit-Change-Number: 13663
Gerrit-PatchSet: 3
Gerrit-Owner: roh 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 


Change in osmo-trx[master]: lms: properly call close if set_antennas() fails, add some comments

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13667 )

Change subject: lms: properly call close if set_antennas() fails, add some 
comments
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9ebe986ee3a15842a15853424ee98e9a2fa6a5df
Gerrit-Change-Number: 13667
Gerrit-PatchSet: 1
Gerrit-Owner: roh 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 16 Apr 2019 17:57:48 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: lms: add device type detection and device specific gains

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13663 )

Change subject: lms: add device type detection and device specific gains
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/13663/2/configure.ac
File configure.ac:

https://gerrit.osmocom.org/#/c/13663/2/configure.ac@a164
PS2, Line 164:
Sorry you need to avoid dropping the AS_IF plus this line (PKG_CHECK_MODULES), 
otherwise it will fail to build.



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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181
Gerrit-Change-Number: 13663
Gerrit-PatchSet: 2
Gerrit-Owner: roh 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 16 Apr 2019 17:57:14 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-trx[master]: lms: add device type detection and device specific gains

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13663 )

Change subject: lms: add device type detection and device specific gains
..


Patch Set 2: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/13663/2/Transceiver52M/device/lms/LMSDevice.cpp
File Transceiver52M/device/lms/LMSDevice.cpp:

https://gerrit.osmocom.org/#/c/13663/2/Transceiver52M/device/lms/LMSDevice.cpp@210
PS2, Line 210:  }
This "}" is wrongly aligned.



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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181
Gerrit-Change-Number: 13663
Gerrit-PatchSet: 2
Gerrit-Owner: roh 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 16 Apr 2019 17:56:02 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13662 )

Change subject: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open 
to start
..


Patch Set 2: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/13662/2/Transceiver52M/device/lms/LMSDevice.cpp
File Transceiver52M/device/lms/LMSDevice.cpp:

https://gerrit.osmocom.org/#/c/13662/2/Transceiver52M/device/lms/LMSDevice.cpp@373
PS2, Line 373:  lpfbw_tx = OSMO_MIN(OSMO_MAX(5.2e6, range_lpfbw_tx.min), 
range_lpfbw_tx.max);
You forgot to apply my last comments regarding this section. Please look at my 
previous comments and re-submit with changes applied.



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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1090effdf0f43e5183a402e4c1a1ffe5abdefd37
Gerrit-Change-Number: 13662
Gerrit-PatchSet: 2
Gerrit-Owner: roh 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 16 Apr 2019 17:52:29 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: lms: move LMS_EnableChannel from Start/Stop to Open/Close device

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13661 )

Change subject: lms: move LMS_EnableChannel from Start/Stop to Open/Close device
..


Patch Set 2: Code-Review+1


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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I82878913254ce15a85db8d006e13d5eb639793e9
Gerrit-Change-Number: 13661
Gerrit-PatchSet: 2
Gerrit-Owner: roh 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Tue, 16 Apr 2019 17:51:13 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: lms: Remove wrong unused code copied from -uhd

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13660 )

Change subject: lms: Remove wrong unused code copied from -uhd
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2bc7fcfa429d1f82c2d8e95d31dfed367f2b3f9d
Gerrit-Change-Number: 13660
Gerrit-PatchSet: 2
Gerrit-Owner: roh 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 16 Apr 2019 17:48:37 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-mgw[master]: mgcp-client: Sanitize implementation of mgcp_client_rtpbridge_wildcard

2019-04-16 Thread Pau Espin Pedrol
Hello Vadim Yanitskiy, Jenkins Builder,

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

https://gerrit.osmocom.org/13665

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

Change subject: mgcp-client: Sanitize implementation of 
mgcp_client_rtpbridge_wildcard
..

mgcp-client: Sanitize implementation of mgcp_client_rtpbridge_wildcard

* Get rid of string define containing printf statements
* Split name from rest of checks to easily add new names later

Change-Id: I46e05a7a3432733976760bbf1c5deb4f7610db11
---
M src/libosmo-mgcp-client/mgcp_client.c
1 file changed, 9 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/65/13665/2
--
To view, visit https://gerrit.osmocom.org/13665
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I46e05a7a3432733976760bbf1c5deb4f7610db11
Gerrit-Change-Number: 13665
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmo-mgw[master]: mgcp-client: Sanitize implementation of mgcp_client_rtpbridge_wildcard

2019-04-16 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/13665 )

Change subject: mgcp-client: Sanitize implementation of 
mgcp_client_rtpbridge_wildcard
..


Patch Set 1: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/#/c/13665/1/src/libosmo-mgcp-client/mgcp_client.c
File src/libosmo-mgcp-client/mgcp_client.c:

https://gerrit.osmocom.org/#/c/13665/1/src/libosmo-mgcp-client/mgcp_client.c@831
PS1, Line 831: char
const



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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I46e05a7a3432733976760bbf1c5deb4f7610db11
Gerrit-Change-Number: 13665
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Tue, 16 Apr 2019 17:38:01 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-mgw[master]: mgcp-client: whitespace cleanup in mgcp_client.c

2019-04-16 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/13664 )

Change subject: mgcp-client: whitespace cleanup in mgcp_client.c
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3495d70cb9c4e12552c6d97481cc0cf04b79f94
Gerrit-Change-Number: 13664
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Tue, 16 Apr 2019 17:33:58 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: lms: properly call close if set_antennas() fails, add some comments

2019-04-16 Thread roh
roh has uploaded this change for review. ( https://gerrit.osmocom.org/13667


Change subject: lms: properly call close if set_antennas() fails, add some 
comments
..

lms: properly call close if set_antennas() fails, add some comments

Change-Id: I9ebe986ee3a15842a15853424ee98e9a2fa6a5df
---
M Transceiver52M/device/lms/LMSDevice.cpp
1 file changed, 4 insertions(+), 1 deletion(-)



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

diff --git a/Transceiver52M/device/lms/LMSDevice.cpp 
b/Transceiver52M/device/lms/LMSDevice.cpp
index 15064e8..94160b4 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -222,6 +222,7 @@
goto out_close;
}

+   /* set samplerate */
if (LMS_GetSampleRateRange(m_lms_dev, LMS_CH_RX, _sr))
goto out_close;
print_range("Sample Rate", _sr);
@@ -237,9 +238,10 @@
/* FIXME: make this device/model dependent, like 
UHDDevice:dev_param_map! */
ts_offset = static_cast(8.9e-5 * GSMRATE * tx_sps); /* time 
* sample_rate */

+   /* configure antennas */
if (!set_antennas()) {
LOGC(DDEV, ALERT) << "LMS antenna setting failed";
-   return -1;
+   goto out_close;
}

samplesRead = 0;
@@ -281,6 +283,7 @@
if (!do_calib(i))
return false;

+   /* configure Streams */
m_lms_stream_rx[i] = {};
m_lms_stream_rx[i].isTx = false;
m_lms_stream_rx[i].channel = i;

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ebe986ee3a15842a15853424ee98e9a2fa6a5df
Gerrit-Change-Number: 13667
Gerrit-PatchSet: 1
Gerrit-Owner: roh 


Change in osmo-trx[master]: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start

2019-04-16 Thread roh
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/13662

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

Change subject: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open 
to start
..

lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start

bandwidth, freqency, gain stages need to be set before calibration can be 
successful

Change-Id: I1090effdf0f43e5183a402e4c1a1ffe5abdefd37
---
M Transceiver52M/device/lms/LMSDevice.cpp
M Transceiver52M/device/lms/LMSDevice.h
2 files changed, 50 insertions(+), 27 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/62/13662/2
--
To view, visit https://gerrit.osmocom.org/13662
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1090effdf0f43e5183a402e4c1a1ffe5abdefd37
Gerrit-Change-Number: 13662
Gerrit-PatchSet: 2
Gerrit-Owner: roh 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Pau Espin Pedrol 


Change in osmo-trx[master]: lms: add device type detection and device specific gains

2019-04-16 Thread roh
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/13663

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

Change subject: lms: add device type detection and device specific gains
..

lms: add device type detection and device specific gains

add device dependant max gain setup - limesdr mini and limenet micro need 
slightly reduced maximum gains to get a PASS on phase error measurements
rework clock reference setup - external clock needs to be selected before 
calling LMS_Init(), internal can only be set after.
remove now unused compat_LMS_VCTCXO* functions - we do not set the VCTXCO 
directly anymore

Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181
---
M Transceiver52M/device/lms/LMSDevice.cpp
M Transceiver52M/device/lms/LMSDevice.h
M configure.ac
3 files changed, 40 insertions(+), 62 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/63/13663/2
--
To view, visit https://gerrit.osmocom.org/13663
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181
Gerrit-Change-Number: 13663
Gerrit-PatchSet: 2
Gerrit-Owner: roh 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Pau Espin Pedrol 


Change in osmo-trx[master]: lms: Remove wrong unused code copied from -uhd

2019-04-16 Thread roh
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/13660

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

Change subject: lms: Remove wrong unused code copied from -uhd
..

lms: Remove wrong unused code copied from -uhd

Change-Id: I2bc7fcfa429d1f82c2d8e95d31dfed367f2b3f9d
---
M Transceiver52M/device/lms/LMSDevice.cpp
1 file changed, 2 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/60/13660/2
--
To view, visit https://gerrit.osmocom.org/13660
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2bc7fcfa429d1f82c2d8e95d31dfed367f2b3f9d
Gerrit-Change-Number: 13660
Gerrit-PatchSet: 2
Gerrit-Owner: roh 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Pau Espin Pedrol 


Change in osmo-trx[master]: lms: move LMS_EnableChannel from Start/Stop to Open/Close device

2019-04-16 Thread roh
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/13661

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

Change subject: lms: move LMS_EnableChannel from Start/Stop to Open/Close device
..

lms: move LMS_EnableChannel from Start/Stop to Open/Close device

move enable: it is important that channels are actually enabled before applying 
any configuration (besides external clock)
move disable: move to close, so channels are not disabled and not enabled again 
while osmotrx is active.

Change-Id: I82878913254ce15a85db8d006e13d5eb639793e9
---
M Transceiver52M/device/lms/LMSDevice.cpp
1 file changed, 14 insertions(+), 8 deletions(-)


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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I82878913254ce15a85db8d006e13d5eb639793e9
Gerrit-Change-Number: 13661
Gerrit-PatchSet: 2
Gerrit-Owner: roh 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Harald Welte 
Gerrit-CC: Pau Espin Pedrol 


Change in osmo-ccid-firmware[master]: main.c: Call ncn8025_init also for SIM7

2019-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13666 )

Change subject: main.c: Call ncn8025_init also for SIM7
..

main.c: Call ncn8025_init also for SIM7

The ncn8025 has no impact on the UART, so no matter if we use
SERCOM7 as debug uart or as SIM UART, we can always initialize
the NCN8025 and thereby allow control of (e.g.) the LED.

Change-Id: I70ae1e050d5540627bc77626dbf1b6040e95dae4
---
M sysmoOCTSIM/main.c
1 file changed, 1 insertion(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c
index dc67406..9dee504 100644
--- a/sysmoOCTSIM/main.c
+++ b/sysmoOCTSIM/main.c
@@ -39,8 +39,7 @@
for (i = 0; i < 4; i++)
i2c_init([i]);

-   /* only 7 slots, as last slot is debug uart! */
-   for (i = 0; i < 7; i++)
+   for (i = 0; i < 8; i++)
ncn8025_init(i);

cache_init();

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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I70ae1e050d5540627bc77626dbf1b6040e95dae4
Gerrit-Change-Number: 13666
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-CC: Jenkins Builder (102)


Change in osmo-ccid-firmware[master]: main.c: Call ncn8025_init also for SIM7

2019-04-16 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13666 )

Change subject: main.c: Call ncn8025_init also for SIM7
..


Patch Set 1: Verified+1


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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I70ae1e050d5540627bc77626dbf1b6040e95dae4
Gerrit-Change-Number: 13666
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-CC: Jenkins Builder (102)
Gerrit-Comment-Date: Tue, 16 Apr 2019 16:22:02 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ccid-firmware[master]: main.c: Call ncn8025_init also for SIM7

2019-04-16 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13666 )

Change subject: main.c: Call ncn8025_init also for SIM7
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I70ae1e050d5540627bc77626dbf1b6040e95dae4
Gerrit-Change-Number: 13666
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-CC: Jenkins Builder (102)
Gerrit-Comment-Date: Tue, 16 Apr 2019 16:21:31 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ccid-firmware[master]: main.c: Call ncn8025_init also for SIM7

2019-04-16 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/13666


Change subject: main.c: Call ncn8025_init also for SIM7
..

main.c: Call ncn8025_init also for SIM7

The ncn8025 has no impact on the UART, so no matter if we use
SERCOM7 as debug uart or as SIM UART, we can always initialize
the NCN8025 and thereby allow control of (e.g.) the LED.

Change-Id: I70ae1e050d5540627bc77626dbf1b6040e95dae4
---
M sysmoOCTSIM/main.c
1 file changed, 1 insertion(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/66/13666/1

diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c
index dc67406..9dee504 100644
--- a/sysmoOCTSIM/main.c
+++ b/sysmoOCTSIM/main.c
@@ -39,8 +39,7 @@
for (i = 0; i < 4; i++)
i2c_init([i]);

-   /* only 7 slots, as last slot is debug uart! */
-   for (i = 0; i < 7; i++)
+   for (i = 0; i < 8; i++)
ncn8025_init(i);

cache_init();

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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I70ae1e050d5540627bc77626dbf1b6040e95dae4
Gerrit-Change-Number: 13666
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in osmo-trx[master]: add device type detection

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13663 )

Change subject: add device type detection
..


Patch Set 1:

(4 comments)

https://gerrit.osmocom.org/#/c/13663/1/Transceiver52M/device/lms/LMSDevice.cpp
File Transceiver52M/device/lms/LMSDevice.cpp:

https://gerrit.osmocom.org/#/c/13663/1/Transceiver52M/device/lms/LMSDevice.cpp@43
PS1, Line 43:
Since you dropped compat_functions, also drop this code from configure.ac:

AS_IF([test "x$with_lms" = "xyes"], [
PKG_CHECK_MODULES(LMS, LimeSuite)

# LimeSuite dc124e4e2ed9b549b142410af172f0592f9f0c23 > 18.10 broke API 
compatibility:
_cflags_save=$CFLAGS
CFLAGS="$CFLAGS $LMS_CFLAGS"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include ]],
[[LMS_VCTCXOWrite(NULL, 0, false); LMS_VCTCXORead(NULL, 0, false);]]
)],
[AC_DEFINE([HAVE_LMS_VCTCXO_EEPROM_SAVING], [1],
[LMS_VCTCXO* requires memory parameter])],
[AC_DEFINE([HAVE_LMS_VCTCXO_EEPROM_SAVING], [0],
[LMS_VCTCXO* has no memory parameter])])
CFLAGS=$_cflags_save
])


https://gerrit.osmocom.org/#/c/13663/1/Transceiver52M/device/lms/LMSDevice.cpp@181
PS1, Line 181:  LOGC(DDEV, ALERT) << "Invalid reference type";
ALERT is a logelvel inherited from osmo-trx and we slowly drop it. Better use 
ERROR.


https://gerrit.osmocom.org/#/c/13663/1/Transceiver52M/device/lms/LMSDevice.cpp@207
PS1, Line 207:  if (LMS_SetClockFreq(m_lms_dev, 
LMS_CLOCK_EXTREF, -1) < 0)
Should this NOT be EXTREF here? afaiu it should be internal one being set. 
Something's wrong here and you may need to re-check.


https://gerrit.osmocom.org/#/c/13663/1/Transceiver52M/device/lms/LMSDevice.cpp@225
PS1, Line 225:  /* set samplerate */
This comment and next one are unrelated, I'd love if you could move non-related 
stuff to different patch (these patches are complex enough with stuff being 
moved around).



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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181
Gerrit-Change-Number: 13663
Gerrit-PatchSet: 1
Gerrit-Owner: roh 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 16 Apr 2019 16:09:47 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-trx[master]: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start (bw...

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13662 )

Change subject: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to 
start (bw, freq, power need to be set)
..


Patch Set 1:

(2 comments)

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

https://gerrit.osmocom.org/#/c/13662/1//COMMIT_MSG@7
PS1, Line 7:  move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start 
(bw, freq, power need to be set)
Same as before:
* prepend "lms:"
* Move description on why it is done (your parenthesis) out of first line and 
extend it.


https://gerrit.osmocom.org/#/c/13662/1/Transceiver52M/device/lms/LMSDevice.cpp
File Transceiver52M/device/lms/LMSDevice.cpp:

https://gerrit.osmocom.org/#/c/13662/1/Transceiver52M/device/lms/LMSDevice.cpp@377
PS1, Line 377:  LOGC(DDEV, INFO) << "Setting LPFBW chan " << chan;
>From line 361 up to here (at least it seems) to be totally independent from 
>channel, so you shouldn't be calling it for each chan. Better Move that out 
>and pass lpfbw_rx and lpfbw_tx to do_filters().



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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1090effdf0f43e5183a402e4c1a1ffe5abdefd37
Gerrit-Change-Number: 13662
Gerrit-PatchSet: 1
Gerrit-Owner: roh 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 16 Apr 2019 15:52:25 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-trx[master]: move LMS_EnableChannel from Start/Stop to Open/Close device

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13661 )

Change subject: move LMS_EnableChannel from Start/Stop to Open/Close device
..


Patch Set 1:

(1 comment)

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

https://gerrit.osmocom.org/#/c/13661/1//COMMIT_MSG@7
PS1, Line 7:  move LMS_EnableChannel from Start/Stop to Open/Close device
Same as Harald said, + prepend "lms" or similar to this line please.



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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I82878913254ce15a85db8d006e13d5eb639793e9
Gerrit-Change-Number: 13661
Gerrit-PatchSet: 1
Gerrit-Owner: roh 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Harald Welte 
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 16 Apr 2019 15:44:42 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-trx[master]: move LMS_EnableChannel from Start/Stop to Open/Close device

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13661 )

Change subject: move LMS_EnableChannel from Start/Stop to Open/Close device
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/13661/1/Transceiver52M/device/lms/LMSDevice.cpp
File Transceiver52M/device/lms/LMSDevice.cpp:

https://gerrit.osmocom.org/#/c/13661/1/Transceiver52M/device/lms/LMSDevice.cpp@203
PS1, Line 203:  /* enable all used channels */
Add short explanation why this needs to be done the first, to avoid people in 
the future moving it someone else without knowing about possible restrictions.



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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I82878913254ce15a85db8d006e13d5eb639793e9
Gerrit-Change-Number: 13661
Gerrit-PatchSet: 1
Gerrit-Owner: roh 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Harald Welte 
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 16 Apr 2019 15:43:49 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-trx[master]: cleanup: remove comment copied from -uhd

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13660 )

Change subject: cleanup: remove comment copied from -uhd
..


Patch Set 1:

(2 comments)

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

https://gerrit.osmocom.org/#/c/13660/1//COMMIT_MSG@7
PS1, Line 7: cleanup: remove comment copied from -uhd
Better indicate the scope of the patch first. And you are not only changing 
comment (yes, I know actually that code is not used at all).

"lms: Remove wrong unused code copied from -uhd"


https://gerrit.osmocom.org/#/c/13660/1/Transceiver52M/device/lms/LMSDevice.cpp
File Transceiver52M/device/lms/LMSDevice.cpp:

https://gerrit.osmocom.org/#/c/13660/1/Transceiver52M/device/lms/LMSDevice.cpp@551
PS1, Line 551:  /* UNUSED on limesdr (only used on usrp1/2) */
Remove extra whitespace at the end. Better explain why is only used on usrp1/2 
(TX_WINDOW_foo right?)



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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2bc7fcfa429d1f82c2d8e95d31dfed367f2b3f9d
Gerrit-Change-Number: 13660
Gerrit-PatchSet: 1
Gerrit-Owner: roh 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 16 Apr 2019 15:40:05 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-trx[master]: use BSC_FD_READ and not OSMO_FD_READ

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13659 )

Change subject: use BSC_FD_READ and not OSMO_FD_READ
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Idb57077b2a4b2a71dd5d75a24ded8bb5887da188
Gerrit-Change-Number: 13659
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 16 Apr 2019 15:37:15 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-mgw[master]: mgcp-client: Sanitize implementation of mgcp_client_rtpbridge_wildcard

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/13665


Change subject: mgcp-client: Sanitize implementation of 
mgcp_client_rtpbridge_wildcard
..

mgcp-client: Sanitize implementation of mgcp_client_rtpbridge_wildcard

* Get rid of string define containing printf statements
* Split name from rest of checks to easily add new names later

Change-Id: I46e05a7a3432733976760bbf1c5deb4f7610db11
---
M src/libosmo-mgcp-client/mgcp_client.c
1 file changed, 9 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/65/13665/1

diff --git a/src/libosmo-mgcp-client/mgcp_client.c 
b/src/libosmo-mgcp-client/mgcp_client.c
index 17f40b9..c216f3b 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -828,16 +828,15 @@
return mgcp->actual.endpoint_domain_name[0] ? 
mgcp->actual.endpoint_domain_name : "mgw";
 }

-const char *mgcp_client_rtpbridge_wildcard(const struct mgcp_client *mgcp)
+static char *_mgcp_client_name_append_domain(const struct mgcp_client *mgcp, 
char *name)
 {
static char endpoint[MGCP_ENDPOINT_MAXLEN];
int rc;

-#define RTPBRIDGE_WILDCARD_FMT "rtpbridge/*@%s"
-   rc = snprintf(endpoint, sizeof(endpoint), RTPBRIDGE_WILDCARD_FMT, 
mgcp_client_endpoint_domain(mgcp));
+   rc = snprintf(endpoint, sizeof(endpoint), "%s@%s", name, 
mgcp_client_endpoint_domain(mgcp));
if (rc > sizeof(endpoint) - 1) {
-   LOGP(DLMGCP, LOGL_ERROR, "MGCP endpoint exceeds maximum length 
of %zu: '" RTPBRIDGE_WILDCARD_FMT "'\n",
-sizeof(endpoint) - 1, mgcp_client_endpoint_domain(mgcp));
+   LOGP(DLMGCP, LOGL_ERROR, "MGCP endpoint exceeds maximum length 
of %zu: '%s@%s'\n",
+sizeof(endpoint) - 1, name, 
mgcp_client_endpoint_domain(mgcp));
return NULL;
}
if (rc < 1) {
@@ -847,6 +846,11 @@
return endpoint;
 }

+const char *mgcp_client_rtpbridge_wildcard(const struct mgcp_client *mgcp)
+{
+   return _mgcp_client_name_append_domain(mgcp, "rtpbridge/*");
+}
+
 struct mgcp_response_pending * mgcp_client_pending_add(
struct mgcp_client *mgcp,
mgcp_trans_id_t trans_id,

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I46e05a7a3432733976760bbf1c5deb4f7610db11
Gerrit-Change-Number: 13665
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 


Change in osmo-mgw[master]: mgcp-client: whitespace cleanup in mgcp_client.c

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/13664


Change subject: mgcp-client: whitespace cleanup in mgcp_client.c
..

mgcp-client: whitespace cleanup in mgcp_client.c

Change-Id: Ic3495d70cb9c4e12552c6d97481cc0cf04b79f94
---
M src/libosmo-mgcp-client/mgcp_client.c
1 file changed, 10 insertions(+), 10 deletions(-)



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

diff --git a/src/libosmo-mgcp-client/mgcp_client.c 
b/src/libosmo-mgcp-client/mgcp_client.c
index 88e5dab..17f40b9 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -323,8 +323,8 @@
unsigned int pt;
char codec_resp[64];
unsigned int codec;
-
-
+
+
if (strstr(line, "ptime")) {
if (sscanf(line, "a=ptime:%u", >ptime) != 1)
goto response_parse_failure_ptime;
@@ -353,17 +353,17 @@
} else
goto response_parse_failure_rtpmap;
}
-
+
return 0;

 response_parse_failure_ptime:
LOGP(DLMGCP, LOGL_ERROR,
 "Failed to parse SDP parameter, invalid ptime (%s)\n", line);
-   return -EINVAL;
+   return -EINVAL;
 response_parse_failure_rtpmap:
LOGP(DLMGCP, LOGL_ERROR,
 "Failed to parse SDP parameter, invalid rtpmap (%s)\n", line);
-   return -EINVAL;
+   return -EINVAL;
 }

 /* Parse a line like "c=IN IP4 10.11.12.13" */
@@ -533,7 +533,7 @@
/* If there is an SDP body attached, prevent for_each_non_empty_line()
 * into running in there, we are not yet interested in the parameters
 * stored there. */
-   data_end = mgcp_find_section_end(data);
+   data_end = mgcp_find_section_end(data);
if (data_end)
*data_end = '\0';

@@ -979,7 +979,7 @@
for (i = 0; i < mgcp_msg->codecs_len; i++) {
pt = mgcp_msg->codecs[i];
codec = 
get_value_string_or_null(osmo_mgcpc_codec_names, pt);
-
+
/* Note: Use codec descriptors from enum mgcp_codecs
 * in mgcp_client only! */
OSMO_ASSERT(codec);
@@ -1067,7 +1067,7 @@

for (i = 0; i < mgcp_msg->codecs_len; i++) {
pt = map_codec_to_pt(mgcp_msg->ptmap, mgcp_msg->ptmap_len, 
mgcp_msg->codecs[i]);
-
+
/* Note: Only dynamic payload type from the range 96-127
 * require to be explained further via rtpmap. All others
 * are implcitly definedby the number in m=audio */
@@ -1077,11 +1077,11 @@
/* Note: Use codec descriptors from enum mgcp_codecs
 * in mgcp_client only! */
OSMO_ASSERT(codec);
-
+
rc += msgb_printf(msg, "a=rtpmap:%u %s\r\n", pt, codec);
}
}
-
+
if (mgcp_msg->ptime)
rc += msgb_printf(msg, "a=ptime:%u\r\n", mgcp_msg->ptime);


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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic3495d70cb9c4e12552c6d97481cc0cf04b79f94
Gerrit-Change-Number: 13664
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 


Change in osmo-trx[master]: add device type detection

2019-04-16 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13663 )

Change subject: add device type detection
..


Patch Set 1: Code-Review-1

(5 comments)

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

https://gerrit.osmocom.org/#/c/13663/1//COMMIT_MSG@9
PS1, Line 9: device dependant max gain setup
again, please --verbose on why those changes are made. Nobody except you has 
all that context. thanks!


https://gerrit.osmocom.org/#/c/13663/1/Transceiver52M/device/lms/LMSDevice.cpp
File Transceiver52M/device/lms/LMSDevice.cpp:

https://gerrit.osmocom.org/#/c/13663/1/Transceiver52M/device/lms/LMSDevice.cpp@203
PS1, Line 203: ,11)==0){
", 11) == 0) {" [we love our spaces]


https://gerrit.osmocom.org/#/c/13663/1/Transceiver52M/device/lms/LMSDevice.cpp@211
PS1, Line 211: else
 :  if
we typically do "} else if {" in one line


https://gerrit.osmocom.org/#/c/13663/1/Transceiver52M/device/lms/LMSDevice.cpp@416
PS1, Line 416: /FIXME crashes when called while stream is running
 : //>do_calib(chan);
that shouldn't be part of the patch, I guess that was an accident?


https://gerrit.osmocom.org/#/c/13663/1/Transceiver52M/device/lms/LMSDevice.cpp@435
PS1, Line 435: //>do_calib(chan);
that shouldn't be part of the patch, I guess that was an accident?



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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181
Gerrit-Change-Number: 13663
Gerrit-PatchSet: 1
Gerrit-Owner: roh 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Tue, 16 Apr 2019 15:26:27 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: move LMS_EnableChannel from Start/Stop to Open/Close device

2019-04-16 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13661 )

Change subject: move LMS_EnableChannel from Start/Stop to Open/Close device
..


Patch Set 1:

(1 comment)

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

https://gerrit.osmocom.org/#/c/13661/1//COMMIT_MSG@8
PS1, Line 8:
the commitlog should state *why* a change was made, not just the one-line 
summary of *what* was made.



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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I82878913254ce15a85db8d006e13d5eb639793e9
Gerrit-Change-Number: 13661
Gerrit-PatchSet: 1
Gerrit-Owner: roh 
Gerrit-CC: Harald Welte 
Gerrit-CC: Jenkins Builder (102)
Gerrit-Comment-Date: Tue, 16 Apr 2019 15:21:57 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-trx[master]: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start (bw...

2019-04-16 Thread roh
roh has uploaded this change for review. ( https://gerrit.osmocom.org/13662


Change subject: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to 
start (bw, freq, power need to be set)
..

move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start (bw, freq, 
power need to be set)

Change-Id: I1090effdf0f43e5183a402e4c1a1ffe5abdefd37
---
M Transceiver52M/device/lms/LMSDevice.cpp
M Transceiver52M/device/lms/LMSDevice.h
2 files changed, 50 insertions(+), 27 deletions(-)



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

diff --git a/Transceiver52M/device/lms/LMSDevice.cpp 
b/Transceiver52M/device/lms/LMSDevice.cpp
index cb41858..ab4e868 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -153,8 +153,8 @@
 {
//lms_info_str_t dev_str;
lms_info_str_t* info_list;
-   lms_range_t range_lpfbw_rx, range_lpfbw_tx, range_sr;
-   float_type sr_host, sr_rf, lpfbw_rx, lpfbw_tx;
+   lms_range_t range_sr;
+   float_type sr_host, sr_rf;
uint16_t dac_val;
unsigned int i, n;
int rc, dev_id;
@@ -244,36 +244,11 @@
goto out_close;
}

-   if (LMS_GetLPFBWRange(m_lms_dev, LMS_CH_RX, _lpfbw_rx))
-   goto out_close;
-   print_range("LPFBWRange Rx", _lpfbw_rx);
-   if (LMS_GetLPFBWRange(m_lms_dev, LMS_CH_RX, _lpfbw_tx))
-   goto out_close;
-   print_range("LPFBWRange Tx", _lpfbw_tx);
-   lpfbw_rx = OSMO_MIN(OSMO_MAX(1.4001e6, range_lpfbw_rx.min), 
range_lpfbw_rx.max);
-   lpfbw_tx = OSMO_MIN(OSMO_MAX(5.2e6, range_lpfbw_tx.min), 
range_lpfbw_tx.max);
-
-   LOGC(DDEV, INFO) << "LPFBW: Rx=" << lpfbw_rx << " Tx=" << lpfbw_tx;
-
if (!set_antennas()) {
LOGC(DDEV, ALERT) << "LMS antenna setting failed";
return -1;
}

-   /* Perform Rx and Tx calibration */
-   for (i=0; ihttps://gerrit.osmocom.org/13662
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1090effdf0f43e5183a402e4c1a1ffe5abdefd37
Gerrit-Change-Number: 13662
Gerrit-PatchSet: 1
Gerrit-Owner: roh 


Change in osmo-trx[master]: move LMS_EnableChannel from Start/Stop to Open/Close device

2019-04-16 Thread roh
roh has uploaded this change for review. ( https://gerrit.osmocom.org/13661


Change subject: move LMS_EnableChannel from Start/Stop to Open/Close device
..

move LMS_EnableChannel from Start/Stop to Open/Close device

Change-Id: I82878913254ce15a85db8d006e13d5eb639793e9
---
M Transceiver52M/device/lms/LMSDevice.cpp
1 file changed, 14 insertions(+), 8 deletions(-)



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

diff --git a/Transceiver52M/device/lms/LMSDevice.cpp 
b/Transceiver52M/device/lms/LMSDevice.cpp
index 52ef4a4..cb41858 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -78,8 +78,14 @@

 LMSDevice::~LMSDevice()
 {
+   unsigned int i;
LOGC(DDEV, INFO) << "Closing LMS device";
if (m_lms_dev) {
+   /* disable all channels */
+   for (i=0; ihttps://gerrit.osmocom.org/13661
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I82878913254ce15a85db8d006e13d5eb639793e9
Gerrit-Change-Number: 13661
Gerrit-PatchSet: 1
Gerrit-Owner: roh 


Change in osmo-trx[master]: add device type detection

2019-04-16 Thread roh
roh has uploaded this change for review. ( https://gerrit.osmocom.org/13663


Change subject: add device type detection
..

add device type detection

device dependant max gain setup
rework clock reference setup
remove now unused compat_LMS_VCTCXO* functions

Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181
---
M Transceiver52M/device/lms/LMSDevice.cpp
M Transceiver52M/device/lms/LMSDevice.h
2 files changed, 50 insertions(+), 45 deletions(-)



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

diff --git a/Transceiver52M/device/lms/LMSDevice.cpp 
b/Transceiver52M/device/lms/LMSDevice.cpp
index ab4e868..06c506e 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -41,24 +41,6 @@
 #define LMS_MIN_BW_SUPPORTED 2.5e6 /* 2.5mHz, minimum supported by LMS */
 #define LMS_CALIBRATE_BW_HZ OSMO_MAX(GSM_CARRIER_BW, LMS_MIN_BW_SUPPORTED)

-static int compat_LMS_VCTCXORead(lms_device_t *dev, uint16_t *val, bool memory)
-{
-#if HAVE_LMS_VCTCXO_EEPROM_SAVING
-   return LMS_VCTCXORead(dev, val, memory);
-#else
-   return LMS_VCTCXORead(dev, val);
-#endif
-}
-
-static int compat_LMS_VCTCXOWrite(lms_device_t *dev, uint16_t val, bool memory)
-{
-#if HAVE_LMS_VCTCXO_EEPROM_SAVING
-   return LMS_VCTCXOWrite(dev, val, memory);
-#else
-   return LMS_VCTCXOWrite(dev, val);
-#endif
-}
-
 LMSDevice::LMSDevice(size_t tx_sps, size_t rx_sps, InterfaceType iface, size_t 
chans, double lo_offset,
 const std::vector& tx_paths,
 const std::vector& rx_paths):
@@ -151,11 +133,10 @@

 int LMSDevice::open(const std::string , int ref, bool swap_channels)
 {
-   //lms_info_str_t dev_str;
lms_info_str_t* info_list;
+   const lms_dev_info_t* device_info;
lms_range_t range_sr;
float_type sr_host, sr_rf;
-   uint16_t dac_val;
unsigned int i, n;
int rc, dev_id;

@@ -194,12 +175,45 @@

delete [] info_list;

+   device_info = LMS_GetDeviceInfo(m_lms_dev);
+
+   if ((ref != REF_EXTERNAL) && (ref != REF_INTERNAL)){
+   LOGC(DDEV, ALERT) << "Invalid reference type";
+   goto out_close;
+   }
+
+   /* if reference clock is external setup must happen _before_ calling 
LMS_Init */
+   /* FIXME make external reference frequency configurable */
+   if (ref == REF_EXTERNAL) {
+   LOGC(DDEV, INFO) << "Setting External clock reference to 10MHz";
+   /* Assume an external 10 MHz reference clock */
+   if (LMS_SetClockFreq(m_lms_dev, LMS_CLOCK_EXTREF, 1000.0) < 
0)
+   goto out_close;
+   }
+
LOGC(DDEV, INFO) << "Init LMS device";
if (LMS_Init(m_lms_dev) != 0) {
LOGC(DDEV, ERROR) << "LMS_Init() failed";
goto out_close;
}

+   /* LimeSDR-Mini does not have switches but needs soldering to select 
external/internal clock */
+   /* LimeNET-Micro also does not like selecting internal clock*/
+   /* also set device specific maximum tx levels selected by phasenoise 
measurements*/
+   if (strncmp(device_info->deviceName,"LimeSDR-USB",11)==0){
+   /* if reference clock is internal setup must happen _after_ 
calling LMS_Init */
+   if (ref == REF_INTERNAL) {
+   LOGC(DDEV, INFO) << "Setting Internal clock reference";
+   if (LMS_SetClockFreq(m_lms_dev, LMS_CLOCK_EXTREF, -1) < 
0)
+   goto out_close;
+   }
+   maxTxGainClamp = 73.0;
+   } else
+   if (strncmp(device_info->deviceName,"LimeSDR-Mini",12)==0)
+   maxTxGainClamp = 66.0;
+   else
+   maxTxGainClamp = 71.0; /* "LimeNET-Micro", etc FIXME 
pciE based LMS boards?*/
+
/* enable all used channels */
for (i=0; i(8.9e-5 * GSMRATE * tx_sps); /* time 
* sample_rate */

-   switch (ref) {
-   case REF_INTERNAL:
-   LOGC(DDEV, INFO) << "Setting Internal clock reference";
-   /* Ugly API: Selecting clock source implicit by writing to 
VCTCXO DAC ?!? */
-   if (compat_LMS_VCTCXORead(m_lms_dev, _val, false) < 0)
-   goto out_close;
-   LOGC(DDEV, INFO) << "Setting VCTCXO to " << dac_val;
-   if (compat_LMS_VCTCXOWrite(m_lms_dev, dac_val, false) < 0)
-   goto out_close;
-   break;
-   case REF_EXTERNAL:
-   LOGC(DDEV, INFO) << "Setting External clock reference to " << 
1000.0;
-   /* Assume an external 10 MHz reference clock */
-   if (LMS_SetClockFreq(m_lms_dev, LMS_CLOCK_EXTREF, 1000.0) < 
0)
-   goto out_close;
-   break;
-   default:
-   LOGC(DDEV, ALERT) << "Invalid 

Change in osmo-trx[master]: cleanup: remove comment copied from -uhd

2019-04-16 Thread roh
roh has uploaded this change for review. ( https://gerrit.osmocom.org/13660


Change subject: cleanup: remove comment copied from -uhd
..

cleanup: remove comment copied from -uhd

Change-Id: I2bc7fcfa429d1f82c2d8e95d31dfed367f2b3f9d
---
M Transceiver52M/device/lms/LMSDevice.cpp
1 file changed, 2 insertions(+), 5 deletions(-)



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

diff --git a/Transceiver52M/device/lms/LMSDevice.cpp 
b/Transceiver52M/device/lms/LMSDevice.cpp
index b004308..52ef4a4 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -548,11 +548,8 @@
 }

 GSM::Time LMSDevice::minLatency() {
-   /* Empirical data from a handful of
-   relatively recent machines shows that the B100 will underrun when
-   the transmit threshold is reduced to a time of 6 and a half frames,
-   so we set a minimum 7 frame threshold. */
-   return GSM::Time(6,7);
+   /* UNUSED on limesdr (only used on usrp1/2) */
+   return GSM::Time(0,0);
 }

 void LMSDevice::update_stream_stats(size_t chan, bool * underrun, bool * 
overrun)

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2bc7fcfa429d1f82c2d8e95d31dfed367f2b3f9d
Gerrit-Change-Number: 13660
Gerrit-PatchSet: 1
Gerrit-Owner: roh 


Change in osmo-trx[master]: use BSC_FD_READ and not OSMO_FD_READ

2019-04-16 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/13659


Change subject: use BSC_FD_READ and not OSMO_FD_READ
..

use BSC_FD_READ and not OSMO_FD_READ

We haven't even released any tagged version of libosmocore yet which
includes support for the renamed OSMO_FD_READ constant.  Let's avoid
any breakage and use the new constants only with considerable delay,
at the very least only when released libosmocore versions provide it.

Change-Id: Idb57077b2a4b2a71dd5d75a24ded8bb5887da188
---
M Transceiver52M/osmo-trx.cpp
1 file changed, 1 insertion(+), 1 deletion(-)



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

diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp
index 7489e7c..8c592aa 100644
--- a/Transceiver52M/osmo-trx.cpp
+++ b/Transceiver52M/osmo-trx.cpp
@@ -236,7 +236,7 @@
exit(EXIT_FAILURE);
}

-   osmo_fd_setup(_ofd, sfd, OSMO_FD_READ, signalfd_callback, NULL, 
0);
+   osmo_fd_setup(_ofd, sfd, BSC_FD_READ, signalfd_callback, NULL, 
0);
if (osmo_fd_register(_ofd) < 0) {
fprintf(stderr, "osmo_fd_register() failed.\n");
exit(EXIT_FAILURE);

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb57077b2a4b2a71dd5d75a24ded8bb5887da188
Gerrit-Change-Number: 13659
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in osmo-gsm-manuals[master]: debian/control: depends: add texlive-htmlxml

2019-04-16 Thread osmith
osmith has abandoned this change. ( https://gerrit.osmocom.org/13656 )

Change subject: debian/control: depends: add texlive-htmlxml
..


Abandoned

This patch is not needed, one can set the following in the OBS project config 
instead:

 Prefer: texlive-htmlxml
--
To view, visit https://gerrit.osmocom.org/13656
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: I17d88ede172046188c2a7ecae4cca460b3055ea2
Gerrit-Change-Number: 13656
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: osmith 
Gerrit-CC: Pau Espin Pedrol 


Change in osmo-gsm-manuals[master]: debian/control: depends: add texlive-htmlxml

2019-04-16 Thread osmith
osmith has posted comments on this change. ( https://gerrit.osmocom.org/13656 )

Change subject: debian/control: depends: add texlive-htmlxml
..


Patch Set 1:

Oh, that is how it works. Thanks for explaining, I'll adjust the OBS config 
then, and update the patches. This patch can then be dropped probably.


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

Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I17d88ede172046188c2a7ecae4cca460b3055ea2
Gerrit-Change-Number: 13656
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: osmith 
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 16 Apr 2019 11:27:44 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-gsm-manuals[master]: debian/control: depends: add texlive-htmlxml

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13656 )

Change subject: debian/control: depends: add texlive-htmlxml
..


Patch Set 1:

See https://osmocom.org/issues/2537#note-5


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

Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I17d88ede172046188c2a7ecae4cca460b3055ea2
Gerrit-Change-Number: 13656
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 16 Apr 2019 11:25:43 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-ci[master]: nightly-packages: add osmo-gsm-manuals-debian8-jessie

2019-04-16 Thread osmith
osmith has posted comments on this change. ( https://gerrit.osmocom.org/13658 )

Change subject: nightly-packages: add osmo-gsm-manuals-debian8-jessie
..


Patch Set 1: Verified+1

I did:

$ ln -s /bin/true /usr/local/bin/osc

and then ran the script, and it went through successfully. It generated the 
source packages just like it should, with the right dependencies.

(Setting to WIP, because it depends on another patch.)


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

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3570599ede51b974d350064f44f77e360fafd8b0
Gerrit-Change-Number: 13658
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Tue, 16 Apr 2019 11:25:40 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-gsm-manuals[master]: debian/control: depends: add texlive-htmlxml

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13656 )

Change subject: debian/control: depends: add texlive-htmlxml
..


Patch Set 1:

I think for this kind of scenario (2 packets providing same stuff) You need to 
add some config to OBS project stating which one you want.


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

Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I17d88ede172046188c2a7ecae4cca460b3055ea2
Gerrit-Change-Number: 13656
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 16 Apr 2019 11:24:39 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-ci[master]: nightly-packages: add osmo-gsm-manuals-debian8-jessie

2019-04-16 Thread osmith
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13658


Change subject: nightly-packages: add osmo-gsm-manuals-debian8-jessie
..

nightly-packages: add osmo-gsm-manuals-debian8-jessie

Create a compatible package for debian 8 with adjusted dependencies.
While at it, refactor create_osmo_trx_debian8_jessie() into a generic
checkout_copy_debian8_jessie() function.

Related: OS#3899
Depends: I5b9575ceb1141961e570643a5755a2bd6b6a4254 (osmo-gsm-manuals)
Change-Id: I3570599ede51b974d350064f44f77e360fafd8b0
---
M scripts/osmocom-nightly-packages.sh
1 file changed, 8 insertions(+), 5 deletions(-)



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

diff --git a/scripts/osmocom-nightly-packages.sh 
b/scripts/osmocom-nightly-packages.sh
index 61cb250..27cd9dc 100755
--- a/scripts/osmocom-nightly-packages.sh
+++ b/scripts/osmocom-nightly-packages.sh
@@ -148,11 +148,12 @@
   git checkout "$TAG"
 }

-create_osmo_trx_debian8_jessie() {
-  # The package must be already checked out via `checkout osmo-trx`
+# Copy an already checked out repository dir and apply its debian 8 patch.
+# $1: Osmocom repository
+checkout_copy_debian8_jessie() {
   cd "$REPO"
-  cp -a osmo-trx osmo-trx-debian8-jessie
-  cd osmo-trx-debian8-jessie/
+  cp -a "$1" "$1-debian8-jessie"
+  cd "$1-debian8-jessie"
   patch -p1 < debian/patches/build-for-debian8.patch
   git commit -m 'auto-commit: allow debian8 to build' debian/
   cd ..
@@ -201,10 +202,12 @@
   checkout osmo-sysmon
   checkout osmo-remsim

-  create_osmo_trx_debian8_jessie
+  checkout_copy_debian8_jessie "osmo-gsm-manuals"
+  checkout_copy_debian8_jessie "osmo-trx"

   build limesuite no_commit --git-upstream-tree="$(get_last_tag limesuite)"
   build osmo-gsm-manuals
+  build osmo-gsm-manuals-debian8-jessie
   build libosmocore
   build libosmo-sccp
   build libosmo-abis

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

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3570599ede51b974d350064f44f77e360fafd8b0
Gerrit-Change-Number: 13658
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 


Change in osmo-gsm-manuals[master]: debian: add patch for debian 8

2019-04-16 Thread osmith
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13657


Change subject: debian: add patch for debian 8
..

debian: add patch for debian 8

Add a patch that changes the dependencies in debian/control, so the
package builds for debian 8. Similar to how it's done for osmo-trx.

Related: OS#3899
Change-Id: I5b9575ceb1141961e570643a5755a2bd6b6a4254
---
A debian/patches/build-for-debian8.patch
1 file changed, 34 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/57/13657/1

diff --git a/debian/patches/build-for-debian8.patch 
b/debian/patches/build-for-debian8.patch
new file mode 100644
index 000..f107109
--- /dev/null
+++ b/debian/patches/build-for-debian8.patch
@@ -0,0 +1,34 @@
+--- a/debian/control
 b/debian/control
+@@ -6,7 +6,6 @@ Build-Depends: autotools-dev,
+debhelper (>= 9),
+pkg-config,
+asciidoc,
+-   asciidoc-dblatex,
+dblatex,
+docbook5-xml,
+graphviz,
+@@ -14,7 +13,6 @@ Build-Depends: autotools-dev,
+python,
+python-nwdiag,
+python-pychart,
+-   texlive-htmlxml,
+xsltproc
+ Standards-Version: 3.9.8
+ Homepage: https://git.osmocom.org/osmo-gsm-manuals/
+@@ -23,7 +21,6 @@ Package: osmo-gsm-manuals-dev
+ Architecture: all
+ Depends: ${misc:Depends},
+  asciidoc,
+- asciidoc-dblatex,
+  dblatex,
+  docbook5-xml,
+  graphviz,
+@@ -31,7 +28,6 @@ Depends: ${misc:Depends},
+  python,
+  python-nwdiag,
+  python-pychart,
+- texlive-htmlxml,
+  xsltproc
+ Description: Osmocom manuals shared code
+  All Osomocom repositories require this package to build their manuals.

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

Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b9575ceb1141961e570643a5755a2bd6b6a4254
Gerrit-Change-Number: 13657
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 


Change in osmo-gsm-manuals[master]: debian/control: depends: add texlive-htmlxml

2019-04-16 Thread osmith
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13656


Change subject: debian/control: depends: add texlive-htmlxml
..

debian/control: depends: add texlive-htmlxml

Try to fix the "unresolvable" error in OBS for debian 9 and derivate
distributions: "have choice for jadetex needed by docbook-utils: jadetex
texlive-htmlxml".

https://build.opensuse.org/package/show/network:osmocom:nightly/osmo-gsm-manuals

Note that texlive-htmlxml is only available in debian 9 and above. But
this is also the case for asciidoc-dblatex, which means we will need to
add a patch file to make debian/control work with older debian releases
(like it is done with osmo-trx). This will come in a follow up patch.

Related: OS#3899
Change-Id: I17d88ede172046188c2a7ecae4cca460b3055ea2
---
M debian/control
1 file changed, 2 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/56/13656/1

diff --git a/debian/control b/debian/control
index 9dc03cb..cdc826d 100644
--- a/debian/control
+++ b/debian/control
@@ -15,6 +15,7 @@
python,
python-nwdiag,
python-pychart,
+   texlive-htmlxml,
xsltproc
 Standards-Version: 3.9.8
 Homepage: https://git.osmocom.org/osmo-gsm-manuals/
@@ -31,6 +32,7 @@
  python,
  python-nwdiag,
  python-pychart,
+ texlive-htmlxml,
  xsltproc
 Description: Osmocom manuals shared code
  All Osomocom repositories require this package to build their manuals.

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

Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I17d88ede172046188c2a7ecae4cca460b3055ea2
Gerrit-Change-Number: 13656
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 


Change in osmo-msc[master]: libmsc/gsm_04_11.c: properly handle TP-User-Data-Length

2019-04-16 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/13655


Change subject: libmsc/gsm_04_11.c: properly handle TP-User-Data-Length
..

libmsc/gsm_04_11.c: properly handle TP-User-Data-Length

As per 3GPP TS 03.40, section 9.2.3.16 "TP-User-Data-Length (TP-UDL)",
if the TP-User-Data is coded using the GSM 7-bit default alphabet,
the TP-User-Data-Length field indicates the *number of septets*
within the TP-User-Data field to follow. Otherwise, i.e. in case
of 8-bit or UCS-2 encoded data, the *number of octets* is indicated.

Since we store the original TP-UDL value (as received), we might
need to convert septets to octets before passing it to memcpy().
Otherwise this would lead to a buffer overrun.

Also, as we receive TPDU from untrusted source (i.e. subscriber),
the TP-UDL value needs to be checked against the corresponding
maximum (160 septets or 140 octets) and truncated if needed.

Please note that buffer overrun is still possible, e.g. when an
indicated TP-UDL value is grather than the remaining TPDU length.
Preventing this would require adding an additional check.

Change-Id: I4b08db7665e854a045129e7695e2bdf296df1688
Depends-on: (core) I54f88d2908ac47228813fb8c049f4264e5145241
---
M src/libmsc/gsm_04_11.c
1 file changed, 29 insertions(+), 12 deletions(-)



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

diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c
index 434f878..6eea662 100644
--- a/src/libmsc/gsm_04_11.c
+++ b/src/libmsc/gsm_04_11.c
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 

 #include 
 #include 
@@ -559,19 +560,35 @@
rc = GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER;
goto out;
}
-   gsms->user_data_len = *smsp++;
-   if (gsms->user_data_len) {
-   memcpy(gsms->user_data, smsp, gsms->user_data_len);

-   switch (sms_alphabet) {
-   case DCS_7BIT_DEFAULT:
-   gsm_7bit_decode_n(gsms->text, sizeof(gsms->text), smsp,
- gsms->user_data_len);
-   break;
-   case DCS_8BIT_DATA:
-   case DCS_UCS2:
-   case DCS_NONE:
-   break;
+   /* As per 3GPP TS 03.40, section 9.2.3.16, TP-User-Data-Length (TP-UDL)
+* may indicate either the number of septets, or the number of octets,
+* depending on Data Coding Scheme. We store TP-UDL value as-is,
+* so this should be kept in mind to avoid buffer overruns. */
+   gsms->user_data_len = *smsp++;
+   if (gsms->user_data_len > 0) {
+   if (sms_alphabet == DCS_7BIT_DEFAULT) {
+   /* TP-UDL is indicated in septets (up to 160) */
+   if (gsms->user_data_len > GSM340_UDL_SPT_MAX) {
+   LOG_TRANS(trans, LOGL_NOTICE,
+ "TP-User-Data-Length %u (septets) "
+ "is too big, truncating to %u\n",
+ gsms->user_data_len, 
GSM340_UDL_SPT_MAX);
+   gsms->user_data_len = GSM340_UDL_SPT_MAX;
+   }
+   memcpy(gsms->user_data, smsp, 
gsm_get_octet_len(gsms->user_data_len));
+   gsm_7bit_decode_n(gsms->text, sizeof(gsms->text),
+ smsp, gsms->user_data_len);
+   } else {
+   /* TP-UDL is indicated in octets (up to 140) */
+   if (gsms->user_data_len > GSM340_UDL_OCT_MAX) {
+   LOG_TRANS(trans, LOGL_NOTICE,
+ "TP-User-Data-Length %u (octets) "
+ "is too big, truncating to %u\n",
+ gsms->user_data_len, 
GSM340_UDL_OCT_MAX);
+   gsms->user_data_len = GSM340_UDL_OCT_MAX;
+   }
+   memcpy(gsms->user_data, smsp, gsms->user_data_len);
}
}


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b08db7665e854a045129e7695e2bdf296df1688
Gerrit-Change-Number: 13655
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 


Change in osmo-sgsn[master]: gprs_gmm: reintroduce calling gsm48_gmm_authorize when not handling G...

2019-04-16 Thread lynxis lazus
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/13654

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

Change subject: gprs_gmm: reintroduce calling gsm48_gmm_authorize when not 
handling GMM Attach Requests
..

gprs_gmm: reintroduce calling gsm48_gmm_authorize when not handling GMM Attach 
Requests

A security command is part of multiple procedures to ensure
integrity (optional also encryption) between MS and RNC.
It should be used for all Iu connections once.
With the rewrite of the GMM Attach FSM the use of the security command
procedure was broken for all procedures e.g. Service Request except GMM
Attach Request.

Relates: OS#3920
Change-Id: I50e8e316f06ae1a6171a6b07e4e2f0761322b779
---
M src/gprs/gprs_gmm.c
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/54/13654/2
--
To view, visit https://gerrit.osmocom.org/13654
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I50e8e316f06ae1a6171a6b07e4e2f0761322b779
Gerrit-Change-Number: 13654
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Pau Espin Pedrol 


Change in osmo-bts[master]: pcu_sock: use %zu conversion specifier for printing sizeof() result

2019-04-16 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/13267 )

Change subject: pcu_sock: use %zu conversion specifier for printing sizeof() 
result
..


Patch Set 5: Code-Review+2


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If5cb656537b1b73b9361a132801ab47ab7f8a709
Gerrit-Change-Number: 13267
Gerrit-PatchSet: 5
Gerrit-Owner: dexter 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: dexter 
Gerrit-Comment-Date: Tue, 16 Apr 2019 08:12:35 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bts[master]: pcu_sock: use %zu conversion specifier for printing sizeof() result

2019-04-16 Thread dexter
Hello Vadim Yanitskiy, Pau Espin Pedrol, Daniel Willmann, Max, Harald Welte, 
Jenkins Builder,

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

https://gerrit.osmocom.org/13267

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

Change subject: pcu_sock: use %zu conversion specifier for printing sizeof() 
result
..

pcu_sock: use %zu conversion specifier for printing sizeof() result

When using %lu and sizeof() for printing the compiler may throw a
warning. Lets prevent this by using %zu instead of %lu as conversion
specifier.

Change-Id: If5cb656537b1b73b9361a132801ab47ab7f8a709
---
M src/common/pcu_sock.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/67/13267/5
--
To view, visit https://gerrit.osmocom.org/13267
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If5cb656537b1b73b9361a132801ab47ab7f8a709
Gerrit-Change-Number: 13267
Gerrit-PatchSet: 5
Gerrit-Owner: dexter 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: dexter 


Change in osmo-ttcn3-hacks[master]: Rename BSSMAP_Emulation -> RAN_Emulation

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13650 )

Change subject: Rename BSSMAP_Emulation -> RAN_Emulation
..


Patch Set 1:

Looks like you need to rebase your patchset.


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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iecbcb0c6c136baad9460eca40606bb4010d8882d
Gerrit-Change-Number: 13650
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 16 Apr 2019 08:08:12 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-sgsn[master]: gprs_gmm: reintroduce calling gsm48_gmm_authorize when not handling G...

2019-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13654 )

Change subject: gprs_gmm: reintroduce calling gsm48_gmm_authorize when not 
handling GMM Attach Requests
..


Patch Set 1:

(1 comment)

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

https://gerrit.osmocom.org/#/c/13654/1//COMMIT_MSG@11
PS1, Line 11:
I'm sorry to say that, but this description doesn't explain enough what do you 
intend to do here, at least for me, and the commit change looks strange too, 
since basically you add a function call and add a comment with FIXME stating to 
remove it...

Is the commit related to some redmine issue? Can you extend the description of 
the commit?



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

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I50e8e316f06ae1a6171a6b07e4e2f0761322b779
Gerrit-Change-Number: 13654
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 16 Apr 2019 08:07:09 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Check for ==/!= null instead of isvalue()

2019-04-16 Thread dexter
dexter has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13648 )

Change subject: BSSMAP_Emulation: Check for ==/!= null instead of isvalue()
..

BSSMAP_Emulation: Check for ==/!= null instead of isvalue()

Related: OS#3932
Change-Id: I2434c776c6a4ee83e97bc04e7cbbaf1b546731c0
---
M library/BSSMAP_Emulation.ttcn
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn
index 55ce2fb..3816ed7 100644
--- a/library/BSSMAP_Emulation.ttcn
+++ b/library/BSSMAP_Emulation.ttcn
@@ -406,7 +406,7 @@
var BSSAP_ConnHdlr client := null;
client := f_imsi_table_find(bssap.pdu.bssmap.paging.iMSI.digits,
   
bssap.pdu.bssmap.paging.tMSI.tmsiOctets);
-   if (isvalue(client)) {
+   if (client != null) {
log("CommonBssmapUnitdataCallback: IMSI/TMSI found in 
table, dispatching to ",
client);
CLIENT.send(bssap) to client;

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2434c776c6a4ee83e97bc04e7cbbaf1b546731c0
Gerrit-Change-Number: 13648
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Willmann 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: dexter 


Change in osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Check for ==/!= null instead of isvalue()

2019-04-16 Thread dexter
dexter has posted comments on this change. ( https://gerrit.osmocom.org/13648 )

Change subject: BSSMAP_Emulation: Check for ==/!= null instead of isvalue()
..


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

> Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2434c776c6a4ee83e97bc04e7cbbaf1b546731c0
Gerrit-Change-Number: 13648
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Willmann 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: dexter 
Gerrit-Comment-Date: Tue, 16 Apr 2019 07:24:02 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-sgsn[master]: gprs_gmm: reintroduce calling gsm48_gmm_authorize when not handling G...

2019-04-16 Thread lynxis lazus
lynxis lazus has uploaded this change for review. ( 
https://gerrit.osmocom.org/13654


Change subject: gprs_gmm: reintroduce calling gsm48_gmm_authorize when not 
handling GMM Attach Requests
..

gprs_gmm: reintroduce calling gsm48_gmm_authorize when not handling GMM Attach 
Requests

A security command complete is part of multiple messages not only the GMM 
Attach Request and must
go through the gmm authorized as long it's not completely replaced.

Change-Id: I50e8e316f06ae1a6171a6b07e4e2f0761322b779
---
M src/gprs/gprs_gmm.c
1 file changed, 6 insertions(+), 1 deletion(-)



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

diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c
index b0c5902..358bff9 100644
--- a/src/gprs/gprs_gmm.c
+++ b/src/gprs/gprs_gmm.c
@@ -205,7 +205,12 @@
REQUIRE_MM
/* Continue authentication here */
mm->iu.ue_ctx->integrity_active = 1;
-   osmo_fsm_inst_dispatch(mm->gmm_att_req.fsm, 
E_IU_SECURITY_CMD_COMPLETE, NULL);
+
+   /* FIXME: remove gmm_authorize */
+   if (mm->pending_req != GSM48_MT_GMM_ATTACH_REQ)
+   gsm48_gmm_authorize(mm);
+   else
+   osmo_fsm_inst_dispatch(mm->gmm_att_req.fsm, 
E_IU_SECURITY_CMD_COMPLETE, NULL);
break;
default:
LOGP(DRANAP, LOGL_NOTICE, "Unknown event received: %i\n", type);

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

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I50e8e316f06ae1a6171a6b07e4e2f0761322b779
Gerrit-Change-Number: 13654
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus