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
This commit is contained in:
Max 2017-07-18 17:13:45 +02:00
parent 173a4f1f79
commit 91cecc051a
2 changed files with 15 additions and 7 deletions

View File

@ -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;
}

View File

@ -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;