Harald Welte | b68899d | 2009-01-06 21:47:18 +0000 | [diff] [blame] | 1 | /* 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 Welte | 12247c6 | 2009-05-21 07:23:02 +0000 | [diff] [blame] | 24 | #include <stdlib.h> |
Harald Welte | b68899d | 2009-01-06 21:47:18 +0000 | [diff] [blame] | 25 | #include <string.h> |
| 26 | |
Harald Welte | dfe6c7d | 2010-02-20 16:24:02 +0100 | [diff] [blame] | 27 | #include <osmocore/linuxlist.h> |
Harald Welte | b68899d | 2009-01-06 21:47:18 +0000 | [diff] [blame] | 28 | #include "gsm_data.h" |
| 29 | #include "gsm_subscriber.h" |
Harald Welte | dfe6c7d | 2010-02-20 16:24:02 +0100 | [diff] [blame] | 30 | #include <osmocore/timer.h> |
Harald Welte | b68899d | 2009-01-06 21:47:18 +0000 | [diff] [blame] | 31 | |
Holger Hans Peter Freyther | 85334f1 | 2010-11-09 17:00:42 +0100 | [diff] [blame] | 32 | /** |
| 33 | * A pending paging request |
| 34 | */ |
| 35 | struct 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 Freyther | d3baf41 | 2010-12-23 18:19:17 +0100 | [diff] [blame^] | 49 | /* How often did we ask the BTS to page? */ |
| 50 | int attempts; |
| 51 | |
Holger Hans Peter Freyther | 85334f1 | 2010-11-09 17:00:42 +0100 | [diff] [blame] | 52 | /* callback to be called in case paging completes */ |
| 53 | gsm_cbfn *cbfn; |
| 54 | void *cbfn_param; |
| 55 | }; |
| 56 | |
Harald Welte | b68899d | 2009-01-06 21:47:18 +0000 | [diff] [blame] | 57 | /* call once for every gsm_bts... */ |
Holger Freyther | 1fd3414 | 2009-02-09 23:42:03 +0000 | [diff] [blame] | 58 | void paging_init(struct gsm_bts *bts); |
Harald Welte | b68899d | 2009-01-06 21:47:18 +0000 | [diff] [blame] | 59 | |
| 60 | /* schedule paging request */ |
Harald Welte | e903edf | 2009-08-15 03:16:17 +0200 | [diff] [blame] | 61 | int paging_request(struct gsm_network *network, struct gsm_subscriber *subscr, |
| 62 | int type, gsm_cbfn *cbfn, void *data); |
Harald Welte | b68899d | 2009-01-06 21:47:18 +0000 | [diff] [blame] | 63 | |
Harald Welte | 763da00 | 2009-02-06 12:52:14 +0000 | [diff] [blame] | 64 | /* stop paging requests */ |
Harald Welte | 75a1fa8 | 2009-02-17 01:39:41 +0000 | [diff] [blame] | 65 | void paging_request_stop(struct gsm_bts *bts, struct gsm_subscriber *subscr, |
Sylvain Munaut | c7ff257 | 2010-12-01 21:41:35 +0100 | [diff] [blame] | 66 | struct gsm_subscriber_connection *conn, |
| 67 | struct msgb *msg); |
Harald Welte | 763da00 | 2009-02-06 12:52:14 +0000 | [diff] [blame] | 68 | |
Holger Freyther | 392209c | 2009-02-10 00:06:19 +0000 | [diff] [blame] | 69 | /* update paging load */ |
| 70 | void paging_update_buffer_space(struct gsm_bts *bts, u_int16_t); |
| 71 | |
Harald Welte | b68899d | 2009-01-06 21:47:18 +0000 | [diff] [blame] | 72 | #endif |