diff options
Diffstat (limited to 'src/osmo-bts-oc2g/main.c')
-rw-r--r-- | src/osmo-bts-oc2g/main.c | 72 |
1 files changed, 44 insertions, 28 deletions
diff --git a/src/osmo-bts-oc2g/main.c b/src/osmo-bts-oc2g/main.c index 5b66c6f3..75ad3149 100644 --- a/src/osmo-bts-oc2g/main.c +++ b/src/osmo-bts-oc2g/main.c @@ -2,7 +2,7 @@ /* Copyright (C) 2015 by Yves Godin <support@nuranwireless.com> * Copyright (C) 2016 by Harald Welte <laforge@gnumonks.org> - * + * * Based on sysmoBTS: * (C) 2011-2013 by Harald Welte <laforge@gnumonks.org> * @@ -16,7 +16,7 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. @@ -76,7 +76,6 @@ static int write_status_file(char *status_file, char *status_str) #include "utils.h" #include "l1_if.h" #include "hw_misc.h" -#include "oml_router.h" #include "misc/oc2gbts_bid.h" unsigned int dsp_trace = 0x00000000; @@ -84,48 +83,63 @@ unsigned int dsp_trace = 0x00000000; int bts_model_init(struct gsm_bts *bts) { struct stat st; - static struct osmo_fd accept_fd, read_fd; - int rc; + struct bts_oc2g_priv *bts_oc2g = talloc(bts, struct bts_oc2g_priv); + bts->model_priv = bts_oc2g; bts->variant = BTS_OSMO_OC2G; bts->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3); + bts->gprs.cell.support.gprs_codings = NM_IPAC_MASK_GPRS_CODING_CS + | NM_IPAC_MASK_GPRS_CODING_MCS; /* specific default values for OC2G platform */ /* TODO(oramadan) MERGE - bts->oc2g.led_ctrl_mode = OC2G_BTS_LED_CTRL_MODE_DEFAULT; + bts_oc2g->led_ctrl_mode = OC2G_BTS_LED_CTRL_MODE_DEFAULT; */ /* RTP drift threshold default */ - /* bts->oc2g.rtp_drift_thres_ms = OC2G_BTS_RTP_DRIFT_THRES_DEFAULT; */ - - rc = oml_router_init(bts, OML_ROUTER_PATH, &accept_fd, &read_fd); - if (rc < 0) { - fprintf(stderr, "Error creating the OML router: %s rc=%d\n", - OML_ROUTER_PATH, rc); - exit(1); - } + /* bts_oc2g->rtp_drift_thres_ms = OC2G_BTS_RTP_DRIFT_THRES_DEFAULT; */ if (stat(OC2GBTS_RF_LOCK_PATH, &st) == 0) { LOGP(DL1C, LOGL_NOTICE, "Not starting BTS due to RF_LOCK file present\n"); exit(23); } - gsm_bts_set_feature(bts, BTS_FEAT_GPRS); - gsm_bts_set_feature(bts, BTS_FEAT_EGPRS); - gsm_bts_set_feature(bts, BTS_FEAT_OML_ALERTS); - gsm_bts_set_feature(bts, BTS_FEAT_AGCH_PCH_PROP); - gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_F_V1); - gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_H_V1); - gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_F_EFR); - gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_F_AMR); - gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_H_AMR); - - bts_model_vty_init(bts); + /* order alphabetically */ + osmo_bts_set_feature(bts->features, BTS_FEAT_AGCH_PCH_PROP); + osmo_bts_set_feature(bts->features, BTS_FEAT_CBCH); + osmo_bts_set_feature(bts->features, BTS_FEAT_EGPRS); + osmo_bts_set_feature(bts->features, BTS_FEAT_GPRS); + osmo_bts_set_feature(bts->features, BTS_FEAT_OML_ALERTS); + osmo_bts_set_feature(bts->features, BTS_FEAT_SPEECH_F_AMR); + osmo_bts_set_feature(bts->features, BTS_FEAT_SPEECH_F_EFR); + osmo_bts_set_feature(bts->features, BTS_FEAT_SPEECH_F_V1); + osmo_bts_set_feature(bts->features, BTS_FEAT_SPEECH_H_AMR); + osmo_bts_set_feature(bts->features, BTS_FEAT_SPEECH_H_V1); + + bts_internal_flag_set(bts, BTS_INTERNAL_FLAG_MS_PWR_CTRL_DSP); + bts_internal_flag_set(bts, BTS_INTERNAL_FLAG_NM_RCHANNEL_DEPENDS_RCARRIER); + + /* The default HR codec output format in the absence of saved + * vty config needs to match what was implemented previously, + * for the sake of existing deployments, i.e., to avoid + * a surprise functional change upon software update. */ + bts->emit_hr_rfc5993 = false; return 0; } int bts_model_trx_init(struct gsm_bts_trx *trx) { + /* Frequency bands indicated to the BSC */ + trx->support.freq_bands = 0x00; /* updated in info_compl_cb() */ + + /* Channel types and modes indicated to the BSC */ + trx->support.chan_types = NM_IPAC_MASK_CHANT_COMMON + | NM_IPAC_F_CHANT_BCCH_SDCCH4_CBCH + | NM_IPAC_F_CHANT_SDCCH8_CBCH + | NM_IPAC_F_CHANT_PDCHF + | NM_IPAC_F_CHANT_TCHF_PDCHF; + trx->support.chan_modes = NM_IPAC_MASK_CHANM_SPEECH; + trx->nominal_power = 25; trx->power_params.trx_p_max_out_mdBm = to_mdB(trx->bts->c0->nominal_power); return 0; @@ -165,9 +179,11 @@ void bts_update_status(enum bts_global_status which, int on) void bts_model_print_help() { - printf( " -w --hw-version Print the targeted HW Version\n" - " -M --pcu-direct Force PCU to access message queue for PDCH dchannel directly\n" - " -p --dsp-trace Set DSP trace flags\n" + printf( "\nModel specific options:\n" + " -w --hw-version Print the targeted HW Version\n" + " -M --pcu-direct Force PCU to access message queue for " + "PDCH dchannel directly\n" + " -p --dsp-trace Set DSP trace flags\n" ); } |