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 | |
| 24 | #include <malloc.h> |
| 25 | #include <string.h> |
| 26 | |
| 27 | #include "linuxlist.h" |
| 28 | #include "gsm_data.h" |
| 29 | #include "gsm_subscriber.h" |
Harald Welte | 38c2f13 | 2009-01-06 23:10:57 +0000 | [diff] [blame] | 30 | #include "timer.h" |
Harald Welte | b68899d | 2009-01-06 21:47:18 +0000 | [diff] [blame] | 31 | |
| 32 | /** |
| 33 | * A pending paging request |
| 34 | */ |
| 35 | struct paging_request { |
| 36 | struct llist_head entry; |
| 37 | struct gsm_subscriber *subscr; |
| 38 | struct gsm_bts *bts; |
Harald Welte | 4fc898a | 2009-02-01 17:57:04 +0000 | [diff] [blame] | 39 | int requests; |
Harald Welte | 38c2f13 | 2009-01-06 23:10:57 +0000 | [diff] [blame] | 40 | |
| 41 | int chan_type; |
Harald Welte | b68899d | 2009-01-06 21:47:18 +0000 | [diff] [blame] | 42 | }; |
| 43 | |
| 44 | /* |
| 45 | * struct for each bts we serve... |
| 46 | */ |
| 47 | struct paging_bts { |
| 48 | /* public callbacks */ |
| 49 | void (*channel_allocated)(struct gsm_lchan *lchan); |
| 50 | |
| 51 | /* list for each bts */ |
| 52 | struct llist_head bts_list; |
| 53 | |
| 54 | /* pending requests */ |
| 55 | struct llist_head pending_requests; |
Harald Welte | 38c2f13 | 2009-01-06 23:10:57 +0000 | [diff] [blame] | 56 | struct paging_request *last_request; |
Harald Welte | b68899d | 2009-01-06 21:47:18 +0000 | [diff] [blame] | 57 | struct gsm_bts *bts; |
Harald Welte | 38c2f13 | 2009-01-06 23:10:57 +0000 | [diff] [blame] | 58 | |
| 59 | /* tick timer */ |
| 60 | struct timer_list page_timer; |
Harald Welte | b68899d | 2009-01-06 21:47:18 +0000 | [diff] [blame] | 61 | }; |
| 62 | |
| 63 | /* call once for every gsm_bts... */ |
| 64 | struct paging_bts* page_allocate(struct gsm_bts *bts); |
| 65 | |
| 66 | /* schedule paging request */ |
Harald Welte | 38c2f13 | 2009-01-06 23:10:57 +0000 | [diff] [blame] | 67 | void page_request(struct gsm_bts *bts, struct gsm_subscriber *subscr, int type); |
Harald Welte | b68899d | 2009-01-06 21:47:18 +0000 | [diff] [blame] | 68 | |
| 69 | #endif |