blob: a78eb8e9d5b8e2056eeda6a068e378f29ed091cb [file] [log] [blame]
Harald Welteb68899d2009-01-06 21:47:18 +00001/* Paging helper and manager.... */
2/* (C) 2009 by Holger Hans Peter Freyther <zecke@selfish.org>
3 * All Rights Reserved
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 */
20
21#ifndef PAGING_H
22#define PAGING_H
23
Harald Welte12247c62009-05-21 07:23:02 +000024#include <stdlib.h>
Harald Welteb68899d2009-01-06 21:47:18 +000025#include <string.h>
26
Harald Weltedfe6c7d2010-02-20 16:24:02 +010027#include <osmocore/linuxlist.h>
Harald Welteb68899d2009-01-06 21:47:18 +000028#include "gsm_data.h"
29#include "gsm_subscriber.h"
Harald Weltedfe6c7d2010-02-20 16:24:02 +010030#include <osmocore/timer.h>
Harald Welteb68899d2009-01-06 21:47:18 +000031
Holger Hans Peter Freyther85334f12010-11-09 17:00:42 +010032/**
33 * A pending paging request
34 */
35struct gsm_paging_request {
36 /* list_head for list of all paging requests */
37 struct llist_head entry;
38 /* the subscriber which we're paging. Later gsm_paging_request
39 * should probably become a part of the gsm_subscriber struct? */
40 struct gsm_subscriber *subscr;
41 /* back-pointer to the BTS on which we are paging */
42 struct gsm_bts *bts;
43 /* what kind of channel type do we ask the MS to establish */
44 int chan_type;
45
46 /* Timer 3113: how long do we try to page? */
47 struct timer_list T3113;
48
Holger Hans Peter Freytherd3baf412010-12-23 18:19:17 +010049 /* How often did we ask the BTS to page? */
50 int attempts;
51
Holger Hans Peter Freyther85334f12010-11-09 17:00:42 +010052 /* callback to be called in case paging completes */
53 gsm_cbfn *cbfn;
54 void *cbfn_param;
55};
56
Harald Welteb68899d2009-01-06 21:47:18 +000057/* call once for every gsm_bts... */
Holger Freyther1fd34142009-02-09 23:42:03 +000058void paging_init(struct gsm_bts *bts);
Harald Welteb68899d2009-01-06 21:47:18 +000059
60/* schedule paging request */
Harald Weltee903edf2009-08-15 03:16:17 +020061int paging_request(struct gsm_network *network, struct gsm_subscriber *subscr,
62 int type, gsm_cbfn *cbfn, void *data);
Harald Welteb68899d2009-01-06 21:47:18 +000063
Harald Welte763da002009-02-06 12:52:14 +000064/* stop paging requests */
Harald Welte75a1fa82009-02-17 01:39:41 +000065void paging_request_stop(struct gsm_bts *bts, struct gsm_subscriber *subscr,
Sylvain Munautc7ff2572010-12-01 21:41:35 +010066 struct gsm_subscriber_connection *conn,
67 struct msgb *msg);
Harald Welte763da002009-02-06 12:52:14 +000068
Holger Freyther392209c2009-02-10 00:06:19 +000069/* update paging load */
70void paging_update_buffer_space(struct gsm_bts *bts, u_int16_t);
71
Harald Welteb68899d2009-01-06 21:47:18 +000072#endif