Harald Welte has submitted this change and it was merged.

Change subject: octphy: override firmware version check
......................................................................


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, 24 insertions(+), 4 deletions(-)

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



diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c
index d1d5bf6..a1c384a 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>
 
+bool 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", ver_hdr);
+               LOGP(DL1C, LOGL_ERROR,
+                    "Actual firmware version:   %s\n", air->szVersion);
+
+               if (!no_fw_check) {
+                       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..928a4c8 100644
--- a/src/osmo-bts-octphy/main.c
+++ b/src/osmo-bts-octphy/main.c
@@ -51,9 +51,11 @@
 #define RF_LOCK_PATH   "/var/lock/bts_rf_lock"
 
 extern int pcu_direct;
+extern bool no_fw_check;
 
 int bts_model_print_help()
 {
+       printf("  -I    --no-fw-check   Override firmware version check\n");
        return 0;
 }
 
@@ -65,15 +67,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 = true;
+                       break;
                default:
                        num_errors++;
                        break;

-- 
To view, visit https://gerrit.osmocom.org/4446
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5774fbb29da832786326afb991014b9bd8b04b59
Gerrit-PatchSet: 5
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter <pma...@sysmocom.de>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>

Reply via email to