aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/abis.c4
-rw-r--r--src/common/amr.c23
-rw-r--r--src/common/bts.c2
-rw-r--r--src/common/l1sap.c10
-rw-r--r--src/common/logging.c12
-rw-r--r--src/common/oml.c19
-rw-r--r--src/common/pcu_sock.c1
-rw-r--r--src/common/rsl.c12
-rw-r--r--src/common/vty.c5
9 files changed, 64 insertions, 24 deletions
diff --git a/src/common/abis.c b/src/common/abis.c
index 9eb49a08..3b8a7af1 100644
--- a/src/common/abis.c
+++ b/src/common/abis.c
@@ -47,6 +47,7 @@
#include <osmo-bts/bts.h>
#include <osmo-bts/rsl.h>
#include <osmo-bts/oml.h>
+#include <osmo-bts/bts_model.h>
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);
}
@@ -203,7 +204,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);
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/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;
}
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 1cb752e3..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;
@@ -278,11 +279,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 +298,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 +354,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);
diff --git a/src/common/logging.c b/src/common/logging.c
index 1e071dbb..5ce9b8b6 100644
--- a/src/common/logging.c
+++ b/src/common/logging.c
@@ -107,6 +107,18 @@ 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,
+ },
+ [DLOOP] = {
+ .name = "DLOOP",
+ .description = "Control loops",
+ .color = "\033[0;34m",
+ .enabled = 1, .loglevel = LOGL_NOTICE,
+ },
#if 0
[DNS] = {
.name = "DNS",
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);
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;
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),
diff --git a/src/common/vty.c b/src/common/vty.c
index e3fd57df..0d52dd76 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -141,7 +141,7 @@ static struct cmd_node trx_node = {
};
DEFUN(cfg_bts_trx, cfg_bts_trx_cmd,
- "trx <0-0>",
+ "trx <0-254>",
"Select a TRX to configure\n" "TRX number\n")
{
int trx_nr = atoi(argv[0]);
@@ -150,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;
}