Holger Hans Peter Freyther | 67ed34e | 2013-10-17 17:01:54 +0200 | [diff] [blame^] | 1 | /* bts.h |
| 2 | * |
| 3 | * Copyright (C) 2012 Ivan Klyuchnikov |
| 4 | * Copyright (C) 2013 by Holger Hans Peter Freyther |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License |
| 8 | * as published by the Free Software Foundation; either version 2 |
| 9 | * of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 19 | */ |
| 20 | |
| 21 | #pragma once |
| 22 | |
| 23 | |
| 24 | #ifdef __cplusplus |
| 25 | extern "C" { |
| 26 | #include <osmocom/core/linuxlist.h> |
| 27 | #include <osmocom/core/timer.h> |
| 28 | } |
| 29 | #endif |
| 30 | |
| 31 | #include <stdint.h> |
| 32 | |
| 33 | struct gprs_rlcmac_tbf; |
| 34 | |
| 35 | /* |
| 36 | * PDCH instance |
| 37 | */ |
| 38 | struct gprs_rlcmac_pdch { |
| 39 | uint8_t enable; /* TS is enabled */ |
| 40 | uint8_t tsc; /* TSC of this slot */ |
| 41 | uint8_t next_ul_tfi; /* next uplink TBF/TFI to schedule (0..31) */ |
| 42 | uint8_t next_dl_tfi; /* next downlink TBF/TFI to schedule (0..31) */ |
| 43 | struct gprs_rlcmac_tbf *ul_tbf[32]; /* array of UL TBF, by UL TFI */ |
| 44 | struct gprs_rlcmac_tbf *dl_tbf[32]; /* array of DL TBF, by DL TFI */ |
| 45 | struct llist_head paging_list; /* list of paging messages */ |
| 46 | uint32_t last_rts_fn; /* store last frame number of RTS */ |
| 47 | }; |
| 48 | |
| 49 | struct gprs_rlcmac_trx { |
| 50 | void *fl1h; |
| 51 | uint16_t arfcn; |
| 52 | struct gprs_rlcmac_pdch pdch[8]; |
| 53 | struct gprs_rlcmac_tbf *ul_tbf[32]; /* array of UL TBF, by UL TFI */ |
| 54 | struct gprs_rlcmac_tbf *dl_tbf[32]; /* array of DL TBF, by DL TFI */ |
| 55 | }; |
| 56 | |
| 57 | |
| 58 | struct gprs_rlcmac_bts { |
| 59 | uint8_t bsic; |
| 60 | uint8_t fc_interval; |
| 61 | uint8_t cs1; |
| 62 | uint8_t cs2; |
| 63 | uint8_t cs3; |
| 64 | uint8_t cs4; |
| 65 | uint8_t initial_cs_dl, initial_cs_ul; |
| 66 | uint8_t force_cs; /* 0=use from BTS 1=use from VTY */ |
| 67 | uint16_t force_llc_lifetime; /* overrides lifetime from SGSN */ |
| 68 | uint8_t t3142; |
| 69 | uint8_t t3169; |
| 70 | uint8_t t3191; |
| 71 | uint16_t t3193_msec; |
| 72 | uint8_t t3195; |
| 73 | uint8_t n3101; |
| 74 | uint8_t n3103; |
| 75 | uint8_t n3105; |
| 76 | struct gprs_rlcmac_trx trx[8]; |
| 77 | int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, |
| 78 | struct gprs_rlcmac_tbf *old_tbf, |
| 79 | struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single); |
| 80 | uint32_t alloc_algorithm_curst; /* options to customize algorithm */ |
| 81 | uint8_t force_two_phase; |
| 82 | uint8_t alpha, gamma; |
| 83 | }; |