2009-01-06 21:47:18 +00:00
|
|
|
/* Paging helper and manager.... */
|
2013-01-07 16:30:13 +00:00
|
|
|
/* (C) 2009,2013 by Holger Hans Peter Freyther <zecke@selfish.org>
|
2009-01-06 21:47:18 +00:00
|
|
|
* All Rights Reserved
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
2011-01-01 14:25:50 +00:00
|
|
|
* it under the terms of the GNU Affero General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2009-01-06 21:47:18 +00:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2011-01-01 14:25:50 +00:00
|
|
|
* GNU Affero General Public License for more details.
|
2009-01-06 21:47:18 +00:00
|
|
|
*
|
2011-01-01 14:25:50 +00:00
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2009-01-06 21:47:18 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Relevant specs:
|
|
|
|
* 12.21:
|
|
|
|
* - 9.4.12 for CCCH Local Threshold
|
|
|
|
*
|
|
|
|
* 05.58:
|
|
|
|
* - 8.5.2 CCCH Load indication
|
|
|
|
* - 9.3.15 Paging Load
|
|
|
|
*
|
|
|
|
* Approach:
|
|
|
|
* - Send paging command to subscriber
|
|
|
|
* - On Channel Request we will remember the reason
|
|
|
|
* - After the ACK we will request the identity
|
|
|
|
* - Then we will send assign the gsm_subscriber and
|
|
|
|
* - and call a callback
|
|
|
|
*/
|
|
|
|
|
2009-01-06 23:50:39 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2009-02-14 18:05:03 +00:00
|
|
|
#include <assert.h>
|
2009-01-06 23:50:39 +00:00
|
|
|
|
2011-03-22 15:47:59 +00:00
|
|
|
#include <osmocom/core/talloc.h>
|
2011-06-26 12:21:43 +00:00
|
|
|
#include <osmocom/gsm/gsm48.h>
|
2011-06-26 12:41:58 +00:00
|
|
|
#include <osmocom/gsm/gsm0502.h>
|
2011-06-26 12:21:43 +00:00
|
|
|
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
#include <openbsc/bsc_subscriber.h>
|
2011-06-26 12:21:43 +00:00
|
|
|
#include <openbsc/paging.h>
|
2009-01-06 21:47:18 +00:00
|
|
|
#include <openbsc/debug.h>
|
2009-02-14 22:51:03 +00:00
|
|
|
#include <openbsc/signal.h>
|
2009-01-06 23:50:39 +00:00
|
|
|
#include <openbsc/abis_rsl.h>
|
2009-02-06 18:54:00 +00:00
|
|
|
#include <openbsc/gsm_data.h>
|
2010-04-09 22:06:17 +00:00
|
|
|
#include <openbsc/chan_alloc.h>
|
2010-06-17 08:43:24 +00:00
|
|
|
#include <openbsc/bsc_api.h>
|
2016-06-19 16:06:02 +00:00
|
|
|
#include <openbsc/vlr.h>
|
2009-01-06 21:47:18 +00:00
|
|
|
|
2009-08-15 00:30:58 +00:00
|
|
|
void *tall_paging_ctx;
|
2009-06-20 20:36:41 +00:00
|
|
|
|
2010-09-06 02:05:23 +00:00
|
|
|
#define PAGING_TIMER 0, 500000
|
|
|
|
|
2009-01-06 23:10:57 +00:00
|
|
|
/*
|
|
|
|
* Kill one paging request update the internal list...
|
|
|
|
*/
|
2009-02-09 23:42:03 +00:00
|
|
|
static void paging_remove_request(struct gsm_bts_paging_state *paging_bts,
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
struct gsm_paging_request *to_be_deleted)
|
2009-02-06 18:08:18 +00:00
|
|
|
{
|
2011-05-06 10:11:06 +00:00
|
|
|
osmo_timer_del(&to_be_deleted->T3113);
|
2009-01-06 23:10:57 +00:00
|
|
|
llist_del(&to_be_deleted->entry);
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
bsc_subscr_put(to_be_deleted->bsub);
|
2009-06-20 20:36:41 +00:00
|
|
|
talloc_free(to_be_deleted);
|
2009-01-06 23:10:57 +00:00
|
|
|
}
|
|
|
|
|
2009-02-06 22:33:25 +00:00
|
|
|
static void page_ms(struct gsm_paging_request *request)
|
|
|
|
{
|
2011-04-18 15:04:00 +00:00
|
|
|
uint8_t mi[128];
|
2009-01-06 23:50:39 +00:00
|
|
|
unsigned int mi_len;
|
2009-02-06 22:33:25 +00:00
|
|
|
unsigned int page_group;
|
2011-06-26 12:43:46 +00:00
|
|
|
struct gsm_bts *bts = request->bts;
|
2009-02-06 22:33:25 +00:00
|
|
|
|
2012-12-22 18:27:27 +00:00
|
|
|
/* the bts is down.. we will just wait for the paging to expire */
|
|
|
|
if (!bts->oml_link)
|
|
|
|
return;
|
|
|
|
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
log_set_context(LOG_CTX_BSC_SUBSCR, request->bsub);
|
2014-12-28 14:00:36 +00:00
|
|
|
|
2017-02-09 18:13:02 +00:00
|
|
|
LOGP(DPAG, LOGL_INFO, "Going to send paging commands: imsi: %s tmsi: "
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
"0x%08x for ch. type %d (attempt %d)\n", request->bsub->imsi,
|
|
|
|
request->bsub->tmsi, request->chan_type, request->attempts);
|
2009-08-21 12:55:57 +00:00
|
|
|
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
if (request->bsub->tmsi == GSM_RESERVED_TMSI)
|
|
|
|
mi_len = gsm48_generate_mid_from_imsi(mi, request->bsub->imsi);
|
2009-08-21 12:55:57 +00:00
|
|
|
else
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
mi_len = gsm48_generate_mid_from_tmsi(mi, request->bsub->tmsi);
|
2009-02-06 22:33:25 +00:00
|
|
|
|
2011-06-26 12:43:46 +00:00
|
|
|
page_group = gsm0502_calc_paging_group(&bts->si_common.chan_desc,
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
str_to_imsi(request->bsub->imsi));
|
2011-06-26 12:43:46 +00:00
|
|
|
gsm0808_page(bts, page_group, mi_len, mi, request->chan_type);
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
log_set_context(LOG_CTX_BSC_SUBSCR, NULL);
|
2009-02-06 22:33:25 +00:00
|
|
|
}
|
|
|
|
|
2010-09-06 02:05:23 +00:00
|
|
|
static void paging_schedule_if_needed(struct gsm_bts_paging_state *paging_bts)
|
|
|
|
{
|
|
|
|
if (llist_empty(&paging_bts->pending_requests))
|
|
|
|
return;
|
|
|
|
|
2011-05-06 10:11:06 +00:00
|
|
|
if (!osmo_timer_pending(&paging_bts->work_timer))
|
|
|
|
osmo_timer_schedule(&paging_bts->work_timer, PAGING_TIMER);
|
2010-09-06 02:05:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-04-20 02:59:33 +00:00
|
|
|
static void paging_handle_pending_requests(struct gsm_bts_paging_state *paging_bts);
|
2010-04-19 11:41:26 +00:00
|
|
|
static void paging_give_credit(void *data)
|
|
|
|
{
|
|
|
|
struct gsm_bts_paging_state *paging_bts = data;
|
|
|
|
|
|
|
|
LOGP(DPAG, LOGL_NOTICE, "No slots available on bts nr %d\n", paging_bts->bts->nr);
|
|
|
|
paging_bts->available_slots = 20;
|
2010-04-20 02:59:33 +00:00
|
|
|
paging_handle_pending_requests(paging_bts);
|
2010-04-19 11:41:26 +00:00
|
|
|
}
|
|
|
|
|
2010-09-06 02:11:25 +00:00
|
|
|
static int can_send_pag_req(struct gsm_bts *bts, int rsl_type)
|
|
|
|
{
|
|
|
|
struct pchan_load pl;
|
|
|
|
int count;
|
|
|
|
|
|
|
|
memset(&pl, 0, sizeof(pl));
|
2016-09-25 15:01:20 +00:00
|
|
|
bts_chan_load(&pl, bts);
|
2010-09-06 02:11:25 +00:00
|
|
|
|
|
|
|
switch (rsl_type) {
|
|
|
|
case RSL_CHANNEED_TCH_F:
|
|
|
|
case RSL_CHANNEED_TCH_ForH:
|
2010-04-20 09:15:21 +00:00
|
|
|
goto count_tch;
|
2010-09-06 02:11:25 +00:00
|
|
|
break;
|
|
|
|
case RSL_CHANNEED_SDCCH:
|
|
|
|
goto count_sdcch;
|
|
|
|
break;
|
|
|
|
case RSL_CHANNEED_ANY:
|
|
|
|
default:
|
|
|
|
if (bts->network->pag_any_tch)
|
2010-04-20 09:15:21 +00:00
|
|
|
goto count_tch;
|
2010-09-06 02:11:25 +00:00
|
|
|
else
|
|
|
|
goto count_sdcch;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* could available SDCCH */
|
|
|
|
count_sdcch:
|
|
|
|
count = 0;
|
|
|
|
count += pl.pchan[GSM_PCHAN_SDCCH8_SACCH8C].total
|
|
|
|
- pl.pchan[GSM_PCHAN_SDCCH8_SACCH8C].used;
|
|
|
|
count += pl.pchan[GSM_PCHAN_CCCH_SDCCH4].total
|
|
|
|
- pl.pchan[GSM_PCHAN_CCCH_SDCCH4].used;
|
|
|
|
return bts->paging.free_chans_need > count;
|
2010-04-20 09:15:21 +00:00
|
|
|
|
|
|
|
count_tch:
|
|
|
|
count = 0;
|
|
|
|
count += pl.pchan[GSM_PCHAN_TCH_F].total
|
|
|
|
- pl.pchan[GSM_PCHAN_TCH_F].used;
|
|
|
|
if (bts->network->neci)
|
|
|
|
count += pl.pchan[GSM_PCHAN_TCH_H].total
|
|
|
|
- pl.pchan[GSM_PCHAN_TCH_H].used;
|
|
|
|
return bts->paging.free_chans_need > count;
|
2010-09-06 02:11:25 +00:00
|
|
|
}
|
|
|
|
|
2009-02-14 18:05:03 +00:00
|
|
|
/*
|
|
|
|
* This is kicked by the periodic PAGING LOAD Indicator
|
|
|
|
* coming from abis_rsl.c
|
|
|
|
*
|
|
|
|
* We attempt to iterate once over the list of items but
|
|
|
|
* only upto available_slots.
|
|
|
|
*/
|
2009-02-11 01:49:15 +00:00
|
|
|
static void paging_handle_pending_requests(struct gsm_bts_paging_state *paging_bts)
|
|
|
|
{
|
2010-09-06 02:05:23 +00:00
|
|
|
struct gsm_paging_request *request = NULL;
|
2009-02-14 18:05:03 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Determine if the pending_requests list is empty and
|
|
|
|
* return then.
|
|
|
|
*/
|
2009-02-17 01:39:41 +00:00
|
|
|
if (llist_empty(&paging_bts->pending_requests)) {
|
|
|
|
/* since the list is empty, no need to reschedule the timer */
|
2009-01-06 23:10:57 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-04-09 16:38:06 +00:00
|
|
|
/*
|
2010-04-19 11:41:26 +00:00
|
|
|
* In case the BTS does not provide us with load indication and we
|
|
|
|
* ran out of slots, call an autofill routine. It might be that the
|
|
|
|
* BTS did not like our paging messages and then we have counted down
|
|
|
|
* to zero and we do not get any messages.
|
2010-04-09 16:38:06 +00:00
|
|
|
*/
|
|
|
|
if (paging_bts->available_slots == 0) {
|
2017-05-08 18:57:52 +00:00
|
|
|
osmo_timer_setup(&paging_bts->credit_timer, paging_give_credit,
|
|
|
|
paging_bts);
|
2011-05-06 10:11:06 +00:00
|
|
|
osmo_timer_schedule(&paging_bts->credit_timer, 5, 0);
|
2010-04-19 11:41:26 +00:00
|
|
|
return;
|
2010-04-09 16:38:06 +00:00
|
|
|
}
|
|
|
|
|
2010-09-06 02:05:23 +00:00
|
|
|
request = llist_entry(paging_bts->pending_requests.next,
|
|
|
|
struct gsm_paging_request, entry);
|
2009-02-14 18:05:03 +00:00
|
|
|
|
2010-09-06 02:11:25 +00:00
|
|
|
/* we need to determine the number of free channels */
|
|
|
|
if (paging_bts->free_chans_need != -1) {
|
|
|
|
if (can_send_pag_req(request->bts, request->chan_type) != 0)
|
|
|
|
goto skip_paging;
|
|
|
|
}
|
|
|
|
|
2010-09-06 02:05:23 +00:00
|
|
|
/* handle the paging request now */
|
|
|
|
page_ms(request);
|
|
|
|
paging_bts->available_slots--;
|
2010-12-23 17:19:17 +00:00
|
|
|
request->attempts++;
|
2009-02-14 18:05:03 +00:00
|
|
|
|
2010-09-06 02:05:23 +00:00
|
|
|
/* take the current and add it to the back */
|
|
|
|
llist_del(&request->entry);
|
|
|
|
llist_add_tail(&request->entry, &paging_bts->pending_requests);
|
2010-04-09 19:53:35 +00:00
|
|
|
|
2010-09-06 02:11:25 +00:00
|
|
|
skip_paging:
|
2011-05-06 10:11:06 +00:00
|
|
|
osmo_timer_schedule(&paging_bts->work_timer, PAGING_TIMER);
|
2009-02-17 01:39:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void paging_worker(void *data)
|
|
|
|
{
|
|
|
|
struct gsm_bts_paging_state *paging_bts = data;
|
|
|
|
|
|
|
|
paging_handle_pending_requests(paging_bts);
|
2009-01-06 23:10:57 +00:00
|
|
|
}
|
|
|
|
|
2011-04-26 13:44:57 +00:00
|
|
|
static void paging_init_if_needed(struct gsm_bts *bts)
|
2009-02-06 18:54:00 +00:00
|
|
|
{
|
2011-04-26 13:44:57 +00:00
|
|
|
if (bts->paging.bts)
|
|
|
|
return;
|
|
|
|
|
2009-02-06 18:54:00 +00:00
|
|
|
bts->paging.bts = bts;
|
|
|
|
INIT_LLIST_HEAD(&bts->paging.pending_requests);
|
2017-05-08 18:57:52 +00:00
|
|
|
osmo_timer_setup(&bts->paging.work_timer, paging_worker,
|
|
|
|
&bts->paging);
|
2009-02-10 00:06:19 +00:00
|
|
|
|
|
|
|
/* Large number, until we get a proper message */
|
2010-04-09 20:55:55 +00:00
|
|
|
bts->paging.available_slots = 20;
|
2009-02-06 18:54:00 +00:00
|
|
|
}
|
|
|
|
|
2009-02-09 23:42:03 +00:00
|
|
|
static int paging_pending_request(struct gsm_bts_paging_state *bts,
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
struct bsc_subscr *bsub)
|
|
|
|
{
|
2009-02-06 18:54:00 +00:00
|
|
|
struct gsm_paging_request *req;
|
2009-01-06 21:47:18 +00:00
|
|
|
|
|
|
|
llist_for_each_entry(req, &bts->pending_requests, entry) {
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
if (bsub == req->bsub)
|
2009-01-06 21:47:18 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-02-10 17:35:04 +00:00
|
|
|
static void paging_T3113_expired(void *data)
|
|
|
|
{
|
2009-02-14 18:04:59 +00:00
|
|
|
struct gsm_paging_request *req = (struct gsm_paging_request *)data;
|
2009-11-17 09:16:46 +00:00
|
|
|
void *cbfn_param;
|
|
|
|
gsm_cbfn *cbfn;
|
2010-12-23 17:19:17 +00:00
|
|
|
int msg;
|
2009-02-10 17:35:04 +00:00
|
|
|
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
log_set_context(LOG_CTX_BSC_SUBSCR, req->bsub);
|
2014-12-28 14:00:36 +00:00
|
|
|
|
2010-04-09 20:02:39 +00:00
|
|
|
LOGP(DPAG, LOGL_INFO, "T3113 expired for request %p (%s)\n",
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
req, bsc_subscr_name(req->bsub));
|
2009-02-16 22:05:44 +00:00
|
|
|
|
2009-11-17 09:16:46 +00:00
|
|
|
/* must be destroyed before calling cbfn, to prevent double free */
|
2016-08-02 09:34:11 +00:00
|
|
|
rate_ctr_inc(&req->bts->network->bsc_ctrs->ctr[BSC_CTR_PAGING_EXPIRED]);
|
2009-11-17 09:16:46 +00:00
|
|
|
cbfn_param = req->cbfn_param;
|
|
|
|
cbfn = req->cbfn;
|
2010-12-23 17:19:17 +00:00
|
|
|
|
|
|
|
/* did we ever manage to page the subscriber */
|
|
|
|
msg = req->attempts > 0 ? GSM_PAGING_EXPIRED : GSM_PAGING_BUSY;
|
|
|
|
|
|
|
|
/* destroy it now. Do not access req afterwards */
|
2009-02-10 17:35:04 +00:00
|
|
|
paging_remove_request(&req->bts->paging, req);
|
2009-11-17 09:16:46 +00:00
|
|
|
|
|
|
|
if (cbfn)
|
2010-12-23 17:19:17 +00:00
|
|
|
cbfn(GSM_HOOK_RR_PAGING, msg, NULL, NULL,
|
2009-11-17 09:16:46 +00:00
|
|
|
cbfn_param);
|
2014-12-28 14:00:36 +00:00
|
|
|
|
2009-02-10 17:35:04 +00:00
|
|
|
}
|
|
|
|
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
static int _paging_request(struct gsm_bts *bts, struct bsc_subscr *bsub,
|
|
|
|
int type, gsm_cbfn *cbfn, void *data)
|
2009-02-16 22:52:23 +00:00
|
|
|
{
|
2009-02-06 18:54:00 +00:00
|
|
|
struct gsm_bts_paging_state *bts_entry = &bts->paging;
|
|
|
|
struct gsm_paging_request *req;
|
2009-01-06 21:47:18 +00:00
|
|
|
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
if (paging_pending_request(bts_entry, bsub)) {
|
|
|
|
LOGP(DPAG, LOGL_INFO, "Paging request already pending for %s\n",
|
|
|
|
bsc_subscr_name(bsub));
|
2009-08-15 01:16:17 +00:00
|
|
|
return -EEXIST;
|
2009-02-14 23:53:20 +00:00
|
|
|
}
|
|
|
|
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
LOGP(DPAG, LOGL_DEBUG, "Start paging of subscriber %s on bts %d.\n",
|
|
|
|
bsc_subscr_name(bsub), bts->nr);
|
2009-06-26 18:25:23 +00:00
|
|
|
req = talloc_zero(tall_paging_ctx, struct gsm_paging_request);
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
req->bsub = bsc_subscr_get(bsub);
|
2009-01-06 21:47:18 +00:00
|
|
|
req->bts = bts;
|
2009-01-06 23:10:57 +00:00
|
|
|
req->chan_type = type;
|
2009-02-16 22:52:23 +00:00
|
|
|
req->cbfn = cbfn;
|
|
|
|
req->cbfn_param = data;
|
2017-05-08 18:57:52 +00:00
|
|
|
osmo_timer_setup(&req->T3113, paging_T3113_expired, req);
|
2011-05-06 10:11:06 +00:00
|
|
|
osmo_timer_schedule(&req->T3113, bts->network->T3113, 0);
|
2009-02-14 23:53:20 +00:00
|
|
|
llist_add_tail(&req->entry, &bts_entry->pending_requests);
|
2010-09-06 02:05:23 +00:00
|
|
|
paging_schedule_if_needed(bts_entry);
|
2009-08-15 01:16:17 +00:00
|
|
|
|
|
|
|
return 0;
|
2009-01-06 21:47:18 +00:00
|
|
|
}
|
2009-02-06 12:52:14 +00:00
|
|
|
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
int paging_request_bts(struct gsm_bts *bts, struct bsc_subscr *bsub,
|
|
|
|
int type, gsm_cbfn *cbfn, void *data)
|
2013-01-07 16:30:13 +00:00
|
|
|
{
|
|
|
|
int rc;
|
|
|
|
|
|
|
|
/* skip all currently inactive TRX */
|
|
|
|
if (!trx_is_usable(bts->c0))
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* maybe it is the first time we use it */
|
|
|
|
paging_init_if_needed(bts);
|
|
|
|
|
|
|
|
/* Trigger paging, pass any error to the caller */
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
rc = _paging_request(bts, bsub, type, cbfn, data);
|
2013-01-07 16:30:13 +00:00
|
|
|
if (rc < 0)
|
|
|
|
return rc;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
int paging_request(struct gsm_network *network, struct bsc_subscr *bsub,
|
2009-08-15 01:16:17 +00:00
|
|
|
int type, gsm_cbfn *cbfn, void *data)
|
2009-06-10 00:45:42 +00:00
|
|
|
{
|
|
|
|
struct gsm_bts *bts = NULL;
|
2009-08-15 09:25:45 +00:00
|
|
|
int num_pages = 0;
|
2009-06-10 00:45:42 +00:00
|
|
|
|
2016-08-02 09:34:11 +00:00
|
|
|
rate_ctr_inc(&network->bsc_ctrs->ctr[BSC_CTR_PAGING_ATTEMPTED]);
|
2009-12-21 23:41:05 +00:00
|
|
|
|
2009-08-01 17:31:47 +00:00
|
|
|
/* start paging subscriber on all BTS within Location Area */
|
2009-06-10 00:45:42 +00:00
|
|
|
do {
|
2009-08-15 09:25:45 +00:00
|
|
|
int rc;
|
|
|
|
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
bts = gsm_bts_by_lac(network, bsub->lac, bts);
|
2009-06-10 00:45:42 +00:00
|
|
|
if (!bts)
|
|
|
|
break;
|
2009-12-28 15:36:28 +00:00
|
|
|
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
rc = paging_request_bts(bts, bsub, type, cbfn, data);
|
2015-08-03 09:19:35 +00:00
|
|
|
if (rc < 0) {
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
paging_request_stop(&network->bts_list, NULL, bsub,
|
|
|
|
NULL, NULL);
|
2009-08-15 01:16:17 +00:00
|
|
|
return rc;
|
2015-08-03 09:19:35 +00:00
|
|
|
}
|
2013-01-07 16:30:13 +00:00
|
|
|
num_pages += rc;
|
2009-06-10 00:45:42 +00:00
|
|
|
} while (1);
|
2009-08-15 01:16:17 +00:00
|
|
|
|
2009-12-21 23:41:05 +00:00
|
|
|
if (num_pages == 0)
|
2016-08-02 09:34:11 +00:00
|
|
|
rate_ctr_inc(&network->bsc_ctrs->ctr[BSC_CTR_PAGING_DETACHED]);
|
2009-12-21 23:41:05 +00:00
|
|
|
|
2009-08-15 09:25:45 +00:00
|
|
|
return num_pages;
|
2009-06-10 00:45:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-02-06 12:52:14 +00:00
|
|
|
/* we consciously ignore the type of the request here */
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
static void _paging_request_stop(struct gsm_bts *bts, struct bsc_subscr *bsub,
|
2010-12-01 20:41:35 +00:00
|
|
|
struct gsm_subscriber_connection *conn,
|
|
|
|
struct msgb *msg)
|
2009-02-06 12:52:14 +00:00
|
|
|
{
|
2009-02-06 18:54:00 +00:00
|
|
|
struct gsm_bts_paging_state *bts_entry = &bts->paging;
|
|
|
|
struct gsm_paging_request *req, *req2;
|
2009-02-06 12:52:14 +00:00
|
|
|
|
2011-04-26 13:44:57 +00:00
|
|
|
paging_init_if_needed(bts);
|
|
|
|
|
2009-02-06 12:52:14 +00:00
|
|
|
llist_for_each_entry_safe(req, req2, &bts_entry->pending_requests,
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
entry) {
|
|
|
|
if (req->bsub == bsub) {
|
2015-04-06 14:54:55 +00:00
|
|
|
gsm_cbfn *cbfn = req->cbfn;
|
|
|
|
void *param = req->cbfn_param;
|
|
|
|
|
|
|
|
/* now give up the data structure */
|
|
|
|
paging_remove_request(&bts->paging, req);
|
|
|
|
req = NULL;
|
|
|
|
|
|
|
|
if (conn && cbfn) {
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
LOGP(DPAG, LOGL_DEBUG, "Stop paging %s on bts %d, calling cbfn.\n", bsub->imsi, bts->nr);
|
2015-04-06 14:54:55 +00:00
|
|
|
cbfn(GSM_HOOK_RR_PAGING, GSM_PAGING_SUCCEEDED,
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
msg, conn, param);
|
2009-06-10 15:11:52 +00:00
|
|
|
} else
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
LOGP(DPAG, LOGL_DEBUG, "Stop paging %s on bts %d silently.\n", bsub->imsi, bts->nr);
|
2009-02-06 18:08:18 +00:00
|
|
|
break;
|
|
|
|
}
|
2009-02-06 12:52:14 +00:00
|
|
|
}
|
|
|
|
}
|
2009-02-10 00:06:19 +00:00
|
|
|
|
2009-06-10 00:45:42 +00:00
|
|
|
/* Stop paging on all other bts' */
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
void paging_request_stop(struct llist_head *bts_list,
|
|
|
|
struct gsm_bts *_bts, struct bsc_subscr *bsub,
|
2010-12-01 20:41:35 +00:00
|
|
|
struct gsm_subscriber_connection *conn,
|
|
|
|
struct msgb *msg)
|
2009-06-10 00:45:42 +00:00
|
|
|
{
|
2015-08-03 09:20:31 +00:00
|
|
|
struct gsm_bts *bts;
|
2009-06-10 00:45:42 +00:00
|
|
|
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
log_set_context(LOG_CTX_BSC_SUBSCR, bsub);
|
2014-12-28 14:00:36 +00:00
|
|
|
|
2015-08-03 09:20:31 +00:00
|
|
|
/* Stop this first and dispatch the request */
|
2009-08-21 03:43:44 +00:00
|
|
|
if (_bts)
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
_paging_request_stop(_bts, bsub, conn, msg);
|
2009-06-10 09:46:58 +00:00
|
|
|
|
2015-08-03 09:20:31 +00:00
|
|
|
/* Make sure to cancel this everywhere else */
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
llist_for_each_entry(bts, bts_list, list) {
|
2015-08-03 09:20:31 +00:00
|
|
|
/* Sort of an optimization. */
|
|
|
|
if (bts == _bts)
|
|
|
|
continue;
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
_paging_request_stop(bts, bsub, NULL, NULL);
|
2015-08-03 09:20:31 +00:00
|
|
|
}
|
2009-06-10 00:45:42 +00:00
|
|
|
}
|
|
|
|
|
2011-04-18 15:04:00 +00:00
|
|
|
void paging_update_buffer_space(struct gsm_bts *bts, uint16_t free_slots)
|
2009-02-10 00:06:19 +00:00
|
|
|
{
|
2011-04-26 13:44:57 +00:00
|
|
|
paging_init_if_needed(bts);
|
|
|
|
|
2011-05-06 10:11:06 +00:00
|
|
|
osmo_timer_del(&bts->paging.credit_timer);
|
2009-02-10 00:06:19 +00:00
|
|
|
bts->paging.available_slots = free_slots;
|
2010-09-06 02:05:23 +00:00
|
|
|
paging_schedule_if_needed(&bts->paging);
|
2009-02-10 00:06:19 +00:00
|
|
|
}
|
2011-04-26 13:52:34 +00:00
|
|
|
|
|
|
|
unsigned int paging_pending_requests_nr(struct gsm_bts *bts)
|
|
|
|
{
|
|
|
|
unsigned int requests = 0;
|
|
|
|
struct gsm_paging_request *req;
|
|
|
|
|
|
|
|
paging_init_if_needed(bts);
|
|
|
|
|
|
|
|
llist_for_each_entry(req, &bts->paging.pending_requests, entry)
|
|
|
|
++requests;
|
|
|
|
|
|
|
|
return requests;
|
|
|
|
}
|
2011-06-07 17:53:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Find any paging data for the given subscriber at the given BTS.
|
|
|
|
*/
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
void *paging_get_data(struct gsm_bts *bts, struct bsc_subscr *bsub)
|
2011-06-07 17:53:29 +00:00
|
|
|
{
|
|
|
|
struct gsm_paging_request *req;
|
|
|
|
|
|
|
|
llist_for_each_entry(req, &bts->paging.pending_requests, entry)
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
if (req->bsub == bsub)
|
2011-06-07 17:53:29 +00:00
|
|
|
return req->cbfn_param;
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|