aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo/misc/sysmobts_mgr_2050.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-08-21 23:51:13 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-08-21 23:55:27 +0200
commit1f8053e366c9d0f4ab7160595a3cb1ead915e0d6 (patch)
treee10f2099acc0f5204feff094df0fe75b4c9c3061 /src/osmo-bts-sysmo/misc/sysmobts_mgr_2050.c
parente02d7796c3cb4eaeca679286bc6db12b9b2c070b (diff)
sysmobts: Enable the PA on start and disable it as first action
The PA will be unconditionally turned. This makes it possible that in case of a crash, the PA will be turned on and then we will do the temperature measurement and turn it off again. There are no known crashes with the sysmobts-mgr right now so the risk seems to be okay. In case we can't switch off the PA we have no way to escalate it right now. We have not seen a dead uc either so the risk is okay as well. We can't switch the PA back on once we reach the normal level as the BTS might transmit with full power and we would need more current than the power supply/rails can carry. So leave the system off right now. What is missing is to use the OML router to actually inform the BSC that something bad has happened at the BTS.
Diffstat (limited to 'src/osmo-bts-sysmo/misc/sysmobts_mgr_2050.c')
-rw-r--r--src/osmo-bts-sysmo/misc/sysmobts_mgr_2050.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_2050.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_2050.c
index cdb78323..3064319f 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_2050.c
+++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_2050.c
@@ -247,7 +247,7 @@ int sbts2050_uc_get_status(struct sbts2050_power_status *status)
/**********************************************************************
* Uc Power Switching handling
*********************************************************************/
-void sbts2050_uc_set_power(int pmaster, int pslave, int ppa)
+int sbts2050_uc_set_power(int pmaster, int pslave, int ppa)
{
struct msgb *msg;
const struct ucinfo info = {
@@ -261,7 +261,7 @@ void sbts2050_uc_set_power(int pmaster, int pslave, int ppa)
if (msg == NULL) {
LOGP(DTEMP, LOGL_ERROR, "Error switching off some unit.\n");
- return;
+ return -1;
}
LOGP(DTEMP, LOGL_DEBUG, "Switch off/on success:\n"
@@ -273,6 +273,7 @@ void sbts2050_uc_set_power(int pmaster, int pslave, int ppa)
ppa ? "ON" : "OFF");
msgb_free(msg);
+ return 0;
}
/**********************************************************************
@@ -317,6 +318,20 @@ void sbts2050_uc_initialize(void)
"Failed to open the serial interface\n");
return;
}
+
+ LOGP(DTEMP, LOGL_NOTICE, "Going to enable the PA.\n");
+ sbts2050_uc_set_pa_power(1);
+}
+
+int sbts2050_uc_set_pa_power(int on_off)
+{
+ struct sbts2050_power_status status;
+ if (sbts2050_uc_get_status(&status) != 0) {
+ LOGP(DTEMP, LOGL_ERROR, "Failed to read current power status.\n");
+ return -1;
+ }
+
+ return sbts2050_uc_set_power(status.master_enabled, status.slave_enabled, on_off);
}
#else
void sbts2050_uc_initialize(void)
@@ -338,4 +353,10 @@ int sbts2050_uc_get_status(struct sbts2050_power_status *status)
return -1;
}
+int sbts2050_uc_set_pa_power(int on_off)
+{
+ LOGP(DTEMP, LOGL_ERROR, "sysmoBTS2050 compiled without PA support.\n");
+ return -1;
+}
+
#endif