Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 1 | #ifndef _GSM_DATA_H |
| 2 | #define _GSM_DATA_H |
| 3 | |
| 4 | #include <sys/types.h> |
| 5 | |
Harald Welte | 255539c | 2008-12-28 02:26:27 +0000 | [diff] [blame] | 6 | #include <openbsc/timer.h> |
Holger Freyther | 1adb4ff | 2009-02-04 00:04:52 +0000 | [diff] [blame] | 7 | #include <openbsc/gsm_04_08.h> |
Harald Welte | 255539c | 2008-12-28 02:26:27 +0000 | [diff] [blame] | 8 | |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 9 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
| 10 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 11 | #define GSM_MAX_BTS 8 |
| 12 | #define BTS_MAX_TRX 8 |
Harald Welte | 85770c7 | 2009-01-18 17:47:32 +0000 | [diff] [blame] | 13 | #define TRX_NR_TS 8 |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 14 | #define TS_MAX_LCHAN 8 |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 15 | |
| 16 | #define HARDCODED_ARFCN 123 |
Harald Welte | 02b0e09 | 2009-02-28 13:11:07 +0000 | [diff] [blame] | 17 | #define HARDCODED_TSC 7 |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 18 | |
Harald Welte | 8e1e3ee | 2009-02-01 13:32:45 +0000 | [diff] [blame] | 19 | enum gsm_hooks { |
| 20 | GSM_HOOK_NM_SWLOAD, |
Harald Welte | 0932d1e | 2009-02-16 22:53:52 +0000 | [diff] [blame] | 21 | GSM_HOOK_RR_PAGING, |
| 22 | }; |
| 23 | |
| 24 | enum gsm_paging_event { |
| 25 | GSM_PAGING_SUCCEEDED, |
| 26 | GSM_PAGING_EXPIRED, |
Harald Welte | 8e1e3ee | 2009-02-01 13:32:45 +0000 | [diff] [blame] | 27 | }; |
| 28 | |
| 29 | struct msgb; |
| 30 | typedef int gsm_cbfn(unsigned int hooknum, |
| 31 | unsigned int event, |
| 32 | struct msgb *msg, |
| 33 | void *data, void *param); |
| 34 | |
Holger Freyther | c6ea9db | 2008-12-30 19:18:21 +0000 | [diff] [blame] | 35 | /* |
| 36 | * Use the channel. As side effect the lchannel recycle timer |
| 37 | * will be started. |
| 38 | */ |
| 39 | #define LCHAN_RELEASE_TIMEOUT 4, 0 |
| 40 | #define use_lchan(lchan) \ |
| 41 | do { lchan->use_count++; \ |
| 42 | schedule_timer(&lchan->release_timer, LCHAN_RELEASE_TIMEOUT); } while(0); |
| 43 | |
| 44 | #define put_lchan(lchan) \ |
| 45 | do { lchan->use_count--; } while(0); |
| 46 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 47 | /* communications link with a BTS */ |
| 48 | struct gsm_bts_link { |
| 49 | struct gsm_bts *bts; |
| 50 | }; |
| 51 | |
Harald Welte | a3d0438 | 2008-12-27 17:02:56 +0000 | [diff] [blame] | 52 | enum gsm_call_type { |
| 53 | GSM_CT_NONE, |
| 54 | GSM_CT_MO, |
| 55 | GSM_CT_MT, |
| 56 | }; |
| 57 | |
| 58 | enum gsm_call_state { |
| 59 | GSM_CSTATE_NULL, |
| 60 | GSM_CSTATE_INITIATED, |
| 61 | GSM_CSTATE_ACTIVE, |
| 62 | GSM_CSTATE_RELEASE_REQ, |
| 63 | }; |
| 64 | |
Harald Welte | 49f48b8 | 2009-02-17 15:29:33 +0000 | [diff] [blame] | 65 | struct gsm_lchan; |
| 66 | struct gsm_subscriber; |
| 67 | |
Harald Welte | a3d0438 | 2008-12-27 17:02:56 +0000 | [diff] [blame] | 68 | /* One end of a call */ |
| 69 | struct gsm_call { |
| 70 | enum gsm_call_type type; |
| 71 | enum gsm_call_state state; |
| 72 | u_int8_t transaction_id; /* 10.3.2 */ |
| 73 | |
Harald Welte | 49f48b8 | 2009-02-17 15:29:33 +0000 | [diff] [blame] | 74 | /* the 'local' channel */ |
| 75 | struct gsm_lchan *local_lchan; |
| 76 | /* the 'remote' channel */ |
| 77 | struct gsm_lchan *remote_lchan; |
| 78 | |
Harald Welte | 0932d1e | 2009-02-16 22:53:52 +0000 | [diff] [blame] | 79 | /* the 'remote' subscriber */ |
| 80 | struct gsm_subscriber *called_subscr; |
Harald Welte | a3d0438 | 2008-12-27 17:02:56 +0000 | [diff] [blame] | 81 | }; |
| 82 | |
| 83 | |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 84 | enum gsm_phys_chan_config { |
| 85 | GSM_PCHAN_NONE, |
| 86 | GSM_PCHAN_CCCH, |
| 87 | GSM_PCHAN_CCCH_SDCCH4, |
| 88 | GSM_PCHAN_TCH_F, |
| 89 | GSM_PCHAN_TCH_H, |
| 90 | GSM_PCHAN_SDCCH8_SACCH8C, |
| 91 | GSM_PCHAN_UNKNOWN, |
| 92 | }; |
| 93 | |
| 94 | enum gsm_chan_t { |
| 95 | GSM_LCHAN_NONE, |
| 96 | GSM_LCHAN_SDCCH, |
| 97 | GSM_LCHAN_TCH_F, |
| 98 | GSM_LCHAN_TCH_H, |
| 99 | GSM_LCHAN_UNKNOWN, |
| 100 | }; |
| 101 | |
Harald Welte | e14a57c | 2008-12-29 04:08:28 +0000 | [diff] [blame] | 102 | |
| 103 | /* Channel Request reason */ |
| 104 | enum gsm_chreq_reason_t { |
| 105 | GSM_CHREQ_REASON_EMERG, |
| 106 | GSM_CHREQ_REASON_PAG, |
| 107 | GSM_CHREQ_REASON_CALL, |
| 108 | GSM_CHREQ_REASON_LOCATION_UPD, |
| 109 | GSM_CHREQ_REASON_OTHER, |
| 110 | }; |
| 111 | |
Harald Welte | bbcc7a5 | 2009-02-14 19:45:44 +0000 | [diff] [blame] | 112 | /* Network Management State */ |
| 113 | struct gsm_nm_state { |
| 114 | u_int8_t operational; |
| 115 | u_int8_t administrative; |
Harald Welte | 8c1d0e4 | 2009-02-15 03:38:12 +0000 | [diff] [blame] | 116 | u_int8_t availability; |
Harald Welte | bbcc7a5 | 2009-02-14 19:45:44 +0000 | [diff] [blame] | 117 | }; |
Harald Welte | 8c1d0e4 | 2009-02-15 03:38:12 +0000 | [diff] [blame] | 118 | struct gsm_attr { |
| 119 | u_int8_t len; |
| 120 | u_int8_t data[0]; |
| 121 | }; |
Harald Welte | bbcc7a5 | 2009-02-14 19:45:44 +0000 | [diff] [blame] | 122 | |
Holger Freyther | 73487a2 | 2008-12-31 18:53:57 +0000 | [diff] [blame] | 123 | /* |
| 124 | * LOCATION UPDATING REQUEST state |
| 125 | * |
| 126 | * Our current operation is: |
| 127 | * - Get imei/tmsi |
| 128 | * - Accept/Reject according to global policy |
| 129 | */ |
| 130 | struct gsm_loc_updating_operation { |
| 131 | struct timer_list updating_timer; |
| 132 | int waiting_for_imsi : 1; |
| 133 | int waiting_for_imei : 1; |
| 134 | }; |
| 135 | |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 136 | struct gsm_lchan { |
| 137 | /* The TS that we're part of */ |
| 138 | struct gsm_bts_trx_ts *ts; |
| 139 | /* The logical subslot number in the TS */ |
| 140 | u_int8_t nr; |
| 141 | /* The lotical channel type */ |
| 142 | enum gsm_chan_t type; |
Harald Welte | d4c9bf3 | 2009-02-15 16:56:18 +0000 | [diff] [blame] | 143 | /* Power levels for MS and BTS */ |
| 144 | u_int8_t bs_power; |
| 145 | u_int8_t ms_power; |
| 146 | |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 147 | /* To whom we are allocated at the moment */ |
| 148 | struct gsm_subscriber *subscr; |
Holger Freyther | c6ea9db | 2008-12-30 19:18:21 +0000 | [diff] [blame] | 149 | |
| 150 | /* Timer started to release the channel */ |
| 151 | struct timer_list release_timer; |
Harald Welte | a3d0438 | 2008-12-27 17:02:56 +0000 | [diff] [blame] | 152 | |
| 153 | /* local end of a call, if any */ |
| 154 | struct gsm_call call; |
Holger Freyther | 3186bf2 | 2008-12-29 06:23:49 +0000 | [diff] [blame] | 155 | |
| 156 | /* temporary user data, to be removed... and merged into gsm_call */ |
| 157 | void *user_data; |
Holger Freyther | b7193e4 | 2008-12-29 17:44:08 +0000 | [diff] [blame] | 158 | |
Holger Freyther | 73487a2 | 2008-12-31 18:53:57 +0000 | [diff] [blame] | 159 | /* |
| 160 | * Operations that have a state and might be pending |
| 161 | */ |
| 162 | struct gsm_loc_updating_operation *loc_operation; |
| 163 | |
Holger Freyther | b7193e4 | 2008-12-29 17:44:08 +0000 | [diff] [blame] | 164 | /* use count. how many users use this channel */ |
| 165 | unsigned int use_count; |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 166 | }; |
| 167 | |
Harald Welte | 85770c7 | 2009-01-18 17:47:32 +0000 | [diff] [blame] | 168 | struct gsm_e1_subslot { |
| 169 | /* Number of E1 link */ |
| 170 | u_int8_t e1_nr; |
| 171 | /* Number of E1 TS inside E1 link */ |
| 172 | u_int8_t e1_ts; |
| 173 | /* Sub-slot within the E1 TS, 0xff if full TS */ |
| 174 | u_int8_t e1_ts_ss; |
| 175 | }; |
| 176 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 177 | #define BTS_TRX_F_ACTIVATED 0x0001 |
| 178 | /* One Timeslot in a TRX */ |
| 179 | struct gsm_bts_trx_ts { |
| 180 | struct gsm_bts_trx *trx; |
| 181 | /* number of this timeslot at the TRX */ |
| 182 | u_int8_t nr; |
| 183 | |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 184 | enum gsm_phys_chan_config pchan; |
| 185 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 186 | unsigned int flags; |
Harald Welte | bbcc7a5 | 2009-02-14 19:45:44 +0000 | [diff] [blame] | 187 | struct gsm_nm_state nm_state; |
Harald Welte | 8c1d0e4 | 2009-02-15 03:38:12 +0000 | [diff] [blame] | 188 | struct gsm_attr *nm_attr; |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 189 | |
Harald Welte | 85770c7 | 2009-01-18 17:47:32 +0000 | [diff] [blame] | 190 | /* To which E1 subslot are we connected */ |
| 191 | struct gsm_e1_subslot e1_link; |
Harald Welte | 7509926 | 2009-02-16 21:12:08 +0000 | [diff] [blame] | 192 | struct { |
| 193 | u_int32_t bound_ip; |
| 194 | u_int16_t bound_port; |
| 195 | u_int8_t attr_fc; |
| 196 | u_int16_t attr_f8; |
| 197 | } abis_ip; |
Harald Welte | 85770c7 | 2009-01-18 17:47:32 +0000 | [diff] [blame] | 198 | |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 199 | struct gsm_lchan lchan[TS_MAX_LCHAN]; |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 200 | }; |
| 201 | |
| 202 | /* One TRX in a BTS */ |
| 203 | struct gsm_bts_trx { |
| 204 | struct gsm_bts *bts; |
| 205 | /* number of this TRX in the BTS */ |
| 206 | u_int8_t nr; |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 207 | /* how do we talk RSL with this TRX? */ |
| 208 | struct e1inp_sign_link *rsl_link; |
Harald Welte | bbcc7a5 | 2009-02-14 19:45:44 +0000 | [diff] [blame] | 209 | struct gsm_nm_state nm_state; |
Harald Welte | 8c1d0e4 | 2009-02-15 03:38:12 +0000 | [diff] [blame] | 210 | struct gsm_attr *nm_attr; |
| 211 | struct { |
| 212 | struct gsm_nm_state nm_state; |
| 213 | } bb_transc; |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 214 | |
| 215 | u_int16_t arfcn; |
Harald Welte | 85770c7 | 2009-01-18 17:47:32 +0000 | [diff] [blame] | 216 | struct gsm_bts_trx_ts ts[TRX_NR_TS]; |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 217 | }; |
| 218 | |
Harald Welte | 978cb42 | 2009-01-18 17:57:27 +0000 | [diff] [blame] | 219 | enum gsm_bts_type { |
| 220 | GSM_BTS_TYPE_UNKNOWN, |
| 221 | GSM_BTS_TYPE_BS11, |
Harald Welte | bbcc7a5 | 2009-02-14 19:45:44 +0000 | [diff] [blame] | 222 | GSM_BTS_TYPE_NANOBTS_900, |
| 223 | GSM_BTS_TYPE_NANOBTS_1800, |
Harald Welte | 978cb42 | 2009-01-18 17:57:27 +0000 | [diff] [blame] | 224 | }; |
| 225 | |
Holger Freyther | ceb59b7 | 2009-02-06 18:54:00 +0000 | [diff] [blame] | 226 | /** |
| 227 | * A pending paging request |
| 228 | */ |
| 229 | struct gsm_paging_request { |
Harald Welte | 0932d1e | 2009-02-16 22:53:52 +0000 | [diff] [blame] | 230 | /* list_head for list of all paging requests */ |
Holger Freyther | ceb59b7 | 2009-02-06 18:54:00 +0000 | [diff] [blame] | 231 | struct llist_head entry; |
Harald Welte | 0932d1e | 2009-02-16 22:53:52 +0000 | [diff] [blame] | 232 | /* the subscriber which we're paging. Later gsm_paging_request |
| 233 | * should probably become a part of the gsm_subscriber struct? */ |
Holger Freyther | ceb59b7 | 2009-02-06 18:54:00 +0000 | [diff] [blame] | 234 | struct gsm_subscriber *subscr; |
Harald Welte | 0932d1e | 2009-02-16 22:53:52 +0000 | [diff] [blame] | 235 | /* back-pointer to the BTS on which we are paging */ |
Holger Freyther | ceb59b7 | 2009-02-06 18:54:00 +0000 | [diff] [blame] | 236 | struct gsm_bts *bts; |
Harald Welte | 0932d1e | 2009-02-16 22:53:52 +0000 | [diff] [blame] | 237 | /* what kind of channel type do we ask the MS to establish */ |
Holger Freyther | ceb59b7 | 2009-02-06 18:54:00 +0000 | [diff] [blame] | 238 | int chan_type; |
Harald Welte | cd06bfb | 2009-02-10 17:33:56 +0000 | [diff] [blame] | 239 | |
| 240 | /* Timer 3113: how long do we try to page? */ |
| 241 | struct timer_list T3113; |
Harald Welte | 0932d1e | 2009-02-16 22:53:52 +0000 | [diff] [blame] | 242 | |
| 243 | /* callback to be called in case paging completes */ |
| 244 | gsm_cbfn *cbfn; |
| 245 | void *cbfn_param; |
Holger Freyther | ceb59b7 | 2009-02-06 18:54:00 +0000 | [diff] [blame] | 246 | }; |
Harald Welte | cd06bfb | 2009-02-10 17:33:56 +0000 | [diff] [blame] | 247 | #define T3113_VALUE 60, 0 |
Holger Freyther | ceb59b7 | 2009-02-06 18:54:00 +0000 | [diff] [blame] | 248 | |
| 249 | /* |
| 250 | * This keeps track of the paging status of one BTS. It |
| 251 | * includes a number of pending requests, a back pointer |
| 252 | * to the gsm_bts, a timer and some more state. |
| 253 | */ |
| 254 | struct gsm_bts_paging_state { |
| 255 | /* public callbacks */ |
| 256 | void (*channel_allocated)(struct gsm_lchan *lchan); |
| 257 | |
| 258 | /* pending requests */ |
| 259 | struct llist_head pending_requests; |
| 260 | struct gsm_paging_request *last_request; |
| 261 | struct gsm_bts *bts; |
| 262 | |
Harald Welte | 75a1fa8 | 2009-02-17 01:39:41 +0000 | [diff] [blame] | 263 | struct timer_list work_timer; |
| 264 | |
Holger Freyther | 392209c | 2009-02-10 00:06:19 +0000 | [diff] [blame] | 265 | /* load */ |
| 266 | u_int16_t available_slots; |
Holger Freyther | ceb59b7 | 2009-02-06 18:54:00 +0000 | [diff] [blame] | 267 | }; |
| 268 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 269 | /* One BTS */ |
| 270 | struct gsm_bts { |
| 271 | struct gsm_network *network; |
| 272 | /* number of ths BTS in network */ |
| 273 | u_int8_t nr; |
| 274 | /* location area code of this BTS */ |
| 275 | u_int8_t location_area_code; |
Harald Welte | 02b0e09 | 2009-02-28 13:11:07 +0000 | [diff] [blame] | 276 | /* Training Sequence Code */ |
| 277 | u_int8_t tsc; |
Harald Welte | 978cb42 | 2009-01-18 17:57:27 +0000 | [diff] [blame] | 278 | /* type of BTS */ |
| 279 | enum gsm_bts_type type; |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 280 | /* how do we talk OML with this TRX? */ |
| 281 | struct e1inp_sign_link *oml_link; |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 282 | |
| 283 | /* Abis network management O&M handle */ |
| 284 | struct abis_nm_h *nmh; |
Harald Welte | bbcc7a5 | 2009-02-14 19:45:44 +0000 | [diff] [blame] | 285 | struct gsm_nm_state nm_state; |
Harald Welte | 8c1d0e4 | 2009-02-15 03:38:12 +0000 | [diff] [blame] | 286 | struct gsm_attr *nm_attr; |
Harald Welte | 978cb42 | 2009-01-18 17:57:27 +0000 | [diff] [blame] | 287 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 288 | /* number of this BTS on given E1 link */ |
| 289 | u_int8_t bts_nr; |
| 290 | |
Holger Freyther | 1adb4ff | 2009-02-04 00:04:52 +0000 | [diff] [blame] | 291 | struct gsm48_control_channel_descr chan_desc; |
| 292 | |
Holger Freyther | ceb59b7 | 2009-02-06 18:54:00 +0000 | [diff] [blame] | 293 | /* paging state and control */ |
| 294 | struct gsm_bts_paging_state paging; |
| 295 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 296 | /* CCCH is on C0 */ |
| 297 | struct gsm_bts_trx *c0; |
Harald Welte | bbcc7a5 | 2009-02-14 19:45:44 +0000 | [diff] [blame] | 298 | |
| 299 | struct { |
| 300 | struct gsm_nm_state nm_state; |
| 301 | } site_mgr; |
| 302 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 303 | /* transceivers */ |
| 304 | int num_trx; |
| 305 | struct gsm_bts_trx trx[BTS_MAX_TRX+1]; |
| 306 | }; |
| 307 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 308 | struct gsm_network { |
| 309 | /* global parameters */ |
Harald Welte | b84e2f4 | 2008-12-28 23:42:04 +0000 | [diff] [blame] | 310 | u_int16_t country_code; |
| 311 | u_int16_t network_code; |
Harald Welte | c6ba9c2 | 2008-12-30 18:01:02 +0000 | [diff] [blame] | 312 | char *name_long; |
| 313 | char *name_short; |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 314 | |
| 315 | unsigned int num_bts; |
| 316 | /* private lists */ |
| 317 | struct gsm_bts bts[GSM_MAX_BTS+1]; |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 318 | }; |
| 319 | |
Harald Welte | 7e310b1 | 2009-03-30 20:56:32 +0000 | [diff] [blame] | 320 | #define SMS_HDR_SIZE 128 |
| 321 | #define SMS_TEXT_SIZE 256 |
| 322 | struct gsm_sms { |
| 323 | u_int64_t id; |
| 324 | struct gsm_subscriber *sender; |
| 325 | struct gsm_subscriber *receiver; |
| 326 | |
| 327 | unsigned char header[SMS_HDR_SIZE]; |
| 328 | char text[SMS_TEXT_SIZE]; |
| 329 | }; |
| 330 | |
Harald Welte | 8c1d0e4 | 2009-02-15 03:38:12 +0000 | [diff] [blame] | 331 | struct gsm_network *gsm_network_init(unsigned int num_bts, enum gsm_bts_type bts_type, |
| 332 | u_int16_t country_code, u_int16_t network_code); |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 333 | |
Harald Welte | a72c98e | 2009-01-04 16:10:38 +0000 | [diff] [blame] | 334 | const char *gsm_pchan_name(enum gsm_phys_chan_config c); |
| 335 | const char *gsm_lchan_name(enum gsm_chan_t c); |
| 336 | const char *gsm_chreq_name(enum gsm_chreq_reason_t c); |
Harald Welte | 23a6863 | 2009-02-19 17:06:42 +0000 | [diff] [blame] | 337 | char *gsm_ts_name(struct gsm_bts_trx_ts *ts); |
Harald Welte | a72c98e | 2009-01-04 16:10:38 +0000 | [diff] [blame] | 338 | |
Harald Welte | ad38464 | 2008-12-26 10:20:07 +0000 | [diff] [blame] | 339 | enum gsm_e1_event { |
| 340 | EVT_E1_NONE, |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 341 | EVT_E1_TEI_UP, |
| 342 | EVT_E1_TEI_DN, |
Harald Welte | ad38464 | 2008-12-26 10:20:07 +0000 | [diff] [blame] | 343 | }; |
| 344 | |
Harald Welte | cd06bfb | 2009-02-10 17:33:56 +0000 | [diff] [blame] | 345 | void set_ts_e1link(struct gsm_bts_trx_ts *ts, u_int8_t e1_nr, |
| 346 | u_int8_t e1_ts, u_int8_t e1_ts_ss); |
Harald Welte | 32201c1 | 2009-03-10 12:15:10 +0000 | [diff] [blame] | 347 | enum gsm_bts_type parse_btstype(char *arg); |
| 348 | char *btstype2str(enum gsm_bts_type type); |
| 349 | |
| 350 | static inline int is_ipaccess_bts(struct gsm_bts *bts) |
| 351 | { |
| 352 | switch (bts->type) { |
| 353 | case GSM_BTS_TYPE_NANOBTS_900: |
| 354 | case GSM_BTS_TYPE_NANOBTS_1800: |
| 355 | return 1; |
| 356 | default: |
| 357 | break; |
| 358 | } |
| 359 | return 0; |
| 360 | } |
| 361 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 362 | #endif |