bsc: In preparation to the MT lac/ci patching split the code

For MT we can't page per lac as we don't know which BTS was
the original one. Split the grace period and normal mode into
two methods so we can bloat both of them later.
This commit is contained in:
Holger Hans Peter Freyther 2015-04-01 18:19:45 +02:00
parent 32dd2f3f9b
commit 067ce6dea5
1 changed files with 21 additions and 11 deletions

View File

@ -33,17 +33,19 @@ int bsc_grace_allow_new_connection(struct gsm_network *network, struct gsm_bts *
return network->bsc_data->rf_ctrl->policy == S_RF_ON;
}
/**
* Try to not page if everything the cell is not on.
*/
int bsc_grace_paging_request(struct gsm_subscriber *subscr, int chan_needed,
struct osmo_msc_data *msc)
static int normal_paging(struct gsm_subscriber *subscr, int chan_needed,
struct osmo_msc_data *msc)
{
return paging_request(subscr->group->net, subscr, chan_needed, NULL,
msc);
}
static int locked_paging(struct gsm_subscriber *subscr, int chan_needed,
struct osmo_msc_data *msc)
{
struct gsm_bts *bts = NULL;
if (subscr->group->net->bsc_data->rf_ctrl->policy == S_RF_ON)
goto page;
/*
* Check if there is any BTS that is on for the given lac. Start
* with NULL and iterate through all bts.
@ -67,9 +69,17 @@ int bsc_grace_paging_request(struct gsm_subscriber *subscr, int chan_needed,
/* All bts are either off or in the grace period */
return 0;
page:
return paging_request(subscr->group->net, subscr, chan_needed, NULL,
msc);
}
/**
* Try to not page if everything the cell is not on.
*/
int bsc_grace_paging_request(struct gsm_subscriber *subscr, int chan_needed,
struct osmo_msc_data *msc)
{
if (subscr->group->net->bsc_data->rf_ctrl->policy == S_RF_ON)
return normal_paging(subscr, chan_needed, msc);
return locked_paging(subscr, chan_needed, msc);
}
static int handle_sub(struct gsm_lchan *lchan, const char *text)