Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 1 | /* A hackish minimal BSC (+MSC +HLR) implementation */ |
| 2 | |
Harald Welte | 4015287 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 3 | /* (C) 2008-2010 by Harald Welte <laforge@gnumonks.org> |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 4 | * (C) 2009 by Holger Hans Peter Freyther <zecke@selfish.org> |
| 5 | * All Rights Reserved |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
Harald Welte | 0e3e88e | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 8 | * it under the terms of the GNU Affero General Public License as published by |
| 9 | * the Free Software Foundation; either version 3 of the License, or |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 10 | * (at your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Harald Welte | 0e3e88e | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 15 | * GNU Affero General Public License for more details. |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 16 | * |
Harald Welte | 0e3e88e | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 17 | * You should have received a copy of the GNU Affero General Public License |
| 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 19 | * |
| 20 | */ |
| 21 | |
| 22 | #include <openbsc/gsm_data.h> |
Pablo Neira Ayuso | dd5fff4 | 2011-03-22 16:47:59 +0100 | [diff] [blame] | 23 | #include <osmocom/gsm/gsm_utils.h> |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 24 | #include <openbsc/gsm_04_08.h> |
| 25 | #include <openbsc/abis_rsl.h> |
| 26 | #include <openbsc/abis_nm.h> |
| 27 | #include <openbsc/debug.h> |
| 28 | #include <openbsc/misdn.h> |
Harald Welte | bd9591f | 2010-05-19 19:45:32 +0200 | [diff] [blame] | 29 | #include <osmocom/vty/telnet_interface.h> |
Harald Welte | 6bcd303 | 2014-08-24 17:54:49 +0200 | [diff] [blame] | 30 | #include <osmocom/vty/ports.h> |
Harald Welte | a54a2bb | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 31 | #include <openbsc/system_information.h> |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 32 | #include <openbsc/paging.h> |
| 33 | #include <openbsc/signal.h> |
Holger Hans Peter Freyther | 5a8b2b4 | 2010-04-15 11:21:02 +0200 | [diff] [blame] | 34 | #include <openbsc/chan_alloc.h> |
Pablo Neira Ayuso | dd5fff4 | 2011-03-22 16:47:59 +0100 | [diff] [blame] | 35 | #include <osmocom/core/talloc.h> |
Holger Hans Peter Freyther | 82260a6 | 2010-11-15 20:43:02 +0100 | [diff] [blame] | 36 | #include <openbsc/ipaccess.h> |
Alexander Huemer | 6489afd | 2011-09-06 00:09:50 +0200 | [diff] [blame] | 37 | #include <osmocom/gsm/sysinfo.h> |
| 38 | #include <openbsc/e1_config.h> |
Neels Hofmeyr | b46b0a6 | 2016-05-14 00:57:04 +0200 | [diff] [blame] | 39 | #include <openbsc/common_bsc.h> |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 40 | |
| 41 | /* global pointer to the gsm network data structure */ |
| 42 | extern struct gsm_network *bsc_gsmnet; |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 43 | |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 44 | /* Callback function for NACK on the OML NM */ |
Holger Hans Peter Freyther | dfea6c8 | 2010-07-14 02:08:35 +0800 | [diff] [blame] | 45 | static int oml_msg_nack(struct nm_nack_signal_data *nack) |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 46 | { |
Max | 9a90afa | 2017-03-16 13:57:47 +0100 | [diff] [blame] | 47 | if (nack->mt == NM_MT_GET_ATTR_NACK) { |
| 48 | LOGP(DNM, LOGL_ERROR, "BTS%u does not support Get Attributes " |
| 49 | "OML message.\n", nack->bts->nr); |
| 50 | return 0; |
Holger Hans Peter Freyther | 860efdf | 2011-05-21 00:05:09 +0200 | [diff] [blame] | 51 | } |
| 52 | |
Max | 9a90afa | 2017-03-16 13:57:47 +0100 | [diff] [blame] | 53 | if (nack->mt == NM_MT_SET_BTS_ATTR_NACK) |
| 54 | LOGP(DNM, LOGL_ERROR, "Failed to set BTS attributes. That is fatal. " |
| 55 | "Was the bts type and frequency properly specified?\n"); |
| 56 | else |
| 57 | LOGP(DNM, LOGL_ERROR, "Got %s NACK going to drop the OML links.\n", |
| 58 | abis_nm_nack_name(nack->mt)); |
Holger Hans Peter Freyther | 860efdf | 2011-05-21 00:05:09 +0200 | [diff] [blame] | 59 | |
Holger Hans Peter Freyther | 70f1e47 | 2012-11-11 18:26:23 +0100 | [diff] [blame] | 60 | if (!nack->bts) { |
| 61 | LOGP(DNM, LOGL_ERROR, "Unknown bts. Can not drop it.\n"); |
Harald Welte | f8878b3 | 2012-10-05 15:48:54 +0200 | [diff] [blame] | 62 | return 0; |
Holger Hans Peter Freyther | 70f1e47 | 2012-11-11 18:26:23 +0100 | [diff] [blame] | 63 | } |
Harald Welte | f8878b3 | 2012-10-05 15:48:54 +0200 | [diff] [blame] | 64 | |
Holger Hans Peter Freyther | 70f1e47 | 2012-11-11 18:26:23 +0100 | [diff] [blame] | 65 | if (is_ipaccess_bts(nack->bts)) |
| 66 | ipaccess_drop_oml(nack->bts); |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 67 | |
| 68 | return 0; |
| 69 | } |
| 70 | |
| 71 | /* Callback function to be called every time we receive a signal from NM */ |
| 72 | static int nm_sig_cb(unsigned int subsys, unsigned int signal, |
| 73 | void *handler_data, void *signal_data) |
| 74 | { |
Holger Hans Peter Freyther | dfea6c8 | 2010-07-14 02:08:35 +0800 | [diff] [blame] | 75 | struct nm_nack_signal_data *nack; |
Harald Welte | 6a21c73 | 2009-11-17 06:09:56 +0100 | [diff] [blame] | 76 | |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 77 | switch (signal) { |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 78 | case S_NM_NACK: |
Holger Hans Peter Freyther | dfea6c8 | 2010-07-14 02:08:35 +0800 | [diff] [blame] | 79 | nack = signal_data; |
| 80 | return oml_msg_nack(nack); |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 81 | default: |
| 82 | break; |
| 83 | } |
| 84 | return 0; |
| 85 | } |
| 86 | |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 87 | int bsc_shutdown_net(struct gsm_network *net) |
| 88 | { |
| 89 | struct gsm_bts *bts; |
| 90 | |
| 91 | llist_for_each_entry(bts, &net->bts_list, list) { |
Harald Welte | 4c826f7 | 2011-01-14 15:55:42 +0100 | [diff] [blame] | 92 | LOGP(DNM, LOGL_NOTICE, "shutting down OML for BTS %u\n", bts->nr); |
Pablo Neira Ayuso | 42e41df | 2011-08-17 22:44:07 +0200 | [diff] [blame] | 93 | osmo_signal_dispatch(SS_L_GLOBAL, S_GLOBAL_BTS_CLOSE_OM, bts); |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 94 | } |
| 95 | |
| 96 | return 0; |
| 97 | } |
| 98 | |
Andreas Eversberg | 02de47d | 2012-02-29 09:04:07 +0100 | [diff] [blame] | 99 | static int rsl_si(struct gsm_bts_trx *trx, enum osmo_sysinfo_type i, int si_len) |
Harald Welte | 99bed52 | 2010-06-15 16:44:12 +0200 | [diff] [blame] | 100 | { |
| 101 | struct gsm_bts *bts = trx->bts; |
Holger Hans Peter Freyther | 1b0af51 | 2013-07-03 16:06:20 +0200 | [diff] [blame] | 102 | int rc; |
Harald Welte | 99bed52 | 2010-06-15 16:44:12 +0200 | [diff] [blame] | 103 | |
Harald Welte | 6b77f0f | 2011-05-24 15:02:20 +0200 | [diff] [blame] | 104 | DEBUGP(DRR, "SI%s: %s\n", get_value_string(osmo_sitype_strs, i), |
Pablo Neira Ayuso | b1d5a69 | 2011-05-07 12:12:48 +0200 | [diff] [blame] | 105 | osmo_hexdump(GSM_BTS_SI(bts, i), GSM_MACBLOCK_LEN)); |
Harald Welte | 99bed52 | 2010-06-15 16:44:12 +0200 | [diff] [blame] | 106 | |
| 107 | switch (i) { |
| 108 | case SYSINFO_TYPE_5: |
| 109 | case SYSINFO_TYPE_5bis: |
| 110 | case SYSINFO_TYPE_5ter: |
| 111 | case SYSINFO_TYPE_6: |
Holger Hans Peter Freyther | 1b0af51 | 2013-07-03 16:06:20 +0200 | [diff] [blame] | 112 | rc = rsl_sacch_filling(trx, osmo_sitype2rsl(i), |
| 113 | GSM_BTS_SI(bts, i), si_len); |
Harald Welte | 99bed52 | 2010-06-15 16:44:12 +0200 | [diff] [blame] | 114 | break; |
| 115 | default: |
Harald Welte | 6b77f0f | 2011-05-24 15:02:20 +0200 | [diff] [blame] | 116 | rc = rsl_bcch_info(trx, osmo_sitype2rsl(i), |
Andreas Eversberg | 02de47d | 2012-02-29 09:04:07 +0100 | [diff] [blame] | 117 | GSM_BTS_SI(bts, i), si_len); |
Harald Welte | 99bed52 | 2010-06-15 16:44:12 +0200 | [diff] [blame] | 118 | break; |
| 119 | } |
| 120 | |
| 121 | return rc; |
| 122 | } |
| 123 | |
Alexander Chemeris | 143ac5f | 2015-05-30 14:40:54 -0400 | [diff] [blame] | 124 | /* set all system information types for a TRX */ |
Holger Hans Peter Freyther | d0284c8 | 2014-11-21 11:18:45 +0100 | [diff] [blame] | 125 | int gsm_bts_trx_set_system_infos(struct gsm_bts_trx *trx) |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 126 | { |
Harald Welte | a54a2bb | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 127 | int i, rc; |
Harald Welte | 36e5a79 | 2009-12-21 23:12:19 +0100 | [diff] [blame] | 128 | struct gsm_bts *bts = trx->bts; |
Andreas Eversberg | 02de47d | 2012-02-29 09:04:07 +0100 | [diff] [blame] | 129 | uint8_t gen_si[_MAX_SYSINFO_TYPE], n_si = 0, n; |
| 130 | int si_len[_MAX_SYSINFO_TYPE]; |
Harald Welte | 36e5a79 | 2009-12-21 23:12:19 +0100 | [diff] [blame] | 131 | |
| 132 | bts->si_common.cell_sel_par.ms_txpwr_max_ccch = |
| 133 | ms_pwr_ctl_lvl(bts->band, bts->ms_max_power); |
| 134 | bts->si_common.cell_sel_par.neci = bts->network->neci; |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 135 | |
Harald Welte | d8acf14 | 2010-07-30 11:50:09 +0200 | [diff] [blame] | 136 | /* First, we determine which of the SI messages we actually need */ |
| 137 | |
Harald Welte | 99bed52 | 2010-06-15 16:44:12 +0200 | [diff] [blame] | 138 | if (trx == bts->c0) { |
Harald Welte | d8acf14 | 2010-07-30 11:50:09 +0200 | [diff] [blame] | 139 | /* 1...4 are always present on a C0 TRX */ |
Andreas Eversberg | 02de47d | 2012-02-29 09:04:07 +0100 | [diff] [blame] | 140 | gen_si[n_si++] = SYSINFO_TYPE_1; |
| 141 | gen_si[n_si++] = SYSINFO_TYPE_2; |
| 142 | gen_si[n_si++] = SYSINFO_TYPE_2bis; |
| 143 | gen_si[n_si++] = SYSINFO_TYPE_2ter; |
Max | cab5beb | 2016-04-15 16:04:44 +0200 | [diff] [blame] | 144 | gen_si[n_si++] = SYSINFO_TYPE_2quater; |
Andreas Eversberg | 02de47d | 2012-02-29 09:04:07 +0100 | [diff] [blame] | 145 | gen_si[n_si++] = SYSINFO_TYPE_3; |
| 146 | gen_si[n_si++] = SYSINFO_TYPE_4; |
Harald Welte | d8acf14 | 2010-07-30 11:50:09 +0200 | [diff] [blame] | 147 | |
| 148 | /* 13 is always present on a C0 TRX of a GPRS BTS */ |
| 149 | if (bts->gprs.mode != BTS_GPRS_NONE) |
Andreas Eversberg | 02de47d | 2012-02-29 09:04:07 +0100 | [diff] [blame] | 150 | gen_si[n_si++] = SYSINFO_TYPE_13; |
Harald Welte | 28fc963 | 2009-12-21 17:02:32 +0100 | [diff] [blame] | 151 | } |
| 152 | |
Harald Welte | d8acf14 | 2010-07-30 11:50:09 +0200 | [diff] [blame] | 153 | /* 5 and 6 are always present on every TRX */ |
Andreas Eversberg | 02de47d | 2012-02-29 09:04:07 +0100 | [diff] [blame] | 154 | gen_si[n_si++] = SYSINFO_TYPE_5; |
| 155 | gen_si[n_si++] = SYSINFO_TYPE_5bis; |
| 156 | gen_si[n_si++] = SYSINFO_TYPE_5ter; |
| 157 | gen_si[n_si++] = SYSINFO_TYPE_6; |
Harald Welte | a54a2bb | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 158 | |
Andreas Eversberg | 02de47d | 2012-02-29 09:04:07 +0100 | [diff] [blame] | 159 | /* Second, we generate the selected SI via RSL */ |
| 160 | |
| 161 | for (n = 0; n < n_si; n++) { |
| 162 | i = gen_si[n]; |
Andreas Eversberg | 02de47d | 2012-02-29 09:04:07 +0100 | [diff] [blame] | 163 | /* Only generate SI if this SI is not in "static" (user-defined) mode */ |
| 164 | if (!(bts->si_mode_static & (1 << i))) { |
Andreas Eversberg | aaf2970 | 2013-01-08 19:33:42 +0100 | [diff] [blame] | 165 | /* Set SI as being valid. gsm_generate_si() might unset |
| 166 | * it, if SI is not required. */ |
| 167 | bts->si_valid |= (1 << i); |
Andreas Eversberg | 02de47d | 2012-02-29 09:04:07 +0100 | [diff] [blame] | 168 | rc = gsm_generate_si(bts, i); |
| 169 | if (rc < 0) |
| 170 | goto err_out; |
| 171 | si_len[i] = rc; |
| 172 | } else { |
| 173 | if (i == SYSINFO_TYPE_5 || i == SYSINFO_TYPE_5bis |
| 174 | || i == SYSINFO_TYPE_5ter) |
| 175 | si_len[i] = 18; |
| 176 | else if (i == SYSINFO_TYPE_6) |
| 177 | si_len[i] = 11; |
| 178 | else |
| 179 | si_len[i] = 23; |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | /* Third, we send the selected SI via RSL */ |
| 184 | |
Andreas Eversberg | aaf2970 | 2013-01-08 19:33:42 +0100 | [diff] [blame] | 185 | for (n = 0; n < n_si; n++) { |
| 186 | i = gen_si[n]; |
Harald Welte | d8acf14 | 2010-07-30 11:50:09 +0200 | [diff] [blame] | 187 | if (!(bts->si_valid & (1 << i))) |
| 188 | continue; |
Andreas Eversberg | 02de47d | 2012-02-29 09:04:07 +0100 | [diff] [blame] | 189 | rc = rsl_si(trx, i, si_len[i]); |
Harald Welte | d8acf14 | 2010-07-30 11:50:09 +0200 | [diff] [blame] | 190 | if (rc < 0) |
Andreas Eversberg | 02de47d | 2012-02-29 09:04:07 +0100 | [diff] [blame] | 191 | return rc; |
Harald Welte | d8acf14 | 2010-07-30 11:50:09 +0200 | [diff] [blame] | 192 | } |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 193 | |
| 194 | return 0; |
Harald Welte | a54a2bb | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 195 | err_out: |
Max | 6617c15 | 2016-12-16 18:45:51 +0100 | [diff] [blame] | 196 | LOGP(DRR, LOGL_ERROR, "Cannot generate SI%s for BTS %u: error <%s>, " |
Max | 88ddcaa | 2016-04-15 16:04:46 +0200 | [diff] [blame] | 197 | "most likely a problem with neighbor cell list generation\n", |
| 198 | get_value_string(osmo_sitype_strs, i), bts->nr, strerror(-rc)); |
Harald Welte | a54a2bb | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 199 | return rc; |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 200 | } |
| 201 | |
Alexander Chemeris | 143ac5f | 2015-05-30 14:40:54 -0400 | [diff] [blame] | 202 | /* set all system information types for a BTS */ |
| 203 | int gsm_bts_set_system_infos(struct gsm_bts *bts) |
| 204 | { |
| 205 | struct gsm_bts_trx *trx; |
| 206 | |
| 207 | /* Generate a new ID */ |
| 208 | bts->bcch_change_mark += 1; |
| 209 | bts->bcch_change_mark %= 0x7; |
| 210 | |
| 211 | llist_for_each_entry(trx, &bts->trx_list, list) { |
| 212 | int rc; |
| 213 | |
| 214 | rc = gsm_bts_trx_set_system_infos(trx); |
| 215 | if (rc != 0) |
| 216 | return rc; |
| 217 | } |
| 218 | |
| 219 | return 0; |
| 220 | } |
| 221 | |
Harald Welte | bf6624d | 2010-06-15 08:52:12 +0200 | [diff] [blame] | 222 | /* Produce a MA as specified in 10.5.2.21 */ |
| 223 | static int generate_ma_for_ts(struct gsm_bts_trx_ts *ts) |
| 224 | { |
| 225 | /* we have three bitvecs: the per-timeslot ARFCNs, the cell chan ARFCNs |
| 226 | * and the MA */ |
| 227 | struct bitvec *cell_chan = &ts->trx->bts->si_common.cell_alloc; |
| 228 | struct bitvec *ts_arfcn = &ts->hopping.arfcns; |
| 229 | struct bitvec *ma = &ts->hopping.ma; |
Harald Welte | 6332a8a | 2010-06-15 16:45:51 +0200 | [diff] [blame] | 230 | unsigned int num_cell_arfcns, bitnum, n_chan; |
Harald Welte | bf6624d | 2010-06-15 08:52:12 +0200 | [diff] [blame] | 231 | int i; |
| 232 | |
| 233 | /* re-set the MA to all-zero */ |
| 234 | ma->cur_bit = 0; |
Harald Welte | 6332a8a | 2010-06-15 16:45:51 +0200 | [diff] [blame] | 235 | ts->hopping.ma_len = 0; |
Harald Welte | bf6624d | 2010-06-15 08:52:12 +0200 | [diff] [blame] | 236 | memset(ma->data, 0, ma->data_len); |
| 237 | |
| 238 | if (!ts->hopping.enabled) |
| 239 | return 0; |
| 240 | |
Harald Welte | 6332a8a | 2010-06-15 16:45:51 +0200 | [diff] [blame] | 241 | /* count the number of ARFCNs in the cell channel allocation */ |
| 242 | num_cell_arfcns = 0; |
Harald Welte | 09e4fad | 2012-01-29 13:24:12 +0100 | [diff] [blame] | 243 | for (i = 0; i < 1024; i++) { |
Harald Welte | 6332a8a | 2010-06-15 16:45:51 +0200 | [diff] [blame] | 244 | if (bitvec_get_bit_pos(cell_chan, i)) |
| 245 | num_cell_arfcns++; |
| 246 | } |
| 247 | |
| 248 | /* pad it to octet-aligned number of bits */ |
| 249 | ts->hopping.ma_len = num_cell_arfcns / 8; |
| 250 | if (num_cell_arfcns % 8) |
| 251 | ts->hopping.ma_len++; |
| 252 | |
| 253 | n_chan = 0; |
Harald Welte | 09e4fad | 2012-01-29 13:24:12 +0100 | [diff] [blame] | 254 | for (i = 0; i < 1024; i++) { |
Harald Welte | bf6624d | 2010-06-15 08:52:12 +0200 | [diff] [blame] | 255 | if (!bitvec_get_bit_pos(cell_chan, i)) |
| 256 | continue; |
Harald Welte | 6332a8a | 2010-06-15 16:45:51 +0200 | [diff] [blame] | 257 | /* set the corresponding bit in the MA */ |
| 258 | bitnum = (ts->hopping.ma_len * 8) - 1 - n_chan; |
Harald Welte | bf6624d | 2010-06-15 08:52:12 +0200 | [diff] [blame] | 259 | if (bitvec_get_bit_pos(ts_arfcn, i)) |
Harald Welte | 6332a8a | 2010-06-15 16:45:51 +0200 | [diff] [blame] | 260 | bitvec_set_bit_pos(ma, bitnum, 1); |
Harald Welte | bf6624d | 2010-06-15 08:52:12 +0200 | [diff] [blame] | 261 | else |
Harald Welte | 6332a8a | 2010-06-15 16:45:51 +0200 | [diff] [blame] | 262 | bitvec_set_bit_pos(ma, bitnum, 0); |
laforge | 1dcdc95 | 2010-06-20 15:56:50 +0200 | [diff] [blame] | 263 | n_chan++; |
Harald Welte | bf6624d | 2010-06-15 08:52:12 +0200 | [diff] [blame] | 264 | } |
| 265 | |
| 266 | /* ARFCN 0 is special: It is coded last in the bitmask */ |
| 267 | if (bitvec_get_bit_pos(cell_chan, 0)) { |
Harald Welte | 6332a8a | 2010-06-15 16:45:51 +0200 | [diff] [blame] | 268 | n_chan++; |
| 269 | /* set the corresponding bit in the MA */ |
| 270 | bitnum = (ts->hopping.ma_len * 8) - 1 - n_chan; |
Harald Welte | bf6624d | 2010-06-15 08:52:12 +0200 | [diff] [blame] | 271 | if (bitvec_get_bit_pos(ts_arfcn, 0)) |
Harald Welte | 6332a8a | 2010-06-15 16:45:51 +0200 | [diff] [blame] | 272 | bitvec_set_bit_pos(ma, bitnum, 1); |
Harald Welte | bf6624d | 2010-06-15 08:52:12 +0200 | [diff] [blame] | 273 | else |
Harald Welte | 6332a8a | 2010-06-15 16:45:51 +0200 | [diff] [blame] | 274 | bitvec_set_bit_pos(ma, bitnum, 0); |
Harald Welte | bf6624d | 2010-06-15 08:52:12 +0200 | [diff] [blame] | 275 | } |
| 276 | |
| 277 | return 0; |
| 278 | } |
| 279 | |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 280 | static void bootstrap_rsl(struct gsm_bts_trx *trx) |
| 281 | { |
Harald Welte | bf6624d | 2010-06-15 08:52:12 +0200 | [diff] [blame] | 282 | unsigned int i; |
| 283 | |
Harald Welte | cf2ec4a | 2009-12-17 23:10:46 +0100 | [diff] [blame] | 284 | LOGP(DRSL, LOGL_NOTICE, "bootstrapping RSL for BTS/TRX (%u/%u) " |
Harald Welte | 7bb55f3 | 2015-11-20 10:43:31 +0100 | [diff] [blame] | 285 | "on ARFCN %u using MCC=%u MNC=%u LAC=%u CID=%u BSIC=%u\n", |
Harald Welte | 424873e | 2009-12-24 13:39:34 +0100 | [diff] [blame] | 286 | trx->bts->nr, trx->nr, trx->arfcn, bsc_gsmnet->country_code, |
| 287 | bsc_gsmnet->network_code, trx->bts->location_area_code, |
Harald Welte | 7bb55f3 | 2015-11-20 10:43:31 +0100 | [diff] [blame] | 288 | trx->bts->cell_identity, trx->bts->bsic); |
Dieter Spaar | 49c843e | 2011-07-28 00:01:50 +0200 | [diff] [blame] | 289 | |
| 290 | if (trx->bts->type == GSM_BTS_TYPE_NOKIA_SITE) { |
| 291 | rsl_nokia_si_begin(trx); |
| 292 | } |
| 293 | |
Holger Hans Peter Freyther | d0284c8 | 2014-11-21 11:18:45 +0100 | [diff] [blame] | 294 | gsm_bts_trx_set_system_infos(trx); |
Harald Welte | bf6624d | 2010-06-15 08:52:12 +0200 | [diff] [blame] | 295 | |
Dieter Spaar | 49c843e | 2011-07-28 00:01:50 +0200 | [diff] [blame] | 296 | if (trx->bts->type == GSM_BTS_TYPE_NOKIA_SITE) { |
| 297 | /* channel unspecific, power reduction in 2 dB steps */ |
| 298 | rsl_bs_power_control(trx, 0xFF, trx->max_power_red / 2); |
| 299 | rsl_nokia_si_end(trx); |
| 300 | } |
| 301 | |
Harald Welte | bf6624d | 2010-06-15 08:52:12 +0200 | [diff] [blame] | 302 | for (i = 0; i < ARRAY_SIZE(trx->ts); i++) |
| 303 | generate_ma_for_ts(&trx->ts[i]); |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 304 | } |
| 305 | |
Harald Welte | 4c826f7 | 2011-01-14 15:55:42 +0100 | [diff] [blame] | 306 | /* Callback function to be called every time we receive a signal from INPUT */ |
| 307 | static int inp_sig_cb(unsigned int subsys, unsigned int signal, |
| 308 | void *handler_data, void *signal_data) |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 309 | { |
Harald Welte | 4c826f7 | 2011-01-14 15:55:42 +0100 | [diff] [blame] | 310 | struct input_signal_data *isd = signal_data; |
| 311 | struct gsm_bts_trx *trx = isd->trx; |
Holger Hans Peter Freyther | 5a8b2b4 | 2010-04-15 11:21:02 +0200 | [diff] [blame] | 312 | int ts_no, lchan_no; |
Max | 07922cd | 2017-05-15 10:29:54 +0200 | [diff] [blame^] | 313 | const uint8_t attr[] = { NM_ATT_SW_CONFIG, }; |
| 314 | |
| 315 | /* we should not request more attributes than we're ready to handle */ |
| 316 | OSMO_ASSERT(sizeof(attr) < MAX_BTS_ATTR); |
Holger Hans Peter Freyther | 5a8b2b4 | 2010-04-15 11:21:02 +0200 | [diff] [blame] | 317 | |
Pablo Neira Ayuso | 42e41df | 2011-08-17 22:44:07 +0200 | [diff] [blame] | 318 | if (subsys != SS_L_INPUT) |
Harald Welte | 4c826f7 | 2011-01-14 15:55:42 +0100 | [diff] [blame] | 319 | return -EINVAL; |
Holger Hans Peter Freyther | 5a8b2b4 | 2010-04-15 11:21:02 +0200 | [diff] [blame] | 320 | |
Harald Welte | 4c826f7 | 2011-01-14 15:55:42 +0100 | [diff] [blame] | 321 | switch (signal) { |
Pablo Neira Ayuso | 42e41df | 2011-08-17 22:44:07 +0200 | [diff] [blame] | 322 | case S_L_INP_TEI_UP: |
Dieter Spaar | 49c843e | 2011-07-28 00:01:50 +0200 | [diff] [blame] | 323 | if (isd->link_type == E1INP_SIGN_OML) { |
| 324 | /* TODO: this is required for the Nokia BTS, hopping is configured |
| 325 | during OML, other MA is not set. */ |
| 326 | struct gsm_bts_trx *cur_trx; |
| 327 | /* was static in system_information.c */ |
| 328 | extern int generate_cell_chan_list(uint8_t *chan_list, struct gsm_bts *bts); |
| 329 | uint8_t ca[20]; |
| 330 | /* has to be called before generate_ma_for_ts to |
| 331 | set bts->si_common.cell_alloc */ |
| 332 | generate_cell_chan_list(ca, trx->bts); |
| 333 | |
| 334 | llist_for_each_entry(cur_trx, &trx->bts->trx_list, list) { |
| 335 | int i; |
| 336 | |
Neels Hofmeyr | a34ddc5 | 2016-06-02 01:18:02 +0200 | [diff] [blame] | 337 | for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) |
Dieter Spaar | 49c843e | 2011-07-28 00:01:50 +0200 | [diff] [blame] | 338 | generate_ma_for_ts(&cur_trx->ts[i]); |
| 339 | } |
Max | 07922cd | 2017-05-15 10:29:54 +0200 | [diff] [blame^] | 340 | |
| 341 | abis_nm_get_attr(trx->bts, NM_OC_BTS, trx->bts->nr, trx->nr, 0xFF, attr, sizeof(attr)); |
Dieter Spaar | 49c843e | 2011-07-28 00:01:50 +0200 | [diff] [blame] | 342 | } |
Harald Welte | 4c826f7 | 2011-01-14 15:55:42 +0100 | [diff] [blame] | 343 | if (isd->link_type == E1INP_SIGN_RSL) |
| 344 | bootstrap_rsl(trx); |
| 345 | break; |
Pablo Neira Ayuso | 42e41df | 2011-08-17 22:44:07 +0200 | [diff] [blame] | 346 | case S_L_INP_TEI_DN: |
| 347 | LOGP(DLMI, LOGL_ERROR, "Lost some E1 TEI link: %d %p\n", isd->link_type, trx); |
Harald Welte | 4c826f7 | 2011-01-14 15:55:42 +0100 | [diff] [blame] | 348 | |
| 349 | if (isd->link_type == E1INP_SIGN_OML) |
Alexander Couzens | d8aad3a | 2016-08-02 11:34:11 +0200 | [diff] [blame] | 350 | rate_ctr_inc(&trx->bts->network->bsc_ctrs->ctr[BSC_CTR_BTS_OML_FAIL]); |
Harald Welte | 4c826f7 | 2011-01-14 15:55:42 +0100 | [diff] [blame] | 351 | else if (isd->link_type == E1INP_SIGN_RSL) |
Alexander Couzens | d8aad3a | 2016-08-02 11:34:11 +0200 | [diff] [blame] | 352 | rate_ctr_inc(&trx->bts->network->bsc_ctrs->ctr[BSC_CTR_BTS_RSL_FAIL]); |
Holger Hans Peter Freyther | 3e09b3f | 2010-04-12 10:45:52 +0200 | [diff] [blame] | 353 | |
Holger Hans Peter Freyther | 5a8b2b4 | 2010-04-15 11:21:02 +0200 | [diff] [blame] | 354 | /* |
| 355 | * free all allocated channels. change the nm_state so the |
| 356 | * trx and trx_ts becomes unusable and chan_alloc.c can not |
| 357 | * allocate from it. |
| 358 | */ |
| 359 | for (ts_no = 0; ts_no < ARRAY_SIZE(trx->ts); ++ts_no) { |
| 360 | struct gsm_bts_trx_ts *ts = &trx->ts[ts_no]; |
| 361 | |
| 362 | for (lchan_no = 0; lchan_no < ARRAY_SIZE(ts->lchan); ++lchan_no) { |
Holger Hans Peter Freyther | ade87dd | 2010-08-25 12:29:24 +0800 | [diff] [blame] | 363 | if (ts->lchan[lchan_no].state != LCHAN_S_NONE) |
Holger Hans Peter Freyther | 5a8b2b4 | 2010-04-15 11:21:02 +0200 | [diff] [blame] | 364 | lchan_free(&ts->lchan[lchan_no]); |
| 365 | lchan_reset(&ts->lchan[lchan_no]); |
| 366 | } |
Holger Hans Peter Freyther | 5a8b2b4 | 2010-04-15 11:21:02 +0200 | [diff] [blame] | 367 | } |
| 368 | |
Harald Welte | 452119d | 2011-06-29 16:49:03 +0200 | [diff] [blame] | 369 | gsm_bts_mo_reset(trx->bts); |
Holger Hans Peter Freyther | 2a6bffe | 2010-11-15 20:50:42 +0100 | [diff] [blame] | 370 | |
| 371 | abis_nm_clear_queue(trx->bts); |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 372 | break; |
| 373 | default: |
| 374 | break; |
| 375 | } |
Harald Welte | 4c826f7 | 2011-01-14 15:55:42 +0100 | [diff] [blame] | 376 | |
| 377 | return 0; |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 378 | } |
| 379 | |
| 380 | static int bootstrap_bts(struct gsm_bts *bts) |
| 381 | { |
Sylvain Munaut | 63e014e | 2010-04-28 21:31:29 +0200 | [diff] [blame] | 382 | int i, n; |
| 383 | |
Max | 0ae7153 | 2016-04-08 11:52:34 +0200 | [diff] [blame] | 384 | if (!bts->model) |
| 385 | return -EFAULT; |
| 386 | |
Pablo Neira Ayuso | 5bd96a7 | 2011-05-14 11:32:48 +0200 | [diff] [blame] | 387 | if (bts->model->start && !bts->model->started) { |
| 388 | int ret = bts->model->start(bts->network); |
| 389 | if (ret < 0) |
| 390 | return ret; |
| 391 | |
| 392 | bts->model->started = true; |
| 393 | } |
| 394 | |
Harald Welte | eee698b | 2010-05-26 17:14:42 +0200 | [diff] [blame] | 395 | /* FIXME: What about secondary TRX of a BTS? What about a BTS that has TRX |
| 396 | * in different bands? Why is 'band' a parameter of the BTS and not of the TRX? */ |
Mike Haben | 66e0ba0 | 2009-10-02 12:19:34 +0100 | [diff] [blame] | 397 | switch (bts->band) { |
| 398 | case GSM_BAND_1800: |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 399 | if (bts->c0->arfcn < 512 || bts->c0->arfcn > 885) { |
Harald Welte | cf2ec4a | 2009-12-17 23:10:46 +0100 | [diff] [blame] | 400 | LOGP(DNM, LOGL_ERROR, "GSM1800 channel must be between 512-885.\n"); |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 401 | return -EINVAL; |
| 402 | } |
| 403 | break; |
Mike Haben | 66e0ba0 | 2009-10-02 12:19:34 +0100 | [diff] [blame] | 404 | case GSM_BAND_1900: |
| 405 | if (bts->c0->arfcn < 512 || bts->c0->arfcn > 810) { |
Harald Welte | cf2ec4a | 2009-12-17 23:10:46 +0100 | [diff] [blame] | 406 | LOGP(DNM, LOGL_ERROR, "GSM1900 channel must be between 512-810.\n"); |
Mike Haben | 66e0ba0 | 2009-10-02 12:19:34 +0100 | [diff] [blame] | 407 | return -EINVAL; |
| 408 | } |
| 409 | break; |
| 410 | case GSM_BAND_900: |
Holger Hans Peter Freyther | 1abf653 | 2015-06-20 18:45:35 +0200 | [diff] [blame] | 411 | if ((bts->c0->arfcn > 124 && bts->c0->arfcn < 955) || |
Holger Hans Peter Freyther | 2ba2b33 | 2010-02-09 15:44:14 +0100 | [diff] [blame] | 412 | bts->c0->arfcn > 1023) { |
Michael McTernan | 85b6731 | 2015-06-19 20:51:43 +0200 | [diff] [blame] | 413 | LOGP(DNM, LOGL_ERROR, "GSM900 channel must be between 0-124, 955-1023.\n"); |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 414 | return -EINVAL; |
| 415 | } |
| 416 | break; |
Harald Welte | eee698b | 2010-05-26 17:14:42 +0200 | [diff] [blame] | 417 | case GSM_BAND_850: |
| 418 | if (bts->c0->arfcn < 128 || bts->c0->arfcn > 251) { |
| 419 | LOGP(DNM, LOGL_ERROR, "GSM850 channel must be between 128-251.\n"); |
| 420 | return -EINVAL; |
| 421 | } |
| 422 | break; |
Mike Haben | 66e0ba0 | 2009-10-02 12:19:34 +0100 | [diff] [blame] | 423 | default: |
Harald Welte | cf2ec4a | 2009-12-17 23:10:46 +0100 | [diff] [blame] | 424 | LOGP(DNM, LOGL_ERROR, "Unsupported frequency band.\n"); |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 425 | return -EINVAL; |
| 426 | } |
| 427 | |
Harald Welte | 395cb6b | 2009-12-12 13:44:19 +0100 | [diff] [blame] | 428 | if (bts->network->auth_policy == GSM_AUTH_POLICY_ACCEPT_ALL && |
Harald Welte | 8c973ba | 2009-12-21 23:08:18 +0100 | [diff] [blame] | 429 | !bts->si_common.rach_control.cell_bar) |
Harald Welte | 36ab545 | 2009-12-21 23:36:45 +0100 | [diff] [blame] | 430 | LOGP(DNM, LOGL_ERROR, "\nWARNING: You are running an 'accept-all' " |
Harald Welte | 395cb6b | 2009-12-12 13:44:19 +0100 | [diff] [blame] | 431 | "network on a BTS that is not barred. This " |
| 432 | "configuration is likely to interfere with production " |
| 433 | "GSM networks and should only be used in a RF " |
| 434 | "shielded environment such as a faraday cage!\n\n"); |
| 435 | |
Andreas Eversberg | 14e12f2 | 2012-10-13 07:27:47 +0200 | [diff] [blame] | 436 | /* Control Channel Description is set from vty/config */ |
Harald Welte | 961ac53 | 2011-01-13 23:20:45 +0100 | [diff] [blame] | 437 | |
Holger Hans Peter Freyther | 8c99434 | 2010-04-30 13:32:05 +0800 | [diff] [blame] | 438 | /* T3212 is set from vty/config */ |
Sylvain Munaut | 63e014e | 2010-04-28 21:31:29 +0200 | [diff] [blame] | 439 | |
Holger Hans Peter Freyther | 8c99434 | 2010-04-30 13:32:05 +0800 | [diff] [blame] | 440 | /* Set ccch config by looking at ts config */ |
Sylvain Munaut | 63e014e | 2010-04-28 21:31:29 +0200 | [diff] [blame] | 441 | for (n=0, i=0; i<8; i++) |
| 442 | n += bts->c0->ts[i].pchan == GSM_PCHAN_CCCH ? 1 : 0; |
| 443 | |
| 444 | switch (n) { |
| 445 | case 0: |
| 446 | bts->si_common.chan_desc.ccch_conf = RSL_BCCH_CCCH_CONF_1_C; |
Max | d5e4ee9 | 2016-10-12 12:48:50 +0200 | [diff] [blame] | 447 | /* Limit reserved block to 2 on combined channel according to |
| 448 | 3GPP TS 44.018 Table 10.5.2.11.1 */ |
| 449 | if (bts->si_common.chan_desc.bs_ag_blks_res > 2) { |
| 450 | LOGP(DNM, LOGL_NOTICE, "CCCH is combined with SDCCHs, " |
| 451 | "reducing BS-AG-BLKS-RES value %d -> 2\n", |
| 452 | bts->si_common.chan_desc.bs_ag_blks_res); |
Andreas Eversberg | 14e12f2 | 2012-10-13 07:27:47 +0200 | [diff] [blame] | 453 | bts->si_common.chan_desc.bs_ag_blks_res = 2; |
Max | d5e4ee9 | 2016-10-12 12:48:50 +0200 | [diff] [blame] | 454 | } |
Sylvain Munaut | 63e014e | 2010-04-28 21:31:29 +0200 | [diff] [blame] | 455 | break; |
| 456 | case 1: |
| 457 | bts->si_common.chan_desc.ccch_conf = RSL_BCCH_CCCH_CONF_1_NC; |
| 458 | break; |
| 459 | case 2: |
| 460 | bts->si_common.chan_desc.ccch_conf = RSL_BCCH_CCCH_CONF_2_NC; |
| 461 | break; |
| 462 | case 3: |
| 463 | bts->si_common.chan_desc.ccch_conf = RSL_BCCH_CCCH_CONF_3_NC; |
| 464 | break; |
| 465 | case 4: |
| 466 | bts->si_common.chan_desc.ccch_conf = RSL_BCCH_CCCH_CONF_4_NC; |
| 467 | break; |
| 468 | default: |
| 469 | LOGP(DNM, LOGL_ERROR, "Unsupported CCCH timeslot configuration\n"); |
| 470 | return -EINVAL; |
| 471 | } |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 472 | |
Harald Welte | a54a2bb | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 473 | bts->si_common.cell_options.pwrc = 0; /* PWRC not set */ |
| 474 | |
Harald Welte | a54a2bb | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 475 | bts->si_common.cell_sel_par.acs = 0; |
Harald Welte | a54a2bb | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 476 | |
| 477 | bts->si_common.ncc_permitted = 0xff; |
| 478 | |
Holger Hans Peter Freyther | 29cd72a | 2011-07-18 11:26:07 +0200 | [diff] [blame] | 479 | /* Initialize the BTS state */ |
| 480 | gsm_bts_mo_reset(bts); |
| 481 | |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 482 | return 0; |
| 483 | } |
| 484 | |
Neels Hofmeyr | 6318d9f | 2016-05-11 14:12:00 +0200 | [diff] [blame] | 485 | int bsc_network_alloc(mncc_recv_cb_t mncc_recv) |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 486 | { |
Neels Hofmeyr | 5494c27 | 2016-05-14 00:45:26 +0200 | [diff] [blame] | 487 | bsc_gsmnet = bsc_network_init(tall_bsc_ctx, 1, 1, mncc_recv); |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 488 | if (!bsc_gsmnet) |
| 489 | return -ENOMEM; |
| 490 | |
| 491 | bsc_gsmnet->name_long = talloc_strdup(bsc_gsmnet, "OpenBSC"); |
| 492 | bsc_gsmnet->name_short = talloc_strdup(bsc_gsmnet, "OpenBSC"); |
| 493 | |
Neels Hofmeyr | 6318d9f | 2016-05-11 14:12:00 +0200 | [diff] [blame] | 494 | return 0; |
| 495 | } |
| 496 | |
| 497 | int bsc_network_configure(const char *config_file) |
| 498 | { |
| 499 | struct gsm_bts *bts; |
| 500 | int rc; |
| 501 | |
Neels Hofmeyr | 9467a82 | 2016-05-11 13:39:33 +0200 | [diff] [blame] | 502 | rc = vty_read_config_file(config_file, NULL); |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 503 | if (rc < 0) { |
Harald Welte | cf2ec4a | 2009-12-17 23:10:46 +0100 | [diff] [blame] | 504 | LOGP(DNM, LOGL_FATAL, "Failed to parse the config file: '%s'\n", config_file); |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 505 | return rc; |
| 506 | } |
| 507 | |
Neels Hofmeyr | 737252c | 2016-02-23 14:09:38 +0100 | [diff] [blame] | 508 | /* start telnet after reading config for vty_get_bind_addr() */ |
Neels Hofmeyr | 737252c | 2016-02-23 14:09:38 +0100 | [diff] [blame] | 509 | rc = telnet_init_dynif(tall_bsc_ctx, bsc_gsmnet, vty_get_bind_addr(), |
| 510 | OSMO_VTY_PORT_NITB_BSC); |
Harald Welte | 4015287 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 511 | if (rc < 0) |
| 512 | return rc; |
| 513 | |
Pablo Neira Ayuso | ef717c6 | 2011-05-06 12:12:31 +0200 | [diff] [blame] | 514 | osmo_signal_register_handler(SS_NM, nm_sig_cb, NULL); |
Pablo Neira Ayuso | 42e41df | 2011-08-17 22:44:07 +0200 | [diff] [blame] | 515 | osmo_signal_register_handler(SS_L_INPUT, inp_sig_cb, NULL); |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 516 | |
| 517 | llist_for_each_entry(bts, &bsc_gsmnet->bts_list, list) { |
Harald Welte | 08011e2 | 2011-03-04 13:41:31 +0100 | [diff] [blame] | 518 | rc = bootstrap_bts(bts); |
Pablo Neira Ayuso | 4726e7e | 2011-05-14 11:32:46 +0200 | [diff] [blame] | 519 | if (rc < 0) { |
| 520 | LOGP(DNM, LOGL_FATAL, "Error bootstrapping BTS\n"); |
| 521 | return rc; |
| 522 | } |
Pablo Neira Ayuso | 42e41df | 2011-08-17 22:44:07 +0200 | [diff] [blame] | 523 | rc = e1_reconfig_bts(bts); |
Harald Welte | a849782 | 2011-02-05 15:41:24 +0100 | [diff] [blame] | 524 | if (rc < 0) { |
Pablo Neira Ayuso | 4726e7e | 2011-05-14 11:32:46 +0200 | [diff] [blame] | 525 | LOGP(DNM, LOGL_FATAL, "Error enabling E1 input driver\n"); |
| 526 | return rc; |
Harald Welte | a849782 | 2011-02-05 15:41:24 +0100 | [diff] [blame] | 527 | } |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 528 | } |
Holger Hans Peter Freyther | cad370f | 2009-08-17 06:55:10 +0200 | [diff] [blame] | 529 | return 0; |
| 530 | } |