Kévin Redon | 9a12d68 | 2018-07-08 13:21:16 +0200 | [diff] [blame] | 1 | /* SIMtrace 2 firmware card emulation application |
| 2 | * |
| 3 | * (C) 2015-2017 by Harald Welte <hwelte@hmw-consulting.de> |
Kévin Redon | ad0958e | 2018-09-06 22:49:56 +0200 | [diff] [blame] | 4 | * (C) 2018, sysmocom -s.f.m.c. GmbH, Author: Kevin Redon <kredon@sysmocom.de> |
Kévin Redon | 9a12d68 | 2018-07-08 13:21:16 +0200 | [diff] [blame] | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 | */ |
Christina Quast | 32906bb | 2015-02-24 11:35:19 +0100 | [diff] [blame] | 20 | /*------------------------------------------------------------------------------ |
| 21 | * Headers |
| 22 | *------------------------------------------------------------------------------*/ |
| 23 | |
| 24 | #include "board.h" |
Harald Welte | 1605564 | 2016-03-03 11:02:45 +0100 | [diff] [blame] | 25 | #include "simtrace.h" |
Harald Welte | ebbb645 | 2016-02-29 17:57:51 +0100 | [diff] [blame] | 26 | #include "utils.h" |
Harald Welte | 9d90d28 | 2018-06-29 22:25:42 +0200 | [diff] [blame] | 27 | #include <osmocom/core/timer.h> |
Christina Quast | 32906bb | 2015-02-24 11:35:19 +0100 | [diff] [blame] | 28 | |
Harald Welte | d525231 | 2017-02-27 20:34:20 +0100 | [diff] [blame] | 29 | unsigned int g_unique_id[4]; |
Harald Welte | 8ee15db | 2016-03-20 16:00:39 +0100 | [diff] [blame] | 30 | |
Christina Quast | 32906bb | 2015-02-24 11:35:19 +0100 | [diff] [blame] | 31 | /*------------------------------------------------------------------------------ |
Christina Quast | 32906bb | 2015-02-24 11:35:19 +0100 | [diff] [blame] | 32 | * Internal variables |
| 33 | *------------------------------------------------------------------------------*/ |
Christina Quast | fb524b9 | 2015-02-27 13:39:45 +0100 | [diff] [blame] | 34 | typedef struct { |
Harald Welte | 7dd3dfd | 2016-03-03 12:32:04 +0100 | [diff] [blame] | 35 | /* static initialization, called whether or not the usb config is active */ |
| 36 | void (*configure) (void); |
| 37 | /* initialization function after the config was selected */ |
| 38 | void (*init) (void); |
| 39 | /* de-initialization before selecting new config */ |
| 40 | void (*exit) (void); |
| 41 | /* main loop content for given configuration */ |
| 42 | void (*run) (void); |
Harald Welte | 3bafe43 | 2016-03-20 16:43:12 +0100 | [diff] [blame] | 43 | /* Interrupt handler for USART1 */ |
| 44 | void (*usart0_irq) (void); |
| 45 | /* Interrupt handler for USART1 */ |
| 46 | void (*usart1_irq) (void); |
Christina Quast | fb524b9 | 2015-02-27 13:39:45 +0100 | [diff] [blame] | 47 | } conf_func; |
| 48 | |
Harald Welte | d4c1421 | 2015-11-07 18:25:46 +0100 | [diff] [blame] | 49 | static const conf_func config_func_ptrs[] = { |
Harald Welte | fefd571 | 2015-11-07 18:19:11 +0100 | [diff] [blame] | 50 | /* array slot 0 is empty, usb configs start at 1 */ |
Harald Welte | 2fb5996 | 2016-02-28 12:34:26 +0100 | [diff] [blame] | 51 | #ifdef HAVE_SNIFFER |
Harald Welte | fefd571 | 2015-11-07 18:19:11 +0100 | [diff] [blame] | 52 | [CFG_NUM_SNIFF] = { |
| 53 | .configure = Sniffer_configure, |
| 54 | .init = Sniffer_init, |
| 55 | .exit = Sniffer_exit, |
| 56 | .run = Sniffer_run, |
| 57 | }, |
Harald Welte | 2fb5996 | 2016-02-28 12:34:26 +0100 | [diff] [blame] | 58 | #endif |
| 59 | #ifdef HAVE_CCID |
Harald Welte | fefd571 | 2015-11-07 18:19:11 +0100 | [diff] [blame] | 60 | [CFG_NUM_CCID] = { |
| 61 | .configure = CCID_configure, |
| 62 | .init = CCID_init, |
| 63 | .exit = CCID_exit, |
| 64 | .run = CCID_run, |
| 65 | }, |
Harald Welte | 2fb5996 | 2016-02-28 12:34:26 +0100 | [diff] [blame] | 66 | #endif |
| 67 | #ifdef HAVE_CARDEM |
Harald Welte | fefd571 | 2015-11-07 18:19:11 +0100 | [diff] [blame] | 68 | [CFG_NUM_PHONE] = { |
Harald Welte | 2a6d3af | 2016-02-28 19:29:14 +0100 | [diff] [blame] | 69 | .configure = mode_cardemu_configure, |
| 70 | .init = mode_cardemu_init, |
| 71 | .exit = mode_cardemu_exit, |
| 72 | .run = mode_cardemu_run, |
Harald Welte | 3bafe43 | 2016-03-20 16:43:12 +0100 | [diff] [blame] | 73 | .usart0_irq = mode_cardemu_usart0_irq, |
| 74 | .usart1_irq = mode_cardemu_usart1_irq, |
Harald Welte | fefd571 | 2015-11-07 18:19:11 +0100 | [diff] [blame] | 75 | }, |
Harald Welte | 2fb5996 | 2016-02-28 12:34:26 +0100 | [diff] [blame] | 76 | #endif |
| 77 | #ifdef HAVE_MITM |
Harald Welte | fefd571 | 2015-11-07 18:19:11 +0100 | [diff] [blame] | 78 | [CFG_NUM_MITM] = { |
| 79 | .configure = MITM_configure, |
| 80 | .init = MITM_init, |
| 81 | .exit = MITM_exit, |
Harald Welte | 7dd3dfd | 2016-03-03 12:32:04 +0100 | [diff] [blame] | 82 | .run = MITM_run, |
Harald Welte | fefd571 | 2015-11-07 18:19:11 +0100 | [diff] [blame] | 83 | }, |
Harald Welte | 2fb5996 | 2016-02-28 12:34:26 +0100 | [diff] [blame] | 84 | #endif |
Christina Quast | fb524b9 | 2015-02-27 13:39:45 +0100 | [diff] [blame] | 85 | }; |
| 86 | |
Christina Quast | fb524b9 | 2015-02-27 13:39:45 +0100 | [diff] [blame] | 87 | /*------------------------------------------------------------------------------ |
| 88 | * Internal variables |
| 89 | *------------------------------------------------------------------------------*/ |
Harald Welte | 2fb5996 | 2016-02-28 12:34:26 +0100 | [diff] [blame] | 90 | #if defined(HAVE_SNIFFER) |
Harald Welte | 8d6a5d8 | 2015-11-07 18:27:05 +0100 | [diff] [blame] | 91 | static volatile enum confNum simtrace_config = CFG_NUM_SNIFF; |
Harald Welte | 2fb5996 | 2016-02-28 12:34:26 +0100 | [diff] [blame] | 92 | #elif defined(HAVE_CARDEM) |
| 93 | static volatile enum confNum simtrace_config = CFG_NUM_PHONE; |
| 94 | #elif defined(HAVE_CCID) |
| 95 | static volatile enum confNum simtrace_config = CFG_NUM_CCID; |
| 96 | #endif |
| 97 | |
Harald Welte | 8d6a5d8 | 2015-11-07 18:27:05 +0100 | [diff] [blame] | 98 | /*---------------------------------------------------------------------------- |
| 99 | * Callbacks |
| 100 | *----------------------------------------------------------------------------*/ |
| 101 | |
| 102 | void USBDDriverCallbacks_ConfigurationChanged(uint8_t cfgnum) |
| 103 | { |
Harald Welte | 7dd3dfd | 2016-03-03 12:32:04 +0100 | [diff] [blame] | 104 | TRACE_INFO_WP("cfgChanged%d ", cfgnum); |
Kévin Redon | 7d5d011 | 2018-09-06 22:46:54 +0200 | [diff] [blame] | 105 | if (cfgnum < ARRAY_SIZE(config_func_ptrs)) { |
| 106 | simtrace_config = cfgnum; |
| 107 | } else { |
| 108 | TRACE_ERROR("trying to set out of bounds config %u\r\n", cfgnum); |
| 109 | } |
Harald Welte | 8d6a5d8 | 2015-11-07 18:27:05 +0100 | [diff] [blame] | 110 | } |
Christina Quast | 32906bb | 2015-02-24 11:35:19 +0100 | [diff] [blame] | 111 | |
Harald Welte | 3bafe43 | 2016-03-20 16:43:12 +0100 | [diff] [blame] | 112 | void USART1_IrqHandler(void) |
| 113 | { |
Harald Welte | 2afd57f | 2017-11-28 22:52:56 +0100 | [diff] [blame] | 114 | if (config_func_ptrs[simtrace_config].usart1_irq) |
| 115 | config_func_ptrs[simtrace_config].usart1_irq(); |
Harald Welte | 3bafe43 | 2016-03-20 16:43:12 +0100 | [diff] [blame] | 116 | } |
| 117 | |
| 118 | void USART0_IrqHandler(void) |
| 119 | { |
Harald Welte | 2afd57f | 2017-11-28 22:52:56 +0100 | [diff] [blame] | 120 | if (config_func_ptrs[simtrace_config].usart0_irq) |
| 121 | config_func_ptrs[simtrace_config].usart0_irq(); |
Harald Welte | 3bafe43 | 2016-03-20 16:43:12 +0100 | [diff] [blame] | 122 | } |
| 123 | |
Harald Welte | f9a182d | 2017-01-11 22:22:16 +0100 | [diff] [blame] | 124 | /* returns '1' in case we should break any endless loop */ |
Harald Welte | af61479 | 2017-01-12 18:59:41 +0100 | [diff] [blame] | 125 | static void check_exec_dbg_cmd(void) |
Harald Welte | 006b16d | 2016-12-22 21:29:10 +0100 | [diff] [blame] | 126 | { |
Harald Welte | aa3b867 | 2017-02-10 19:21:10 +0100 | [diff] [blame] | 127 | int ch; |
Harald Welte | 006b16d | 2016-12-22 21:29:10 +0100 | [diff] [blame] | 128 | |
| 129 | if (!UART_IsRxReady()) |
| 130 | return; |
| 131 | |
Harald Welte | aa3b867 | 2017-02-10 19:21:10 +0100 | [diff] [blame] | 132 | ch = UART_GetChar(); |
Kévin Redon | 4f3a035 | 2018-09-06 22:48:11 +0200 | [diff] [blame] | 133 | /* We must echo the character to make python fdexpect happy, which we use in factory testing */ |
Harald Welte | 4689345 | 2018-07-03 22:30:30 +0200 | [diff] [blame] | 134 | fputc(ch, stdout); |
Harald Welte | aa3b867 | 2017-02-10 19:21:10 +0100 | [diff] [blame] | 135 | board_exec_dbg_cmd(ch); |
Harald Welte | 006b16d | 2016-12-22 21:29:10 +0100 | [diff] [blame] | 136 | } |
Harald Welte | e974fbb | 2016-10-19 19:36:07 +0200 | [diff] [blame] | 137 | |
Christina Quast | 32906bb | 2015-02-24 11:35:19 +0100 | [diff] [blame] | 138 | /*------------------------------------------------------------------------------ |
Christina Quast | 95d6616 | 2015-04-09 22:38:47 +0200 | [diff] [blame] | 139 | * Main |
Christina Quast | 32906bb | 2015-02-24 11:35:19 +0100 | [diff] [blame] | 140 | *------------------------------------------------------------------------------*/ |
Harald Welte | 7dd3dfd | 2016-03-03 12:32:04 +0100 | [diff] [blame] | 141 | #define MAX_USB_ITER BOARD_MCK/72 // This should be around a second |
| 142 | extern int main(void) |
Christina Quast | 32906bb | 2015-02-24 11:35:19 +0100 | [diff] [blame] | 143 | { |
Harald Welte | 7dd3dfd | 2016-03-03 12:32:04 +0100 | [diff] [blame] | 144 | uint8_t isUsbConnected = 0; |
| 145 | enum confNum last_simtrace_config = simtrace_config; |
| 146 | unsigned int i = 0; |
Christina Quast | 1161b27 | 2015-02-25 14:15:57 +0100 | [diff] [blame] | 147 | |
Harald Welte | abba8a8 | 2017-03-06 16:58:00 +0100 | [diff] [blame] | 148 | led_init(); |
| 149 | led_blink(LED_RED, BLINK_3O_5F); |
Christina Quast | 32906bb | 2015-02-24 11:35:19 +0100 | [diff] [blame] | 150 | |
Kévin Redon | d8ebd6a | 2018-07-28 19:04:23 +0200 | [diff] [blame] | 151 | /* Enable watchdog for 2000ms, with no window */ |
Harald Welte | 45ebe45 | 2017-03-03 19:01:53 +0100 | [diff] [blame] | 152 | WDT_Enable(WDT, WDT_MR_WDRSTEN | WDT_MR_WDDBGHLT | WDT_MR_WDIDLEHLT | |
Kévin Redon | d8ebd6a | 2018-07-28 19:04:23 +0200 | [diff] [blame] | 153 | (WDT_GetPeriod(2000) << 16) | WDT_GetPeriod(2000)); |
Christina Quast | 32906bb | 2015-02-24 11:35:19 +0100 | [diff] [blame] | 154 | |
Harald Welte | 7dd3dfd | 2016-03-03 12:32:04 +0100 | [diff] [blame] | 155 | PIO_InitializeInterrupts(0); |
Christina Quast | 32906bb | 2015-02-24 11:35:19 +0100 | [diff] [blame] | 156 | |
Harald Welte | 8ee15db | 2016-03-20 16:00:39 +0100 | [diff] [blame] | 157 | EEFC_ReadUniqueID(g_unique_id); |
| 158 | |
Kévin Redon | 33d1eb7 | 2018-07-08 13:58:12 +0200 | [diff] [blame] | 159 | printf("\n\r\n\r" |
Harald Welte | ec0837c | 2017-03-03 01:33:24 +0100 | [diff] [blame] | 160 | "=============================================================================\n\r" |
| 161 | "SIMtrace2 firmware " GIT_VERSION " (C) 2010-2016 by Harald Welte\n\r" |
| 162 | "=============================================================================\n\r"); |
Harald Welte | 2315e6b | 2016-03-19 21:37:55 +0100 | [diff] [blame] | 163 | |
Kévin Redon | 738a04a | 2018-07-28 19:02:54 +0200 | [diff] [blame] | 164 | #if (TRACE_LEVEL >= TRACE_LEVEL_INFO) |
Harald Welte | c394109 | 2018-08-26 09:53:13 +0200 | [diff] [blame] | 165 | TRACE_INFO("Chip ID: 0x%08lx (Ext 0x%08lx)\n\r", CHIPID->CHIPID_CIDR, CHIPID->CHIPID_EXID); |
Harald Welte | ec0837c | 2017-03-03 01:33:24 +0100 | [diff] [blame] | 166 | TRACE_INFO("Serial Nr. %08x-%08x-%08x-%08x\n\r", |
Harald Welte | 8ee15db | 2016-03-20 16:00:39 +0100 | [diff] [blame] | 167 | g_unique_id[0], g_unique_id[1], |
| 168 | g_unique_id[2], g_unique_id[3]); |
Kévin Redon | 738a04a | 2018-07-28 19:02:54 +0200 | [diff] [blame] | 169 | uint8_t reset_cause = (RSTC->RSTC_SR & RSTC_SR_RSTTYP_Msk) >> RSTC_SR_RSTTYP_Pos; |
| 170 | static const char* reset_causes[] = { |
| 171 | "general reset (first power-up reset)", |
| 172 | "backup reset (return from backup mode)", |
| 173 | "watchdog reset (watchdog fault occurred)", |
| 174 | "software reset (processor reset required by the software)", |
| 175 | "user reset (NRST pin detected low)", |
| 176 | }; |
| 177 | if (reset_cause < ARRAY_SIZE(reset_causes)) { |
| 178 | TRACE_INFO("Reset Cause: %s\n\r", reset_causes[reset_cause]); |
| 179 | } else { |
Harald Welte | c394109 | 2018-08-26 09:53:13 +0200 | [diff] [blame] | 180 | TRACE_INFO("Reset Cause: 0x%lx\n\r", (RSTC->RSTC_SR & RSTC_SR_RSTTYP_Msk) >> RSTC_SR_RSTTYP_Pos); |
Kévin Redon | 738a04a | 2018-07-28 19:02:54 +0200 | [diff] [blame] | 181 | } |
| 182 | #endif |
Harald Welte | 8ee15db | 2016-03-20 16:00:39 +0100 | [diff] [blame] | 183 | |
Harald Welte | aa3b867 | 2017-02-10 19:21:10 +0100 | [diff] [blame] | 184 | board_main_top(); |
Harald Welte | 6732248 | 2017-02-04 14:43:41 +0100 | [diff] [blame] | 185 | |
Harald Welte | ec0837c | 2017-03-03 01:33:24 +0100 | [diff] [blame] | 186 | TRACE_INFO("USB init...\n\r"); |
Harald Welte | e07aed6 | 2016-12-22 22:32:15 +0100 | [diff] [blame] | 187 | SIMtrace_USB_Initialize(); |
| 188 | |
Harald Welte | 7dd3dfd | 2016-03-03 12:32:04 +0100 | [diff] [blame] | 189 | while (USBD_GetState() < USBD_STATE_CONFIGURED) { |
Harald Welte | 45ebe45 | 2017-03-03 19:01:53 +0100 | [diff] [blame] | 190 | WDT_Restart(WDT); |
Harald Welte | 006b16d | 2016-12-22 21:29:10 +0100 | [diff] [blame] | 191 | check_exec_dbg_cmd(); |
Harald Welte | 67415e3 | 2016-09-01 20:57:56 +0200 | [diff] [blame] | 192 | #if 0 |
Harald Welte | 7dd3dfd | 2016-03-03 12:32:04 +0100 | [diff] [blame] | 193 | if (i >= MAX_USB_ITER * 3) { |
| 194 | TRACE_ERROR("Resetting board (USB could " |
Harald Welte | ec0837c | 2017-03-03 01:33:24 +0100 | [diff] [blame] | 195 | "not be configured)\n\r"); |
Harald Welte | f415d71 | 2017-03-03 01:51:43 +0100 | [diff] [blame] | 196 | USBD_Disconnect(); |
Harald Welte | 7dd3dfd | 2016-03-03 12:32:04 +0100 | [diff] [blame] | 197 | NVIC_SystemReset(); |
| 198 | } |
Harald Welte | 67415e3 | 2016-09-01 20:57:56 +0200 | [diff] [blame] | 199 | #endif |
Harald Welte | 7dd3dfd | 2016-03-03 12:32:04 +0100 | [diff] [blame] | 200 | i++; |
| 201 | } |
Christina Quast | de68867 | 2015-04-12 15:20:57 +0200 | [diff] [blame] | 202 | |
Harald Welte | ec0837c | 2017-03-03 01:33:24 +0100 | [diff] [blame] | 203 | TRACE_INFO("calling configure of all configurations...\n\r"); |
Harald Welte | 7dd3dfd | 2016-03-03 12:32:04 +0100 | [diff] [blame] | 204 | for (i = 1; i < sizeof(config_func_ptrs) / sizeof(config_func_ptrs[0]); |
| 205 | ++i) { |
| 206 | if (config_func_ptrs[i].configure) |
| 207 | config_func_ptrs[i].configure(); |
| 208 | } |
Christina Quast | 95d6616 | 2015-04-09 22:38:47 +0200 | [diff] [blame] | 209 | |
Harald Welte | ec0837c | 2017-03-03 01:33:24 +0100 | [diff] [blame] | 210 | TRACE_INFO("calling init of config %u...\n\r", simtrace_config); |
Kévin Redon | 7d5d011 | 2018-09-06 22:46:54 +0200 | [diff] [blame] | 211 | if (config_func_ptrs[simtrace_config].init) { |
| 212 | config_func_ptrs[simtrace_config].init(); |
| 213 | } |
Harald Welte | 7dd3dfd | 2016-03-03 12:32:04 +0100 | [diff] [blame] | 214 | last_simtrace_config = simtrace_config; |
Christina Quast | 95d6616 | 2015-04-09 22:38:47 +0200 | [diff] [blame] | 215 | |
Harald Welte | ec0837c | 2017-03-03 01:33:24 +0100 | [diff] [blame] | 216 | TRACE_INFO("entering main loop...\n\r"); |
Harald Welte | 7dd3dfd | 2016-03-03 12:32:04 +0100 | [diff] [blame] | 217 | while (1) { |
Harald Welte | 45ebe45 | 2017-03-03 19:01:53 +0100 | [diff] [blame] | 218 | WDT_Restart(WDT); |
Harald Welte | 04e37a8 | 2016-03-20 15:15:34 +0100 | [diff] [blame] | 219 | #if TRACE_LEVEL >= TRACE_LEVEL_DEBUG |
Harald Welte | 7dd3dfd | 2016-03-03 12:32:04 +0100 | [diff] [blame] | 220 | const char rotor[] = { '-', '\\', '|', '/' }; |
| 221 | putchar('\b'); |
| 222 | putchar(rotor[i++ % ARRAY_SIZE(rotor)]); |
Harald Welte | 04e37a8 | 2016-03-20 15:15:34 +0100 | [diff] [blame] | 223 | #endif |
Harald Welte | 006b16d | 2016-12-22 21:29:10 +0100 | [diff] [blame] | 224 | check_exec_dbg_cmd(); |
Harald Welte | 987f59a | 2017-02-04 12:34:35 +0100 | [diff] [blame] | 225 | osmo_timers_prepare(); |
| 226 | osmo_timers_update(); |
Christina Quast | 1161b27 | 2015-02-25 14:15:57 +0100 | [diff] [blame] | 227 | |
Harald Welte | 7dd3dfd | 2016-03-03 12:32:04 +0100 | [diff] [blame] | 228 | if (USBD_GetState() < USBD_STATE_CONFIGURED) { |
Christina Quast | 1161b27 | 2015-02-25 14:15:57 +0100 | [diff] [blame] | 229 | |
Harald Welte | 7dd3dfd | 2016-03-03 12:32:04 +0100 | [diff] [blame] | 230 | if (isUsbConnected) { |
| 231 | isUsbConnected = 0; |
| 232 | } |
| 233 | } else if (isUsbConnected == 0) { |
Harald Welte | ec0837c | 2017-03-03 01:33:24 +0100 | [diff] [blame] | 234 | TRACE_INFO("USB is now configured\n\r"); |
Christina Quast | 1161b27 | 2015-02-25 14:15:57 +0100 | [diff] [blame] | 235 | |
Harald Welte | 7dd3dfd | 2016-03-03 12:32:04 +0100 | [diff] [blame] | 236 | isUsbConnected = 1; |
| 237 | } |
| 238 | if (last_simtrace_config != simtrace_config) { |
Harald Welte | ec0837c | 2017-03-03 01:33:24 +0100 | [diff] [blame] | 239 | TRACE_INFO("USB config chg %u -> %u\n\r", |
Harald Welte | 7dd3dfd | 2016-03-03 12:32:04 +0100 | [diff] [blame] | 240 | last_simtrace_config, simtrace_config); |
Kévin Redon | 7d5d011 | 2018-09-06 22:46:54 +0200 | [diff] [blame] | 241 | if (config_func_ptrs[last_simtrace_config].exit) { |
| 242 | config_func_ptrs[last_simtrace_config].exit(); |
| 243 | } |
| 244 | if (config_func_ptrs[simtrace_config].init) { |
| 245 | config_func_ptrs[simtrace_config].init(); |
| 246 | } |
Harald Welte | 7dd3dfd | 2016-03-03 12:32:04 +0100 | [diff] [blame] | 247 | last_simtrace_config = simtrace_config; |
| 248 | } else { |
Kévin Redon | 7d5d011 | 2018-09-06 22:46:54 +0200 | [diff] [blame] | 249 | if (config_func_ptrs[simtrace_config].run) { |
| 250 | config_func_ptrs[simtrace_config].run(); |
| 251 | } |
Harald Welte | 7dd3dfd | 2016-03-03 12:32:04 +0100 | [diff] [blame] | 252 | } |
| 253 | } |
Christina Quast | 32906bb | 2015-02-24 11:35:19 +0100 | [diff] [blame] | 254 | } |