diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-02-18 22:20:46 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-03-08 01:01:43 +0100 |
commit | 6d804b1a7e375213cb4b3e437c2b9b8c68872164 (patch) | |
tree | 226c66c67e1d2181e545cb21f83234b90b051a99 /openbsc/src/osmo-bsc/osmo_bsc_grace.c | |
parent | abf53d87b6648f2d42562c5699e9035afd92e608 (diff) |
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
Diffstat (limited to 'openbsc/src/osmo-bsc/osmo_bsc_grace.c')
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_grace.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_grace.c b/openbsc/src/osmo-bsc/osmo_bsc_grace.c index 5709eeac5..63afa20d0 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_grace.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_grace.c @@ -22,7 +22,7 @@ #include <openbsc/osmo_bsc_rf.h> #include <openbsc/bsc_msc_data.h> #include <openbsc/gsm_04_80.h> -#include <openbsc/gsm_subscriber.h> +#include <openbsc/bsc_subscriber.h> #include <openbsc/paging.h> #include <openbsc/signal.h> @@ -34,8 +34,8 @@ int bsc_grace_allow_new_connection(struct gsm_network *network, struct gsm_bts * } -static int normal_paging(struct gsm_subscriber *subscr, int chan_needed, - struct bsc_msc_data *msc) +static int normal_paging(struct bsc_subscr *subscr, int chan_needed, + struct bsc_msc_data *msc) { /* we can't page by lac.. we need to page everything */ if (msc->core_lac != -1) { @@ -47,12 +47,11 @@ static int normal_paging(struct gsm_subscriber *subscr, int chan_needed, return 0; } - return paging_request(subscr->group->net, subscr, chan_needed, NULL, - msc); + return paging_request(msc->network, subscr, chan_needed, NULL, msc); } -static int locked_paging(struct gsm_subscriber *subscr, int chan_needed, - struct bsc_msc_data *msc) +static int locked_paging(struct bsc_subscr *subscr, int chan_needed, + struct bsc_msc_data *msc) { struct gsm_bts *bts = NULL; @@ -84,10 +83,12 @@ static int locked_paging(struct gsm_subscriber *subscr, int chan_needed, /** * Try to not page if everything the cell is not on. */ -int bsc_grace_paging_request(struct gsm_subscriber *subscr, int chan_needed, - struct bsc_msc_data *msc) +int bsc_grace_paging_request(enum signal_rf rf_policy, + struct bsc_subscr *subscr, + int chan_needed, + struct bsc_msc_data *msc) { - if (subscr->group->net->bsc_data->rf_ctrl->policy == S_RF_ON) + if (rf_policy == S_RF_ON) return normal_paging(subscr, chan_needed, msc); return locked_paging(subscr, chan_needed, msc); } |