aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-octphy
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-10-27 14:58:56 +0200
committerHarald Welte <laforge@gnumonks.org>2017-11-08 04:43:55 +0000
commit80117acba6588f09b356dd416a964f4d6129ffd4 (patch)
tree9aa5e5f6b3c0cff6e7a594a3ec2d009ce7231b9e /src/osmo-bts-octphy
parent14566e3ceda0b0f14d3ab4f41d41f5276125aa0c (diff)
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
Diffstat (limited to 'src/osmo-bts-octphy')
-rw-r--r--src/osmo-bts-octphy/l1_oml.c20
-rw-r--r--src/osmo-bts-octphy/main.c8
2 files changed, 24 insertions, 4 deletions
diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c
index d1d5bf6a..a1c384a7 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 @@ static int app_info_compl_cb(struct octphy_hdl *fl1h, struct msgb *resp,
"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 0f4d0dd4..928a4c81 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 bts_model_handle_options(int argc, char **argv)
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;