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> |
Holger Hans Peter Freyther | f537298 | 2013-10-27 09:02:31 +0100 | [diff] [blame] | 27 | #include <osmocom/core/rate_ctr.h> |
Holger Hans Peter Freyther | 67ed34e | 2013-10-17 17:01:54 +0200 | [diff] [blame] | 28 | #include <osmocom/core/timer.h> |
| 29 | } |
Holger Hans Peter Freyther | b78adcd | 2013-10-17 20:12:37 +0200 | [diff] [blame] | 30 | |
| 31 | #include "poll_controller.h" |
Holger Hans Peter Freyther | cedf890 | 2013-10-19 20:47:12 +0200 | [diff] [blame] | 32 | #include "sba.h" |
Holger Hans Peter Freyther | 111614a | 2013-10-19 20:04:57 +0200 | [diff] [blame] | 33 | #include "ta.h" |
Holger Hans Peter Freyther | 34bd8bd | 2013-10-19 21:10:38 +0200 | [diff] [blame] | 34 | #include "tbf.h" |
Holger Hans Peter Freyther | 67ed34e | 2013-10-17 17:01:54 +0200 | [diff] [blame] | 35 | #endif |
| 36 | |
| 37 | #include <stdint.h> |
| 38 | |
Holger Hans Peter Freyther | b6acfda | 2013-10-17 19:41:11 +0200 | [diff] [blame] | 39 | struct BTS; |
Holger Hans Peter Freyther | 67ed34e | 2013-10-17 17:01:54 +0200 | [diff] [blame] | 40 | |
| 41 | /* |
| 42 | * PDCH instance |
| 43 | */ |
| 44 | struct gprs_rlcmac_pdch { |
Holger Hans Peter Freyther | 17b0d83 | 2013-10-19 17:37:48 +0200 | [diff] [blame] | 45 | #ifdef __cplusplus |
Holger Hans Peter Freyther | 24e98d0 | 2013-10-19 18:15:44 +0200 | [diff] [blame] | 46 | struct gprs_rlcmac_paging *dequeue_paging(); |
| 47 | struct msgb *packet_paging_request(); |
| 48 | |
Holger Hans Peter Freyther | f098489 | 2013-10-19 18:28:59 +0200 | [diff] [blame] | 49 | void add_paging(struct gprs_rlcmac_paging *pag); |
Holger Hans Peter Freyther | 24e98d0 | 2013-10-19 18:15:44 +0200 | [diff] [blame] | 50 | |
Holger Hans Peter Freyther | 09ef27a | 2013-10-20 16:37:05 +0200 | [diff] [blame] | 51 | void free_resources(); |
Holger Hans Peter Freyther | 17b0d83 | 2013-10-19 17:37:48 +0200 | [diff] [blame] | 52 | |
| 53 | bool is_enabled() const; |
| 54 | |
| 55 | void enable(); |
| 56 | void disable(); |
Holger Hans Peter Freyther | 9ae367f | 2013-10-26 16:42:38 +0200 | [diff] [blame] | 57 | |
| 58 | /* dispatching of messages */ |
| 59 | int rcv_block(uint8_t *data, uint8_t len, uint32_t fn, int8_t rssi); |
Holger Hans Peter Freyther | 65be480 | 2013-10-26 18:39:36 +0200 | [diff] [blame] | 60 | |
| 61 | gprs_rlcmac_bts *bts_data() const; |
| 62 | BTS *bts() const; |
Holger Hans Peter Freyther | 05f8efc | 2013-10-26 18:53:16 +0200 | [diff] [blame] | 63 | uint8_t trx_no() const; |
Holger Hans Peter Freyther | 17b0d83 | 2013-10-19 17:37:48 +0200 | [diff] [blame] | 64 | #endif |
| 65 | |
| 66 | uint8_t m_is_enabled; /* TS is enabled */ |
Holger Hans Peter Freyther | 67ed34e | 2013-10-17 17:01:54 +0200 | [diff] [blame] | 67 | uint8_t tsc; /* TSC of this slot */ |
| 68 | uint8_t next_ul_tfi; /* next uplink TBF/TFI to schedule (0..31) */ |
| 69 | uint8_t next_dl_tfi; /* next downlink TBF/TFI to schedule (0..31) */ |
Holger Hans Peter Freyther | 705653b | 2013-11-26 16:39:28 +0100 | [diff] [blame] | 70 | uint8_t next_ctrl_prio; /* next kind of ctrl message to schedule */ |
Holger Hans Peter Freyther | 67ed34e | 2013-10-17 17:01:54 +0200 | [diff] [blame] | 71 | struct gprs_rlcmac_tbf *ul_tbf[32]; /* array of UL TBF, by UL TFI */ |
| 72 | struct gprs_rlcmac_tbf *dl_tbf[32]; /* array of DL TBF, by DL TFI */ |
| 73 | struct llist_head paging_list; /* list of paging messages */ |
| 74 | uint32_t last_rts_fn; /* store last frame number of RTS */ |
Holger Hans Peter Freyther | 4ed1dae | 2013-10-20 10:14:03 +0200 | [diff] [blame] | 75 | |
| 76 | /* back pointers */ |
| 77 | struct gprs_rlcmac_trx *trx; |
| 78 | uint8_t ts_no; |
Holger Hans Peter Freyther | d11290b | 2013-10-26 17:32:04 +0200 | [diff] [blame] | 79 | |
| 80 | #ifdef __cplusplus |
| 81 | private: |
Holger Hans Peter Freyther | 05f8efc | 2013-10-26 18:53:16 +0200 | [diff] [blame] | 82 | int rcv_data_block_acknowledged(uint8_t *data, uint8_t len, int8_t rssi); |
| 83 | int rcv_control_block(bitvec *rlc_block, uint32_t fn); |
Holger Hans Peter Freyther | d11290b | 2013-10-26 17:32:04 +0200 | [diff] [blame] | 84 | |
Holger Hans Peter Freyther | e1a075a | 2013-10-27 13:35:30 +0100 | [diff] [blame] | 85 | void rcv_control_ack(Packet_Control_Acknowledgement_t *, uint32_t fn); |
Holger Hans Peter Freyther | 5da2014 | 2013-10-27 11:41:01 +0100 | [diff] [blame] | 86 | void rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *, uint32_t fn); |
Holger Hans Peter Freyther | 7a34471 | 2013-10-27 11:37:53 +0100 | [diff] [blame] | 87 | void rcv_resource_request(Packet_Resource_Request_t *t, uint32_t fn); |
Holger Hans Peter Freyther | cb5c49b | 2013-10-27 11:19:13 +0100 | [diff] [blame] | 88 | void rcv_measurement_report(Packet_Measurement_Report_t *t, uint32_t fn); |
Holger Hans Peter Freyther | d11290b | 2013-10-26 17:32:04 +0200 | [diff] [blame] | 89 | #endif |
Holger Hans Peter Freyther | 67ed34e | 2013-10-17 17:01:54 +0200 | [diff] [blame] | 90 | }; |
| 91 | |
| 92 | struct gprs_rlcmac_trx { |
| 93 | void *fl1h; |
| 94 | uint16_t arfcn; |
| 95 | struct gprs_rlcmac_pdch pdch[8]; |
| 96 | struct gprs_rlcmac_tbf *ul_tbf[32]; /* array of UL TBF, by UL TFI */ |
| 97 | struct gprs_rlcmac_tbf *dl_tbf[32]; /* array of DL TBF, by DL TFI */ |
Holger Hans Peter Freyther | 4ed1dae | 2013-10-20 10:14:03 +0200 | [diff] [blame] | 98 | |
| 99 | /* back pointers */ |
| 100 | struct BTS *bts; |
| 101 | uint8_t trx_no; |
Holger Hans Peter Freyther | 67ed34e | 2013-10-17 17:01:54 +0200 | [diff] [blame] | 102 | }; |
| 103 | |
Holger Hans Peter Freyther | b6acfda | 2013-10-17 19:41:11 +0200 | [diff] [blame] | 104 | /** |
| 105 | * This is the data from C. As soon as our minimal compiler is gcc 4.7 |
| 106 | * we can start to compile pcu_vty.c with c++ and remove the split. |
| 107 | */ |
Holger Hans Peter Freyther | 67ed34e | 2013-10-17 17:01:54 +0200 | [diff] [blame] | 108 | struct gprs_rlcmac_bts { |
| 109 | uint8_t bsic; |
| 110 | uint8_t fc_interval; |
| 111 | uint8_t cs1; |
| 112 | uint8_t cs2; |
| 113 | uint8_t cs3; |
| 114 | uint8_t cs4; |
| 115 | uint8_t initial_cs_dl, initial_cs_ul; |
| 116 | uint8_t force_cs; /* 0=use from BTS 1=use from VTY */ |
| 117 | uint16_t force_llc_lifetime; /* overrides lifetime from SGSN */ |
| 118 | uint8_t t3142; |
| 119 | uint8_t t3169; |
| 120 | uint8_t t3191; |
| 121 | uint16_t t3193_msec; |
| 122 | uint8_t t3195; |
| 123 | uint8_t n3101; |
| 124 | uint8_t n3103; |
| 125 | uint8_t n3105; |
| 126 | struct gprs_rlcmac_trx trx[8]; |
| 127 | int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, |
| 128 | struct gprs_rlcmac_tbf *old_tbf, |
| 129 | struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single); |
| 130 | uint32_t alloc_algorithm_curst; /* options to customize algorithm */ |
| 131 | uint8_t force_two_phase; |
| 132 | uint8_t alpha, gamma; |
Holger Hans Peter Freyther | b6acfda | 2013-10-17 19:41:11 +0200 | [diff] [blame] | 133 | |
Holger Hans Peter Freyther | 34bd8bd | 2013-10-19 21:10:38 +0200 | [diff] [blame] | 134 | /* TBF handling, make private or move into TBFController */ |
| 135 | /* list of uplink TBFs */ |
| 136 | struct llist_head ul_tbfs; |
| 137 | /* list of downlink TBFs */ |
| 138 | struct llist_head dl_tbfs; |
| 139 | |
| 140 | |
Holger Hans Peter Freyther | b6acfda | 2013-10-17 19:41:11 +0200 | [diff] [blame] | 141 | /** |
| 142 | * Point back to the C++ object. This is used during the transition |
| 143 | * period. |
| 144 | */ |
| 145 | struct BTS *bts; |
Holger Hans Peter Freyther | 67ed34e | 2013-10-17 17:01:54 +0200 | [diff] [blame] | 146 | }; |
Holger Hans Peter Freyther | b6acfda | 2013-10-17 19:41:11 +0200 | [diff] [blame] | 147 | |
| 148 | #ifdef __cplusplus |
| 149 | /** |
| 150 | * I represent a GSM BTS. I have one or more TRX, I know the current |
| 151 | * GSM time and I have controllers that help with allocating resources |
| 152 | * on my TRXs. |
| 153 | */ |
| 154 | struct BTS { |
| 155 | public: |
Holger Hans Peter Freyther | f537298 | 2013-10-27 09:02:31 +0100 | [diff] [blame] | 156 | enum { |
| 157 | CTR_TBF_DL_ALLOCATED, |
| 158 | CTR_TBF_DL_FREED, |
| 159 | CTR_TBF_UL_ALLOCATED, |
| 160 | CTR_TBF_UL_FREED, |
Holger Hans Peter Freyther | aa35ba7 | 2013-11-13 15:02:50 +0100 | [diff] [blame] | 161 | CTR_TBF_REUSED, |
Holger Hans Peter Freyther | e9429b5 | 2013-11-13 19:36:57 +0100 | [diff] [blame] | 162 | CTR_RLC_SENT, |
| 163 | CTR_RLC_RESENT, |
Holger Hans Peter Freyther | ef93bdb | 2013-11-24 00:01:50 +0100 | [diff] [blame] | 164 | CTR_RLC_RESTARTED, |
Holger Hans Peter Freyther | c70aae4 | 2013-11-19 17:09:37 +0100 | [diff] [blame] | 165 | CTR_RLC_STALLED, |
Holger Hans Peter Freyther | 092478f | 2013-11-23 01:01:19 +0100 | [diff] [blame] | 166 | CTR_RLC_NACKED, |
Holger Hans Peter Freyther | f537298 | 2013-10-27 09:02:31 +0100 | [diff] [blame] | 167 | CTR_DECODE_ERRORS, |
Holger Hans Peter Freyther | 93e048f | 2013-10-27 10:00:47 +0100 | [diff] [blame] | 168 | CTR_SBA_ALLOCATED, |
| 169 | CTR_SBA_FREED, |
| 170 | CTR_SBA_TIMEDOUT, |
Holger Hans Peter Freyther | 1997787 | 2013-10-27 10:34:31 +0100 | [diff] [blame] | 171 | CTR_LLC_FRAME_TIMEDOUT, |
| 172 | CTR_LLC_FRAME_DROPPED, |
Holger Hans Peter Freyther | b3d5ee2 | 2013-11-13 16:43:26 +0100 | [diff] [blame] | 173 | CTR_LLC_FRAME_SCHED, |
Holger Hans Peter Freyther | c1ae226 | 2013-10-27 10:50:35 +0100 | [diff] [blame] | 174 | CTR_RACH_REQUESTS, |
Holger Hans Peter Freyther | f537298 | 2013-10-27 09:02:31 +0100 | [diff] [blame] | 175 | }; |
| 176 | |
Holger Hans Peter Freyther | b6acfda | 2013-10-17 19:41:11 +0200 | [diff] [blame] | 177 | BTS(); |
Holger Hans Peter Freyther | f537298 | 2013-10-27 09:02:31 +0100 | [diff] [blame] | 178 | ~BTS(); |
Holger Hans Peter Freyther | b6acfda | 2013-10-17 19:41:11 +0200 | [diff] [blame] | 179 | |
| 180 | static BTS* main_bts(); |
| 181 | |
| 182 | struct gprs_rlcmac_bts *bts_data(); |
Holger Hans Peter Freyther | cedf890 | 2013-10-19 20:47:12 +0200 | [diff] [blame] | 183 | SBAController *sba(); |
Holger Hans Peter Freyther | 111614a | 2013-10-19 20:04:57 +0200 | [diff] [blame] | 184 | TimingAdvance *timing_advance(); |
Holger Hans Peter Freyther | b6acfda | 2013-10-17 19:41:11 +0200 | [diff] [blame] | 185 | |
Holger Hans Peter Freyther | 9b30c7f | 2013-10-17 19:59:56 +0200 | [diff] [blame] | 186 | /** TODO: change the number to unsigned */ |
| 187 | void set_current_frame_number(int frame_number); |
| 188 | int current_frame_number() const; |
| 189 | |
Holger Hans Peter Freyther | f098489 | 2013-10-19 18:28:59 +0200 | [diff] [blame] | 190 | /** add paging to paging queue(s) */ |
| 191 | int add_paging(uint8_t chan_needed, uint8_t *identity_lv); |
| 192 | |
Holger Hans Peter Freyther | 34bd8bd | 2013-10-19 21:10:38 +0200 | [diff] [blame] | 193 | gprs_rlcmac_tbf *tbf_by_tlli(uint32_t tlli, enum gprs_rlcmac_tbf_direction dir); |
| 194 | gprs_rlcmac_tbf *tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts); |
Holger Hans Peter Freyther | f63cabd | 2013-10-26 19:10:43 +0200 | [diff] [blame] | 195 | gprs_rlcmac_tbf *tbf_by_tfi(uint8_t tfi, uint8_t trx, enum gprs_rlcmac_tbf_direction dir); |
Holger Hans Peter Freyther | 34bd8bd | 2013-10-19 21:10:38 +0200 | [diff] [blame] | 196 | |
Holger Hans Peter Freyther | 70ddde6 | 2013-10-26 19:17:58 +0200 | [diff] [blame] | 197 | int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx); |
| 198 | |
Holger Hans Peter Freyther | 40cfaa6 | 2013-10-26 19:49:16 +0200 | [diff] [blame] | 199 | int rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn); |
Holger Hans Peter Freyther | 02beed5 | 2013-10-26 20:56:20 +0200 | [diff] [blame] | 200 | int rcv_rach(uint8_t ra, uint32_t Fn, int16_t qta); |
Holger Hans Peter Freyther | 40cfaa6 | 2013-10-26 19:49:16 +0200 | [diff] [blame] | 201 | |
Holger Hans Peter Freyther | 24c1a5b | 2013-10-26 20:27:44 +0200 | [diff] [blame] | 202 | void trigger_dl_ass(gprs_rlcmac_tbf *tbf, gprs_rlcmac_tbf *old_tbf, const char *imsi); |
Holger Hans Peter Freyther | d9262b3 | 2013-10-26 20:12:59 +0200 | [diff] [blame] | 203 | void snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi); |
| 204 | |
Holger Hans Peter Freyther | f537298 | 2013-10-27 09:02:31 +0100 | [diff] [blame] | 205 | /* |
| 206 | * Statistics |
| 207 | */ |
| 208 | void tbf_dl_created(); |
| 209 | void tbf_dl_freed(); |
| 210 | void tbf_ul_created(); |
| 211 | void tbf_ul_freed(); |
Holger Hans Peter Freyther | aa35ba7 | 2013-11-13 15:02:50 +0100 | [diff] [blame] | 212 | void tbf_reused(); |
Holger Hans Peter Freyther | e9429b5 | 2013-11-13 19:36:57 +0100 | [diff] [blame] | 213 | void rlc_sent(); |
| 214 | void rlc_resent(); |
Holger Hans Peter Freyther | ef93bdb | 2013-11-24 00:01:50 +0100 | [diff] [blame] | 215 | void rlc_restarted(); |
Holger Hans Peter Freyther | c70aae4 | 2013-11-19 17:09:37 +0100 | [diff] [blame] | 216 | void rlc_stalled(); |
Holger Hans Peter Freyther | 092478f | 2013-11-23 01:01:19 +0100 | [diff] [blame] | 217 | void rlc_nacked(); |
Holger Hans Peter Freyther | f537298 | 2013-10-27 09:02:31 +0100 | [diff] [blame] | 218 | void decode_error(); |
Holger Hans Peter Freyther | 93e048f | 2013-10-27 10:00:47 +0100 | [diff] [blame] | 219 | void sba_allocated(); |
| 220 | void sba_freed(); |
| 221 | void sba_timedout(); |
Holger Hans Peter Freyther | b3d5ee2 | 2013-11-13 16:43:26 +0100 | [diff] [blame] | 222 | void llc_timedout_frame(); |
| 223 | void llc_dropped_frame(); |
| 224 | void llc_frame_sched(); |
Holger Hans Peter Freyther | c1ae226 | 2013-10-27 10:50:35 +0100 | [diff] [blame] | 225 | void rach_frame(); |
Holger Hans Peter Freyther | f537298 | 2013-10-27 09:02:31 +0100 | [diff] [blame] | 226 | |
| 227 | /* |
| 228 | * Below for C interface for the VTY |
| 229 | */ |
| 230 | struct rate_ctr_group *rate_counters() const; |
| 231 | |
Holger Hans Peter Freyther | b6acfda | 2013-10-17 19:41:11 +0200 | [diff] [blame] | 232 | private: |
Holger Hans Peter Freyther | 9b30c7f | 2013-10-17 19:59:56 +0200 | [diff] [blame] | 233 | int m_cur_fn; |
Holger Hans Peter Freyther | b6acfda | 2013-10-17 19:41:11 +0200 | [diff] [blame] | 234 | struct gprs_rlcmac_bts m_bts; |
Holger Hans Peter Freyther | b78adcd | 2013-10-17 20:12:37 +0200 | [diff] [blame] | 235 | PollController m_pollController; |
Holger Hans Peter Freyther | cedf890 | 2013-10-19 20:47:12 +0200 | [diff] [blame] | 236 | SBAController m_sba; |
Holger Hans Peter Freyther | 111614a | 2013-10-19 20:04:57 +0200 | [diff] [blame] | 237 | TimingAdvance m_ta; |
Holger Hans Peter Freyther | f537298 | 2013-10-27 09:02:31 +0100 | [diff] [blame] | 238 | struct rate_ctr_group *m_ratectrs; |
Holger Hans Peter Freyther | b78adcd | 2013-10-17 20:12:37 +0200 | [diff] [blame] | 239 | |
| 240 | private: |
| 241 | /* disable copying to avoid slicing */ |
| 242 | BTS(const BTS&); |
| 243 | BTS& operator=(const BTS&); |
Holger Hans Peter Freyther | b6acfda | 2013-10-17 19:41:11 +0200 | [diff] [blame] | 244 | }; |
Holger Hans Peter Freyther | 9b30c7f | 2013-10-17 19:59:56 +0200 | [diff] [blame] | 245 | |
| 246 | inline int BTS::current_frame_number() const |
| 247 | { |
| 248 | return m_cur_fn; |
| 249 | } |
Holger Hans Peter Freyther | 111614a | 2013-10-19 20:04:57 +0200 | [diff] [blame] | 250 | |
| 251 | inline TimingAdvance *BTS::timing_advance() |
| 252 | { |
| 253 | return &m_ta; |
| 254 | } |
Holger Hans Peter Freyther | cedf890 | 2013-10-19 20:47:12 +0200 | [diff] [blame] | 255 | |
| 256 | inline SBAController *BTS::sba() |
| 257 | { |
| 258 | return &m_sba; |
| 259 | } |
Holger Hans Peter Freyther | 65be480 | 2013-10-26 18:39:36 +0200 | [diff] [blame] | 260 | |
| 261 | inline BTS *gprs_rlcmac_pdch::bts() const |
| 262 | { |
| 263 | return trx->bts; |
| 264 | } |
| 265 | |
Holger Hans Peter Freyther | f537298 | 2013-10-27 09:02:31 +0100 | [diff] [blame] | 266 | inline struct rate_ctr_group *BTS::rate_counters() const |
| 267 | { |
| 268 | return m_ratectrs; |
| 269 | } |
| 270 | |
Holger Hans Peter Freyther | 93e048f | 2013-10-27 10:00:47 +0100 | [diff] [blame] | 271 | #define CREATE_COUNT_INLINE(func_name, ctr_name) \ |
| 272 | inline void BTS::func_name() {\ |
| 273 | rate_ctr_inc(&m_ratectrs->ctr[ctr_name]); \ |
| 274 | } |
Holger Hans Peter Freyther | 1587764 | 2013-10-27 09:50:15 +0100 | [diff] [blame] | 275 | |
Holger Hans Peter Freyther | 93e048f | 2013-10-27 10:00:47 +0100 | [diff] [blame] | 276 | CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED) |
| 277 | CREATE_COUNT_INLINE(tbf_dl_freed, CTR_TBF_DL_FREED) |
| 278 | CREATE_COUNT_INLINE(tbf_ul_created, CTR_TBF_UL_ALLOCATED) |
| 279 | CREATE_COUNT_INLINE(tbf_ul_freed, CTR_TBF_UL_FREED) |
Holger Hans Peter Freyther | aa35ba7 | 2013-11-13 15:02:50 +0100 | [diff] [blame] | 280 | CREATE_COUNT_INLINE(tbf_reused, CTR_TBF_REUSED) |
Holger Hans Peter Freyther | e9429b5 | 2013-11-13 19:36:57 +0100 | [diff] [blame] | 281 | CREATE_COUNT_INLINE(rlc_sent, CTR_RLC_SENT) |
| 282 | CREATE_COUNT_INLINE(rlc_resent, CTR_RLC_RESENT) |
Holger Hans Peter Freyther | ef93bdb | 2013-11-24 00:01:50 +0100 | [diff] [blame] | 283 | CREATE_COUNT_INLINE(rlc_restarted, CTR_RLC_RESTARTED) |
Holger Hans Peter Freyther | c70aae4 | 2013-11-19 17:09:37 +0100 | [diff] [blame] | 284 | CREATE_COUNT_INLINE(rlc_stalled, CTR_RLC_STALLED) |
Holger Hans Peter Freyther | 092478f | 2013-11-23 01:01:19 +0100 | [diff] [blame] | 285 | CREATE_COUNT_INLINE(rlc_nacked, CTR_RLC_NACKED) |
Holger Hans Peter Freyther | 93e048f | 2013-10-27 10:00:47 +0100 | [diff] [blame] | 286 | CREATE_COUNT_INLINE(decode_error, CTR_DECODE_ERRORS) |
| 287 | CREATE_COUNT_INLINE(sba_allocated, CTR_SBA_ALLOCATED) |
| 288 | CREATE_COUNT_INLINE(sba_freed, CTR_SBA_FREED) |
| 289 | CREATE_COUNT_INLINE(sba_timedout, CTR_SBA_TIMEDOUT) |
Holger Hans Peter Freyther | b3d5ee2 | 2013-11-13 16:43:26 +0100 | [diff] [blame] | 290 | CREATE_COUNT_INLINE(llc_timedout_frame, CTR_LLC_FRAME_TIMEDOUT); |
| 291 | CREATE_COUNT_INLINE(llc_dropped_frame, CTR_LLC_FRAME_DROPPED); |
| 292 | CREATE_COUNT_INLINE(llc_frame_sched, CTR_LLC_FRAME_SCHED); |
Holger Hans Peter Freyther | c1ae226 | 2013-10-27 10:50:35 +0100 | [diff] [blame] | 293 | CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); |
Holger Hans Peter Freyther | 1587764 | 2013-10-27 09:50:15 +0100 | [diff] [blame] | 294 | |
Holger Hans Peter Freyther | 93e048f | 2013-10-27 10:00:47 +0100 | [diff] [blame] | 295 | #undef CREATE_COUNT_INLINE |
Holger Hans Peter Freyther | 1587764 | 2013-10-27 09:50:15 +0100 | [diff] [blame] | 296 | |
Holger Hans Peter Freyther | 1587764 | 2013-10-27 09:50:15 +0100 | [diff] [blame] | 297 | |
Holger Hans Peter Freyther | 65be480 | 2013-10-26 18:39:36 +0200 | [diff] [blame] | 298 | inline gprs_rlcmac_bts *gprs_rlcmac_pdch::bts_data() const |
| 299 | { |
| 300 | return trx->bts->bts_data(); |
| 301 | } |
Holger Hans Peter Freyther | 05f8efc | 2013-10-26 18:53:16 +0200 | [diff] [blame] | 302 | |
| 303 | inline uint8_t gprs_rlcmac_pdch::trx_no() const |
| 304 | { |
| 305 | return trx->trx_no; |
| 306 | } |
Holger Hans Peter Freyther | b6acfda | 2013-10-17 19:41:11 +0200 | [diff] [blame] | 307 | #endif |
| 308 | |
| 309 | #ifdef __cplusplus |
| 310 | extern "C" { |
| 311 | #endif |
| 312 | struct gprs_rlcmac_bts *bts_main_data(); |
Holger Hans Peter Freyther | f537298 | 2013-10-27 09:02:31 +0100 | [diff] [blame] | 313 | struct rate_ctr_group *bts_main_data_stats(); |
Holger Hans Peter Freyther | b6acfda | 2013-10-17 19:41:11 +0200 | [diff] [blame] | 314 | #ifdef __cplusplus |
| 315 | } |
Holger Hans Peter Freyther | 17b0d83 | 2013-10-19 17:37:48 +0200 | [diff] [blame] | 316 | |
| 317 | inline bool gprs_rlcmac_pdch::is_enabled() const |
| 318 | { |
| 319 | return m_is_enabled; |
| 320 | } |
Holger Hans Peter Freyther | b6acfda | 2013-10-17 19:41:11 +0200 | [diff] [blame] | 321 | #endif |