From 75f105bbb5011a04e599cbc8f053afb723582364 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Mon, 8 Jul 2013 18:41:05 +0200 Subject: Fix: Retrieve ARFCN (from OML) for TRX other than C0 --- src/common/oml.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/common') diff --git a/src/common/oml.c b/src/common/oml.c index 5f9c0a2b..6d778a53 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -590,6 +590,25 @@ static int oml_rx_set_radio_attr(struct gsm_bts_trx *trx, struct msgb *msg) trx->arfcn_num = length; } else trx->arfcn_num = 0; +#else + if (trx != trx->bts->c0 && TLVP_PRESENT(&tp, NM_ATT_ARFCN_LIST)) { + const uint8_t *value = TLVP_VAL(&tp, NM_ATT_ARFCN_LIST); + uint16_t _value; + uint16_t length = TLVP_LEN(&tp, NM_ATT_ARFCN_LIST); + uint16_t arfcn; + if (length != 2) { + LOGP(DOML, LOGL_ERROR, "Expecting only one ARFCN, " + "because hopping not supported\n"); + /* FIXME: send NACK */ + return -ENOTSUP; + } + memcpy(&_value, value, 2); + arfcn = ntohs(_value); + value += 2; + if (arfcn > 1024) + return oml_fom_ack_nack(msg, NM_NACK_FREQ_NOTAVAIL); + trx->arfcn = arfcn; + } #endif /* call into BTS driver to apply new attributes to hardware */ return bts_model_apply_oml(trx->bts, msg, tp_merged, NM_OC_RADIO_CARRIER, trx); -- cgit v1.2.3 From 5fa388c366b19f753462a19776a59845b7dc5540 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Mon, 8 Jul 2013 18:34:14 +0200 Subject: Fix: Process all TRX on GSM Time indication, not only C0 --- src/common/l1sap.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/common') diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 1cb752e3..b568cf01 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -278,11 +278,11 @@ static int to_gsmtap(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) } /* time information received from bts model */ -static int l1sap_info_time_ind(struct gsm_bts_trx *trx, +static int l1sap_info_time_ind(struct gsm_bts *bts, struct osmo_phsap_prim *l1sap, struct info_time_ind_param *info_time_ind) { - struct gsm_bts *bts = trx->bts; + struct gsm_bts_trx *trx; struct gsm_bts_role_bts *btsb = bts->role; int frames_expired = info_time_ind->fn - btsb->gsm_time.fn; @@ -297,7 +297,8 @@ static int l1sap_info_time_ind(struct gsm_bts_trx *trx, /* check if the measurement period of some lchan has ended * and pre-compute the respective measurement */ - trx_meas_check_compute(trx, info_time_ind->fn - 1); + llist_for_each_entry(trx, &bts->trx_list, list) + trx_meas_check_compute(trx, info_time_ind->fn - 1); /* increment number of RACH slots that have passed by since the * last time indication */ @@ -352,7 +353,7 @@ static int l1sap_mph_info_ind(struct gsm_bts_trx *trx, switch (info->type) { case PRIM_INFO_TIME: - rc = l1sap_info_time_ind(trx, l1sap, &info->u.time_ind); + rc = l1sap_info_time_ind(trx->bts, l1sap, &info->u.time_ind); break; case PRIM_INFO_MEAS: rc = l1sap_info_meas_ind(trx, l1sap, &info->u.meas_ind); -- cgit v1.2.3 From 79bc80102c4cfa2a309e1ba9e90df7df9f34a307 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Mon, 13 Jan 2014 14:46:01 +0100 Subject: Fix: Call e1inp_vty_init() before reading config file --- src/common/abis.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/common') diff --git a/src/common/abis.c b/src/common/abis.c index 9eb49a08..3b9bcdd2 100644 --- a/src/common/abis.c +++ b/src/common/abis.c @@ -203,7 +203,6 @@ void abis_init(struct gsm_bts *bts) g_bts = bts; oml_init(); - e1inp_vty_init(); libosmo_abis_init(NULL); osmo_signal_register_handler(SS_L_INPUT, &inp_s_cbfn, bts); -- cgit v1.2.3 From c64fa4f88818a63bada0e34d179fd04319de47e1 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Tue, 26 Mar 2013 07:52:41 +0100 Subject: Change to new structure of multirate at gsm_data_shared.h --- src/common/amr.c | 23 +++++++++++++---------- src/common/rsl.c | 12 ++++++------ 2 files changed, 19 insertions(+), 16 deletions(-) (limited to 'src/common') diff --git a/src/common/amr.c b/src/common/amr.c index 4a79b69f..b0ff1b9c 100644 --- a/src/common/amr.c +++ b/src/common/amr.c @@ -16,8 +16,9 @@ void amr_log_mr_conf(int ss, int logl, const char *pfx, for (i = 0; i < amr_mrc->num_modes; i++) LOGPC(ss, logl, ", mode[%u] = %u/%u/%u", - i, amr_mrc->mode[i].mode, amr_mrc->mode[i].threshold, - amr_mrc->mode[i].hysteresis); + i, amr_mrc->mode[i].mode, + amr_mrc->mode[i].threshold_bts, + amr_mrc->mode[i].hysteresis_bts); LOGPC(ss, logl, "\n"); } @@ -68,18 +69,18 @@ int amr_parse_mr_conf(struct amr_multirate_conf *amr_mrc, } if (num_codecs >= 2) { - amr_mrc->mode[0].threshold = mr_conf[1] & 0x3F; - amr_mrc->mode[0].hysteresis = mr_conf[2] >> 4; + amr_mrc->mode[0].threshold_bts = mr_conf[1] & 0x3F; + amr_mrc->mode[0].hysteresis_bts = mr_conf[2] >> 4; } if (num_codecs >= 3) { - amr_mrc->mode[1].threshold = + amr_mrc->mode[1].threshold_bts = ((mr_conf[2] & 0xF) << 2) | (mr_conf[3] >> 6); - amr_mrc->mode[1].hysteresis = (mr_conf[3] >> 2) & 0x7; + amr_mrc->mode[1].hysteresis_bts = (mr_conf[3] >> 2) & 0xF; } if (num_codecs >= 4) { - amr_mrc->mode[3].threshold = + amr_mrc->mode[2].threshold_bts = ((mr_conf[3] & 0x3) << 4) | (mr_conf[4] >> 4); - amr_mrc->mode[3].hysteresis = mr_conf[4] & 0xF; + amr_mrc->mode[2].hysteresis_bts = mr_conf[4] & 0xF; } return num_codecs; @@ -94,10 +95,12 @@ ret_einval: unsigned int amr_get_initial_mode(struct gsm_lchan *lchan) { struct amr_multirate_conf *amr_mrc = &lchan->tch.amr_mr; + struct gsm48_multi_rate_conf *mr_conf = + (struct gsm48_multi_rate_conf *) amr_mrc->gsm48_ie; - if (lchan->mr_conf.icmi) { + if (mr_conf->icmi) { /* initial mode given, coding in TS 05.09 3.4.1 */ - return lchan->mr_conf.smod; + return mr_conf->smod; } else { /* implicit rule according to TS 05.09 Chapter 3.4.3 */ switch (amr_mrc->num_modes) { diff --git a/src/common/rsl.c b/src/common/rsl.c index 0908f1cc..a225155a 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -837,12 +837,12 @@ static int rsl_rx_chan_activ(struct msgb *msg) } /* 9.3.52 MultiRate Configuration */ if (TLVP_PRESENT(&tp, RSL_IE_MR_CONFIG)) { - if (TLVP_LEN(&tp, RSL_IE_MR_CONFIG) > sizeof(lchan->mr_conf)) { + if (TLVP_LEN(&tp, RSL_IE_MR_CONFIG) > sizeof(lchan->mr_bts_lv) - 1) { LOGP(DRSL, LOGL_ERROR, "Error parsing MultiRate conf IE\n"); return rsl_tx_error_report(msg->trx, RSL_ERR_IE_CONTENT); } - memcpy(&lchan->mr_conf, TLVP_VAL(&tp, RSL_IE_MR_CONFIG), - TLVP_LEN(&tp, RSL_IE_MR_CONFIG)); + memcpy(lchan->mr_bts_lv, TLVP_VAL(&tp, RSL_IE_MR_CONFIG) - 1, + TLVP_LEN(&tp, RSL_IE_MR_CONFIG) + 1); amr_parse_mr_conf(&lchan->tch.amr_mr, TLVP_VAL(&tp, RSL_IE_MR_CONFIG), TLVP_LEN(&tp, RSL_IE_MR_CONFIG)); amr_log_mr_conf(DRTP, LOGL_DEBUG, gsm_lchan_name(lchan), @@ -1094,12 +1094,12 @@ static int rsl_rx_mode_modif(struct msgb *msg) /* 9.3.52 MultiRate Configuration */ if (TLVP_PRESENT(&tp, RSL_IE_MR_CONFIG)) { - if (TLVP_LEN(&tp, RSL_IE_MR_CONFIG) > sizeof(lchan->mr_conf)) { + if (TLVP_LEN(&tp, RSL_IE_MR_CONFIG) > sizeof(lchan->mr_bts_lv) - 1) { LOGP(DRSL, LOGL_ERROR, "Error parsing MultiRate conf IE\n"); return rsl_tx_error_report(msg->trx, RSL_ERR_IE_CONTENT); } - memcpy(&lchan->mr_conf, TLVP_VAL(&tp, RSL_IE_MR_CONFIG), - TLVP_LEN(&tp, RSL_IE_MR_CONFIG)); + memcpy(lchan->mr_bts_lv, TLVP_VAL(&tp, RSL_IE_MR_CONFIG) - 1, + TLVP_LEN(&tp, RSL_IE_MR_CONFIG) + 1); amr_parse_mr_conf(&lchan->tch.amr_mr, TLVP_VAL(&tp, RSL_IE_MR_CONFIG), TLVP_LEN(&tp, RSL_IE_MR_CONFIG)); amr_log_mr_conf(DRTP, LOGL_DEBUG, gsm_lchan_name(lchan), -- cgit v1.2.3 From acc71ffb4b61b3354bbb2fa14981e4e6a46946e6 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Tue, 5 Feb 2013 11:45:28 +0100 Subject: TRX: Introduce osmobts-trx, a layer 1 implementation for OpenBTS tranceivers The code is quite complete, TCH and PDCH channels are not yet tested. --- src/common/logging.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/common') diff --git a/src/common/logging.c b/src/common/logging.c index 1e071dbb..b117ee04 100644 --- a/src/common/logging.c +++ b/src/common/logging.c @@ -107,6 +107,12 @@ static struct log_info_cat bts_log_info_cat[] = { .color = "\033[0;37m", .enabled = 1, .loglevel = LOGL_NOTICE, }, + [DTRX] = { + .name = "DTRX", + .description = "TRX interface", + .color = "\033[1;33m", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, #if 0 [DNS] = { .name = "DNS", -- cgit v1.2.3 From 7a0d11dd68528d96afff61083c3cf90a50af11bb Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Tue, 5 Feb 2013 16:47:57 +0100 Subject: ABIS: Introduce bts_model_abis_close to indicate ABIS link failure. sysmocom-bts model shuts down on link loss, but other models may not want this, so shutdown is moved tor bts_model_abis_close of osmo-bts-sysmo. --- src/common/abis.c | 3 ++- src/common/bts.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/abis.c b/src/common/abis.c index 3b9bcdd2..3b8a7af1 100644 --- a/src/common/abis.c +++ b/src/common/abis.c @@ -47,6 +47,7 @@ #include #include #include +#include static struct gsm_bts *g_bts; @@ -114,7 +115,7 @@ static void sign_link_down(struct e1inp_line *line) e1inp_sign_link_destroy(g_bts->oml_link); g_bts->oml_link = NULL; - bts_shutdown(g_bts, "Abis close"); + bts_model_abis_close(g_bts); } diff --git a/src/common/bts.c b/src/common/bts.c index 77302e2f..3fa2bddc 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -242,6 +242,8 @@ int trx_link_estab(struct gsm_bts_trx *trx) if (link) rsl_tx_rf_res(trx); + else + bts_model_trx_deact_rf(trx); return 0; } -- cgit v1.2.3 From 219ece83a3ffe7fa2bd58943cddb47a3eacc2fab Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Sun, 24 Feb 2013 11:09:19 +0100 Subject: TRX: Implementation of MS power and timing advance loops --- src/common/logging.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/common') diff --git a/src/common/logging.c b/src/common/logging.c index b117ee04..5ce9b8b6 100644 --- a/src/common/logging.c +++ b/src/common/logging.c @@ -113,6 +113,12 @@ static struct log_info_cat bts_log_info_cat[] = { .color = "\033[1;33m", .enabled = 1, .loglevel = LOGL_NOTICE, }, + [DLOOP] = { + .name = "DLOOP", + .description = "Control loops", + .color = "\033[0;34m", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, #if 0 [DNS] = { .name = "DNS", -- cgit v1.2.3 From 5e2341411f25f4faa66ff9b4506e77d897b97daf Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Sat, 16 Mar 2013 16:46:13 +0100 Subject: Get RSSI from received uplink data and send to PCU --- src/common/pcu_sock.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/common') diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index a4ca25f1..577cfcfa 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -330,6 +330,7 @@ int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, data_ind = &pcu_prim->u.data_ind; data_ind->sapi = (is_ptcch) ? PCU_IF_SAPI_PTCCH : PCU_IF_SAPI_PDTCH; + data_ind->rssi = rssi; data_ind->fn = fn; data_ind->arfcn = arfcn; data_ind->trx_nr = ts->trx->nr; -- cgit v1.2.3 From c2ee307fd42975b63317e9d4944e5822286cc69b Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Sun, 7 Apr 2013 13:11:50 +0200 Subject: Allow one or more TRX to configure via VTY --- src/common/vty.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/common') diff --git a/src/common/vty.c b/src/common/vty.c index e3fd57df..bca839bb 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -140,8 +140,9 @@ static struct cmd_node trx_node = { 1, }; +static char cfg_bts_trx_cmd_string[16]; DEFUN(cfg_bts_trx, cfg_bts_trx_cmd, - "trx <0-0>", + cfg_bts_trx_cmd_string, "Select a TRX to configure\n" "TRX number\n") { int trx_nr = atoi(argv[0]); @@ -762,7 +763,7 @@ DEFUN(no_bts_t_t_l_loopback, return CMD_SUCCESS; } -int bts_vty_init(struct gsm_bts *bts, const struct log_info *cat) +int bts_vty_init(struct gsm_bts *bts, int trx_num, const struct log_info *cat) { cfg_trx_gsmtap_sapi_cmd.string = vty_cmd_string_from_valstr(bts, gsmtap_sapi_names, "gsmtap-sapi (", @@ -802,6 +803,7 @@ int bts_vty_init(struct gsm_bts *bts, const struct log_info *cat) install_element(BTS_NODE, &cfg_trx_no_gsmtap_sapi_cmd); /* add and link to TRX config node */ + sprintf(cfg_bts_trx_cmd_string, "trx <0-%d>", trx_num - 1); install_element(BTS_NODE, &cfg_bts_trx_cmd); install_node(&trx_node, config_write_dummy); install_default(TRX_NODE); -- cgit v1.2.3 From 3caf3b7c45258278b4aeebd992e801d42b10759d Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Tue, 2 Jul 2013 11:04:11 +0200 Subject: TRX: Fixup ciphering state names after rebasing --- src/common/l1sap.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/common') diff --git a/src/common/l1sap.c b/src/common/l1sap.c index b568cf01..d5dd8a60 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -96,6 +96,7 @@ static int check_for_ciph_cmd(struct msgb *msg, struct gsm_lchan *lchan, /* only do this if we are in the right state */ switch (lchan->ciph_state) { case LCHAN_CIPH_NONE: + case LCHAN_CIPH_RX_REQ: break; default: return 0; -- cgit v1.2.3 From b2482a8574a3a7ce4e628237f411ea0a4cd25f1b Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Fri, 23 Aug 2013 21:58:29 +0200 Subject: Allow TRX 0..254 at VTY, even if less TRX are available Instead of limiting the number of TRX at VTY to the actual number of supported TRX, VTY allows to configure any possible number of TRX. If a TRX is configured, which is not supported by BTS model, an error message is returned, which states that the given TRX is not supported. --- src/common/vty.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/common') diff --git a/src/common/vty.c b/src/common/vty.c index bca839bb..0d52dd76 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -140,9 +140,8 @@ static struct cmd_node trx_node = { 1, }; -static char cfg_bts_trx_cmd_string[16]; DEFUN(cfg_bts_trx, cfg_bts_trx_cmd, - cfg_bts_trx_cmd_string, + "trx <0-254>", "Select a TRX to configure\n" "TRX number\n") { int trx_nr = atoi(argv[0]); @@ -151,7 +150,8 @@ DEFUN(cfg_bts_trx, cfg_bts_trx_cmd, trx = gsm_bts_trx_num(bts, trx_nr); if (!trx) { - vty_out(vty, "Unknown TRX %u%s", trx_nr, VTY_NEWLINE); + vty_out(vty, "Unknown TRX %u. Aavialable TRX are: 0..%d%s", + trx_nr, bts->num_trx - 1, VTY_NEWLINE); return CMD_WARNING; } @@ -763,7 +763,7 @@ DEFUN(no_bts_t_t_l_loopback, return CMD_SUCCESS; } -int bts_vty_init(struct gsm_bts *bts, int trx_num, const struct log_info *cat) +int bts_vty_init(struct gsm_bts *bts, const struct log_info *cat) { cfg_trx_gsmtap_sapi_cmd.string = vty_cmd_string_from_valstr(bts, gsmtap_sapi_names, "gsmtap-sapi (", @@ -803,7 +803,6 @@ int bts_vty_init(struct gsm_bts *bts, int trx_num, const struct log_info *cat) install_element(BTS_NODE, &cfg_trx_no_gsmtap_sapi_cmd); /* add and link to TRX config node */ - sprintf(cfg_bts_trx_cmd_string, "trx <0-%d>", trx_num - 1); install_element(BTS_NODE, &cfg_bts_trx_cmd); install_node(&trx_node, config_write_dummy); install_default(TRX_NODE); -- cgit v1.2.3