Review at https://gerrit.osmocom.org/4446
octphy: override firmware version check When osmo-bts detects a mismatch between the firmware of the DSP and the header version which it was compile with, a hard exit is performed. In some cases this may hinder debugging/testing things. Implement a commandline option to intentinally override the check. Change-Id: I5774fbb29da832786326afb991014b9bd8b04b59 --- M src/osmo-bts-octphy/l1_oml.c M src/osmo-bts-octphy/main.c 2 files changed, 23 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/46/4446/1 diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c index d1d5bf6..5846e21 100644 --- a/src/osmo-bts-octphy/l1_oml.c +++ b/src/osmo-bts-octphy/l1_oml.c @@ -52,6 +52,8 @@ #include <octphy/octvc1/main/octvc1_main_default.h> #include <octphy/octvc1/main/octvc1_main_version.h> +int no_fw_check = 0; + /* Map OSMOCOM logical channel type to OctPHY Logical channel type */ static tOCTVC1_GSM_LOGICAL_CHANNEL_COMBINATION_ENUM pchan_to_logChComb[_GSM_PCHAN_MAX] = { @@ -1161,11 +1163,23 @@ "Rx APP-INFO.resp (name='%s', desc='%s', ver='%s', ver_hdr='%s')\n", air->szName, air->szDescription, air->szVersion, ver_hdr); - /* Bail if dsp firmware does not match up the header version info */ + /* Check if the firmware version of the DSP matches the header files + * that were used to compile osmo-bts */ if (strcmp(air->szVersion, ver_hdr) != 0) { LOGP(DL1C, LOGL_ERROR, - "Invalid header-file / dsp-firmware combination, exiting...\n"); - exit(1); + "Invalid header-file-version / dsp-firmware-version combination\n"); + LOGP(DL1C, LOGL_ERROR, + "Expected firmware version: %s\n", air->szVersion); + LOGP(DL1C, LOGL_ERROR, + "Actual firmware version: %s\n", ver_hdr); + + if (no_fw_check == 0) { + LOGP(DL1C, LOGL_ERROR, + "use option -I to override the check (not recommened)\n"); + LOGP(DL1C, LOGL_ERROR, + "exiting...\n"); + exit(1); + } } talloc_replace(fl1h->info.app.name, fl1h, air->szName); diff --git a/src/osmo-bts-octphy/main.c b/src/osmo-bts-octphy/main.c index 0f4d0dd..045b868 100644 --- a/src/osmo-bts-octphy/main.c +++ b/src/osmo-bts-octphy/main.c @@ -51,6 +51,7 @@ #define RF_LOCK_PATH "/var/lock/bts_rf_lock" extern int pcu_direct; +extern int no_fw_check; int bts_model_print_help() { @@ -65,15 +66,19 @@ int option_idx = 0, c; static const struct option long_options[] = { /* specific to this hardware */ + { "no-fw-check", 0, 0, 'I' }, { 0, 0, 0, 0 } }; - c = getopt_long(argc, argv, "", + c = getopt_long(argc, argv, "I", long_options, &option_idx); if (c == -1) break; switch (c) { + case 'I': + no_fw_check = 1; + break; default: num_errors++; break; -- To view, visit https://gerrit.osmocom.org/4446 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5774fbb29da832786326afb991014b9bd8b04b59 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter <pma...@sysmocom.de>