blob: 0872eb866d49f56d399ce599170b37ac542090b8 [file] [log] [blame]
Jonathan Santos03fd8d02011-05-25 13:54:02 -04001/* 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 Affero General Public License as published by
7 * the Free Software Foundation; either version 3 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 Affero General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 */
19
20#ifndef PAGING_H
21#define PAGING_H
22
23#include <stdlib.h>
24#include <string.h>
25
Jonathan Santos5a45b152011-08-17 15:33:57 -040026#include <osmocom/core/linuxlist.h>
Jonathan Santos03fd8d02011-05-25 13:54:02 -040027#include "gsm_data.h"
28#include "gsm_subscriber.h"
Jonathan Santos5a45b152011-08-17 15:33:57 -040029#include <osmocom/core/timer.h>
Jonathan Santos03fd8d02011-05-25 13:54:02 -040030
31/**
32 * A pending paging request
33 */
34struct gsm_paging_request {
35 /* list_head for list of all paging requests */
36 struct llist_head entry;
37 /* the subscriber which we're paging. Later gsm_paging_request
38 * should probably become a part of the gsm_subscriber struct? */
39 struct gsm_subscriber *subscr;
40 /* back-pointer to the BTS on which we are paging */
41 struct gsm_bts *bts;
42 /* what kind of channel type do we ask the MS to establish */
43 int chan_type;
44
45 /* Timer 3113: how long do we try to page? */
Jonathan Santos5a45b152011-08-17 15:33:57 -040046 struct osmo_timer_list T3113;
Jonathan Santos03fd8d02011-05-25 13:54:02 -040047
48 /* How often did we ask the BTS to page? */
49 int attempts;
50
51 /* callback to be called in case paging completes */
52 gsm_cbfn *cbfn;
53 void *cbfn_param;
54};
55
Jonathan Santos03fd8d02011-05-25 13:54:02 -040056/* schedule paging request */
57int paging_request(struct gsm_network *network, struct gsm_subscriber *subscr,
58 int type, gsm_cbfn *cbfn, void *data);
59
60/* stop paging requests */
61void paging_request_stop(struct gsm_bts *bts, struct gsm_subscriber *subscr,
62 struct gsm_subscriber_connection *conn,
63 struct msgb *msg);
64
65/* update paging load */
Jonathan Santos5a45b152011-08-17 15:33:57 -040066void paging_update_buffer_space(struct gsm_bts *bts, uint16_t);
67
68/* pending paging requests */
69unsigned int paging_pending_requests_nr(struct gsm_bts *bts);
Jonathan Santos03fd8d02011-05-25 13:54:02 -040070
71#endif