diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-05-02 15:55:22 +0200 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-03-16 15:32:31 +0100 |
commit | 3f3594209dd5f19c48190054d7ebbfef7364eda1 (patch) | |
tree | e1910622d9831807dab94bb26e1c7b3af0304aed /openbsc | |
parent | 7842c30c4a15d790d6c44ba784c9c48711c8dbcd (diff) |
paging: change subscr_paging_cb() into subscr_rx_paging_response()
Remove one layer of callback indirection in paging. When a paging response
arrives, we always want to first secure the connection, thus a fixed
subscr_rx_paging_response() function is more appropriate and avoids having
to store a cbfn. The actual actions to be taken upon successful paging are
of course still in callback functions stored with each subscriber.
Remove paging_request_stop() call from subscr_paging_dispatch(), which stops
paging on all BTSs, which is not the responsibility of libmsc.
Change-Id: Ic2c785c9cc48b2c2c6557cbe1060d25afa89e38d
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/include/openbsc/gsm_subscriber.h | 2 | ||||
-rw-r--r-- | openbsc/src/libmsc/gsm_subscriber.c | 31 |
2 files changed, 7 insertions, 26 deletions
diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h index 4124e0624..0bc7d5160 100644 --- a/openbsc/include/openbsc/gsm_subscriber.h +++ b/openbsc/include/openbsc/gsm_subscriber.h @@ -56,6 +56,8 @@ struct subscr_request *subscr_request_conn(struct vlr_subscr *vsub, gsm_cbfn *cbfn, void *param); void subscr_remove_request(struct subscr_request *req); +int subscr_rx_paging_response(struct msgb *msg, + struct gsm_subscriber_connection *conn); int subscr_paging_dispatch(unsigned int hooknum, unsigned int event, struct msgb *msg, void *data, void *param); diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c index bd4214cc9..507842299 100644 --- a/openbsc/src/libmsc/gsm_subscriber.c +++ b/openbsc/src/libmsc/gsm_subscriber.c @@ -59,10 +59,6 @@ static struct bsc_subscr *vlr_subscr_to_bsc_sub(struct llist_head *bsc_subscribe return sub; } -#if 0 -TODO implement paging response in libmsc! -Excluding this to be able to link without libbsc: - /* * We got the channel assigned and can now hand this channel * over to one of our callbacks. @@ -80,17 +76,6 @@ int subscr_paging_dispatch(unsigned int hooknum, unsigned int event, OSMO_ASSERT(vsub && vsub->cs.is_paging); net = vsub->vlr->user_ctx; - /* - * Stop paging on all other BTS. E.g. if this is - * the first timeout on a BTS then the others will - * timeout soon as well. Let's just stop everything - * and forget we wanted to page. - */ - - bsub = vlr_subscr_to_bsc_sub(conn->network->bsc_subscribers, vsub); - paging_request_stop(&net->bts_list, NULL, bsub, NULL, NULL); - bsc_subscr_put(bsub); - /* Inform parts of the system we don't know */ sig_data.vsub = vsub; sig_data.bts = conn ? conn->bts : NULL; @@ -143,25 +128,19 @@ static int subscr_paging_sec_cb(unsigned int hooknum, unsigned int event, return rc; } -static int subscr_paging_cb(unsigned int hooknum, unsigned int event, - struct msgb *msg, void *data, void *param) +int subscr_rx_paging_response(struct msgb *msg, + struct gsm_subscriber_connection *conn) { - struct gsm_subscriber_connection *conn = data; struct gsm48_hdr *gh; struct gsm48_pag_resp *pr; - /* Other cases mean problem, dispatch direclty */ - if (event != GSM_PAGING_SUCCEEDED) - return subscr_paging_dispatch(hooknum, event, msg, data, param); - - /* Get paging response */ + /* Get key_seq from Paging Response headers */ gh = msgb_l3(msg); pr = (struct gsm48_pag_resp *)gh->data; - /* We _really_ have a channel, secure it now ! */ - return gsm48_secure_channel(conn, pr->key_seq, subscr_paging_sec_cb, param); + /* Secure the connection */ + return gsm48_secure_channel(conn, pr->key_seq, subscr_paging_sec_cb, NULL); } -#endif struct subscr_request *subscr_request_channel(struct vlr_subscr *vsub, int channel_type, |