[PATCH] osmo-bts[master]: lc15: fix BTS revision and hw options

2017-07-18 Thread Max
Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/3275

to look at the new patch set (#2).

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
---
M src/osmo-bts-litecell15/l1_if.c
M src/osmo-bts-litecell15/misc/lc15bts_bid.c
2 files changed, 15 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/75/3275/2

diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index b82a7c6..cb3efab 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -1369,7 +1369,7 @@
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 @@
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 @@
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 ba2037a..7f278bf 100644
--- a/src/osmo-bts-litecell15/misc/lc15bts_bid.c
+++ b/src/osmo-bts-litecell15/misc/lc15bts_bid.c
@@ -87,11 +87,11 @@
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_model_get(void)
 {
-FILE *fp;
 int opt;
-   bool rc;
 
 if (board_option != -1)
return board_option;

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I73bccd81ec56845ba11b939937b295eb0f51b4a8
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 


[PATCH] osmo-bts[master]: lc15: fix BTS revision and hw options

2017-07-18 Thread Max

Review at  https://gerrit.osmocom.org/3275

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
---
M src/osmo-bts-litecell15/l1_if.c
M src/osmo-bts-litecell15/misc/lc15bts_bid.c
2 files changed, 15 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/75/3275/1

diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index b82a7c6..3f42624 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -1369,7 +1369,7 @@
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 @@
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 @@
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_DEBUG, "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 ba2037a..7f278bf 100644
--- a/src/osmo-bts-litecell15/misc/lc15bts_bid.c
+++ b/src/osmo-bts-litecell15/misc/lc15bts_bid.c
@@ -87,11 +87,11 @@
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_model_get(void)
 {
-FILE *fp;
 int opt;
-   bool rc;
 
 if (board_option != -1)
return board_option;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I73bccd81ec56845ba11b939937b295eb0f51b4a8
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max