From 7b6ea56f4185a7c11b7ba50ee373854ca2074368 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 16 Aug 2011 14:29:53 +0200 Subject: 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. --- openbsc/src/osmo-bsc/osmo_bsc_ctrl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'openbsc/src/osmo-bsc') diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c index 8f0db7e88..6802b4252 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c @@ -388,19 +388,19 @@ static int set_net_rf_lock(struct ctrl_cmd *cmd, void *data) { 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."; -- cgit v1.2.3