From 91cecc051a19439733f8b86575e51f94015361ff Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 18 Jul 2017 17:13:45 +0200 Subject: lc15: fix BTS revision and hw options * remove typo in logging * add missing return statement * fix compilation warnings * add detailed logging for supported GSM band and related errors Change-Id: I73bccd81ec56845ba11b939937b295eb0f51b4a8 Related: SYS#3728 --- src/osmo-bts-litecell15/l1_if.c | 18 ++++++++++++++---- src/osmo-bts-litecell15/misc/lc15bts_bid.c | 4 +--- 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'src/osmo-bts-litecell15') diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index b82a7c6c..cb3efab7 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -1369,7 +1369,7 @@ static int info_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp, fl1h->hw_info.fpga_version[1] = sic->fpgaVersion.minor; fl1h->hw_info.fpga_version[2] = sic->fpgaVersion.build; - LOGP(DL1C, LOGL_INFO, "DSP v%u.%u.%u, FPGA v%u.%u.%u\nn", + LOGP(DL1C, LOGL_INFO, "DSP v%u.%u.%u, FPGA v%u.%u.%u\n", sic->dspVersion.major, sic->dspVersion.minor, sic->dspVersion.build, sic->fpgaVersion.major, sic->fpgaVersion.minor, sic->fpgaVersion.build); @@ -1468,18 +1468,24 @@ static int get_hwinfo(struct lc15l1_hdl *fl1h) int rc; rc = lc15bts_rev_get(); - if (rc < 0) + if (rc < 0) { + LOGP(DL1C, LOGL_ERROR, "Failed to obtain LC15BTS revision: %d\n", rc); return rc; + } fl1h->hw_info.ver_major = rc; rc = lc15bts_model_get(); - if (rc < 0) + if (rc < 0) { + LOGP(DL1C, LOGL_ERROR, "Failed to obtain LC15BTS model: %d\n", rc); return rc; + } fl1h->hw_info.ver_minor = rc; rc = lc15bts_option_get(LC15BTS_OPTION_BAND); - if (rc < 0) + if (rc < 0) { + LOGP(DL1C, LOGL_ERROR, "Failed to obtain LC15BTS_OPTION_BAND: %d\n", rc); return rc; + } switch (rc) { case LC15BTS_BAND_850: @@ -1495,8 +1501,12 @@ static int get_hwinfo(struct lc15l1_hdl *fl1h) fl1h->hw_info.band_support = GSM_BAND_1900; break; default: + LOGP(DL1C, LOGL_ERROR, "Unexpected LC15BTS_BAND value: %d\n", rc); return -1; } + + LOGP(DL1C, LOGL_INFO, "BTS hw support band %s\n", gsm_band_name(fl1h->hw_info.band_support)); + return 0; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_bid.c b/src/osmo-bts-litecell15/misc/lc15bts_bid.c index ba2037a8..7f278bff 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_bid.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_bid.c @@ -87,11 +87,11 @@ static inline bool read_board(const char *src, const char *spec, void *dst) return false; } fclose(fp); + return true; } int lc15bts_rev_get(void) { - FILE *fp; char rev; if (board_rev != -1) { @@ -107,9 +107,7 @@ int lc15bts_rev_get(void) int lc15bts_model_get(void) { - FILE *fp; int opt; - bool rc; if (board_option != -1) return board_option; -- cgit v1.2.3