bsc: Use the BSC RF CTRL to change the RF state of the TRXs
Use the delayed scheduling feature of the osmo_bsc_rf class to
avoid crashing the site controller of the nanoBTS.
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
index 8f0db7e..6802b42 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
@@ -388,19 +388,19 @@
{
int locked = atoi(cmd->value);
struct gsm_network *net = cmd->node;
- struct gsm_bts *bts;
if (!net) {
cmd->reply = "net not found.";
return CTRL_CMD_ERROR;
}
- llist_for_each_entry(bts, &net->bts_list, list) {
- struct gsm_bts_trx *trx;
- llist_for_each_entry(trx, &bts->trx_list, list) {
- gsm_trx_lock_rf(trx, locked);
- }
+ if (!net->bsc_data->rf_ctrl) {
+ cmd->reply = "RF Ctrl not enabled";
+ return CTRL_CMD_ERROR;
}
+ osmo_bsc_rf_schedule_lock(net->bsc_data->rf_ctrl,
+ locked == 1 ? '0' : '1');
+
cmd->reply = talloc_asprintf(cmd, "%u", locked);
if (!cmd->reply) {
cmd->reply = "OOM.";