aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Diniz <rafael@riseup.net>2020-04-18 09:17:59 -0300
committerRafael Diniz <rafael@riseup.net>2020-04-18 10:02:29 -0300
commit03f462f78ab042be96955de3355ec781aca3096c (patch)
treebee0daed3a7bd72ee651ba25ce4ee9db7e89d88a
parenta02d121222744f923e70e7cd337d4c3c85b5656f (diff)
parent1d65146b6a8738d7eed6334757a83ee3baa17b31 (diff)
Merge branch 'rafael2k/litecell15_missing_features' of ssh://gerrit.osmocom.org:29418/osmo-bts into rafael2k/litecell15_missing_features
-rw-r--r--src/osmo-bts-litecell15/l1_if.c4
-rw-r--r--src/osmo-bts-litecell15/lc15bts.c16
-rw-r--r--src/osmo-bts-litecell15/lc15bts_vty.c8
-rw-r--r--src/osmo-bts-litecell15/oml.c65
4 files changed, 54 insertions, 39 deletions
diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index 6a8cb3cc..86bdcd6b 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -1311,8 +1311,10 @@ int l1if_activate_rf(struct lc15l1_hdl *hdl, int on)
/* maximum cell size in quarter-bits, 90 == 12.456 km */
sysp->u.activateRfReq.u8MaxCellSize = pinst->u.lc15.max_cell_size;
+#if LITECELL15_API_VERSION >= LITECELL15_API(2,1,7)
/* auto tx power adjustment mode 0:none, 1: automatic*/
sysp->u.activateRfReq.u8EnAutoPowerAdjust = pinst->u.lc15.tx_pwr_adj_mode;
+#endif
} else {
sysp->id = Litecell15_PrimId_DeactivateRfReq;
@@ -1682,6 +1684,7 @@ int bts_model_phy_link_open(struct phy_link *plink)
if (!pinst->u.lc15.dsp_alive_period)
pinst->u.lc15.dsp_alive_period = LC15_BTS_DSP_ALIVE_TMR_DEFAULT;
+#if LITECELL15_API_VERSION >= LITECELL15_API(2,1,7)
if (!pinst->u.lc15.tx_pwr_adj_mode)
pinst->u.lc15.tx_pwr_adj_mode = LC15_BTS_TX_PWR_ADJ_DEFAULT;
@@ -1690,6 +1693,7 @@ int bts_model_phy_link_open(struct phy_link *plink)
if (!pinst->u.lc15.tx_c0_idle_pwr_red)
pinst->u.lc15.tx_c0_idle_pwr_red = LC15_BTS_TX_C0_IDLE_RED_PWR_DEFAULT;
+#endif
struct lc15l1_hdl *fl1h = pinst->u.lc15.hdl;
fl1h->dsp_trace_f = dsp_trace;
diff --git a/src/osmo-bts-litecell15/lc15bts.c b/src/osmo-bts-litecell15/lc15bts.c
index 773e6d36..0d096dcd 100644
--- a/src/osmo-bts-litecell15/lc15bts.c
+++ b/src/osmo-bts-litecell15/lc15bts.c
@@ -121,11 +121,11 @@ enum l1prim_type lc15bts_get_sysprim_type(Litecell15_PrimId_t id)
case Litecell15_PrimId_MuteRfCnf: return L1P_T_CONF;
case Litecell15_PrimId_SetRxAttenReq: return L1P_T_REQ;
case Litecell15_PrimId_SetRxAttenCnf: return L1P_T_CONF;
- case Litecell15_PrimId_IsAliveReq: return L1P_T_REQ;
- case Litecell15_PrimId_IsAliveCnf: return L1P_T_CONF;
-#if LITECELL15_API_VERSION >= LITECELL15_API(2,1,7)
case Litecell15_PrimId_SetMaxCellSizeReq: return L1P_T_REQ;
case Litecell15_PrimId_SetMaxCellSizeCnf: return L1P_T_CONF;
+#if LITECELL15_API_VERSION >= LITECELL15_API(2,1,7)
+ case Litecell15_PrimId_IsAliveReq: return L1P_T_REQ;
+ case Litecell15_PrimId_IsAliveCnf: return L1P_T_CONF;
case Litecell15_PrimId_SetC0IdleSlotPowerReductionReq: return L1P_T_REQ;
case Litecell15_PrimId_SetC0IdleSlotPowerReductionCnf: return L1P_T_CONF;
#endif
@@ -150,11 +150,11 @@ const struct value_string lc15bts_sysprim_names[Litecell15_PrimId_NUM+1] = {
{ Litecell15_PrimId_MuteRfCnf, "MUTE-RF.cnf" },
{ Litecell15_PrimId_SetRxAttenReq, "SET-RX-ATTEN.req" },
{ Litecell15_PrimId_SetRxAttenCnf, "SET-RX-ATTEN-CNF.cnf" },
- { Litecell15_PrimId_IsAliveReq, "IS-ALIVE.req" },
- { Litecell15_PrimId_IsAliveCnf, "IS-ALIVE-CNF.cnf" },
-#if LITECELL15_API_VERSION >= LITECELL15_API(2,1,7)
{ Litecell15_PrimId_SetMaxCellSizeReq, "SET-MAX-CELL-SIZE.req" },
{ Litecell15_PrimId_SetMaxCellSizeCnf, "SET-MAX-CELL-SIZE.cnf" },
+#if LITECELL15_API_VERSION >= LITECELL15_API(2,1,7)
+ { Litecell15_PrimId_IsAliveReq, "IS-ALIVE.req" },
+ { Litecell15_PrimId_IsAliveCnf, "IS-ALIVE-CNF.cnf" },
{ Litecell15_PrimId_SetC0IdleSlotPowerReductionReq, "SET-C0-IDLE-PWR-RED.req" },
{ Litecell15_PrimId_SetC0IdleSlotPowerReductionCnf, "SET-C0-IDLE-PWR-RED.cnf" },
#endif
@@ -171,9 +171,9 @@ Litecell15_PrimId_t lc15bts_get_sysprim_conf(Litecell15_PrimId_t id)
case Litecell15_PrimId_SetCalibTblReq: return Litecell15_PrimId_SetCalibTblCnf;
case Litecell15_PrimId_MuteRfReq: return Litecell15_PrimId_MuteRfCnf;
case Litecell15_PrimId_SetRxAttenReq: return Litecell15_PrimId_SetRxAttenCnf;
- case Litecell15_PrimId_IsAliveReq: return Litecell15_PrimId_IsAliveCnf;
-#if LITECELL15_API_VERSION >= LITECELL15_API(2,1,7)
case Litecell15_PrimId_SetMaxCellSizeReq: return Litecell15_PrimId_SetMaxCellSizeCnf;
+#if LITECELL15_API_VERSION >= LITECELL15_API(2,1,7)
+ case Litecell15_PrimId_IsAliveReq: return Litecell15_PrimId_IsAliveCnf;
case Litecell15_PrimId_SetC0IdleSlotPowerReductionReq: return Litecell15_PrimId_SetC0IdleSlotPowerReductionCnf;
#endif
default: return -1; // Weak
diff --git a/src/osmo-bts-litecell15/lc15bts_vty.c b/src/osmo-bts-litecell15/lc15bts_vty.c
index e895ab83..f9c75977 100644
--- a/src/osmo-bts-litecell15/lc15bts_vty.c
+++ b/src/osmo-bts-litecell15/lc15bts_vty.c
@@ -421,6 +421,7 @@ DEFUN(cfg_bts_led_mode, cfg_bts_led_mode_cmd,
return CMD_SUCCESS;
}
+#if LITECELL15_API_VERSION >= LITECELL15_API(2,1,7)
DEFUN(cfg_phy_dsp_alive_timer, cfg_phy_dsp_alive_timer_cmd,
"dsp-alive-period <0-60>",
"Set DSP alive timer period in second\n")
@@ -487,6 +488,7 @@ DEFUN(cfg_phy_c0_idle_red_pwr, cfg_phy_c0_idle_red_pwr_cmd,
pinst->u.lc15.tx_c0_idle_pwr_red = (uint8_t)val;
return CMD_SUCCESS;
}
+#endif
DEFUN(cfg_bts_rtp_drift_threshold, cfg_bts_rtp_drift_threshold_cmd,
"rtp-drift-threshold <0-10000>",
@@ -546,6 +548,7 @@ void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst
vty_out(vty, " pedestal-mode %s%s",
get_value_string(lc15_pedestal_mode_strs, pinst->u.lc15.pedestal_mode) , VTY_NEWLINE);
+#if LITECELL15_API_VERSION >= LITECELL15_API(2,1,7)
vty_out(vty, " dsp-alive-period %d%s",
pinst->u.lc15.dsp_alive_period, VTY_NEWLINE);
@@ -557,7 +560,7 @@ void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst
vty_out(vty, " c0-idle-red-pwr %d%s",
pinst->u.lc15.tx_c0_idle_pwr_red, VTY_NEWLINE);
-
+#endif
}
int bts_model_vty_init(struct gsm_bts *bts)
@@ -622,11 +625,12 @@ int bts_model_vty_init(struct gsm_bts *bts)
install_element(PHY_INST_NODE, &cfg_phy_diversity_mode_cmd);
install_element(PHY_INST_NODE, &cfg_phy_pedestal_mode_cmd);
install_element(PHY_INST_NODE, &cfg_phy_max_cell_size_cmd);
+#if LITECELL15_API_VERSION >= LITECELL15_API(2,1,7)
install_element(PHY_INST_NODE, &cfg_phy_dsp_alive_timer_cmd);
install_element(PHY_INST_NODE, &cfg_phy_auto_tx_pwr_adj_cmd);
install_element(PHY_INST_NODE, &cfg_phy_tx_red_pwr_8psk_cmd);
install_element(PHY_INST_NODE, &cfg_phy_c0_idle_red_pwr_cmd);
-
+#endif
return 0;
}
diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c
index a519b382..f6cbb626 100644
--- a/src/osmo-bts-litecell15/oml.c
+++ b/src/osmo-bts-litecell15/oml.c
@@ -1179,7 +1179,9 @@ const struct value_string lc15bts_l1cfgt_names[] = {
{ GsmL1_ConfigParamId_SetTxPowerLevel, "Set Tx power level" },
{ GsmL1_ConfigParamId_SetLogChParams, "Set logical channel params" },
{ GsmL1_ConfigParamId_SetCipheringParams,"Configure ciphering params" },
+#if LITECELL15_API_VERSION >= LITECELL15_API(2,1,7)
{ GsmL1_ConfigParamId_Set8pskPowerReduction, "Set 8PSK Tx power reduction" },
+#endif
{ 0, NULL }
};
@@ -1237,6 +1239,23 @@ static int chmod_txpower_compl_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg,
return 0;
}
+static int chmod_max_cell_size_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp,
+ void *data)
+{
+ Litecell15_Prim_t *sysp = msgb_sysprim(resp);
+ Litecell15_SetMaxCellSizeCnf_t *sac = &sysp->u.setMaxCellSizeCnf;
+
+ LOGP(DL1C, LOGL_INFO, "%s Rx SYS prim %s -> %s\n",
+ gsm_trx_name(trx),
+ get_value_string(lc15bts_sysprim_names, sysp->id),
+ get_value_string(lc15bts_l1status_names, sac->status));
+
+ msgb_free(resp);
+
+ return 0;
+}
+
+#if LITECELL15_API_VERSION >= LITECELL15_API(2,1,7)
static int chmod_txpower_backoff_8psk_compl_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg,
void *data)
{
@@ -1255,22 +1274,6 @@ static int chmod_txpower_backoff_8psk_compl_cb(struct gsm_bts_trx *trx, struct m
return 0;
}
-static int chmod_max_cell_size_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp,
- void *data)
-{
- Litecell15_Prim_t *sysp = msgb_sysprim(resp);
- Litecell15_SetMaxCellSizeCnf_t *sac = &sysp->u.setMaxCellSizeCnf;
-
- LOGP(DL1C, LOGL_INFO, "%s Rx SYS prim %s -> %s\n",
- gsm_trx_name(trx),
- get_value_string(lc15bts_sysprim_names, sysp->id),
- get_value_string(lc15bts_l1status_names, sac->status));
-
- msgb_free(resp);
-
- return 0;
-}
-
static int chmod_c0_idle_pwr_red_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp,
void *data)
{
@@ -1286,6 +1289,7 @@ static int chmod_c0_idle_pwr_red_compl_cb(struct gsm_bts_trx *trx, struct msgb *
return 0;
}
+#endif
static int chmod_modif_compl_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg,
void *data)
@@ -1428,18 +1432,6 @@ int l1if_set_txpower(struct lc15l1_hdl *fl1h, float tx_power)
return l1if_gsm_req_compl(fl1h, msg, chmod_txpower_compl_cb, NULL);
}
-int l1if_set_txpower_backoff_8psk(struct lc15l1_hdl *fl1h, uint8_t backoff)
-{
- struct msgb *msg = l1p_msgb_alloc();
- GsmL1_MphConfigReq_t *conf_req;
-
- conf_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h, 0);
- conf_req->cfgParamId = GsmL1_ConfigParamId_Set8pskPowerReduction;
- conf_req->cfgParams.set8pskPowerReduction.u8PowerReduction = backoff;
-
- return l1if_gsm_req_compl(fl1h, msg, chmod_txpower_backoff_8psk_compl_cb, NULL);
-}
-
int l1if_set_max_cell_size(struct lc15l1_hdl *fl1h, uint8_t cell_size)
{
struct msgb *msg = sysp_msgb_alloc();
@@ -1455,6 +1447,19 @@ int l1if_set_max_cell_size(struct lc15l1_hdl *fl1h, uint8_t cell_size)
}
+#if LITECELL15_API_VERSION >= LITECELL15_API(2,1,7)
+int l1if_set_txpower_backoff_8psk(struct lc15l1_hdl *fl1h, uint8_t backoff)
+{
+ struct msgb *msg = l1p_msgb_alloc();
+ GsmL1_MphConfigReq_t *conf_req;
+
+ conf_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h, 0);
+ conf_req->cfgParamId = GsmL1_ConfigParamId_Set8pskPowerReduction;
+ conf_req->cfgParams.set8pskPowerReduction.u8PowerReduction = backoff;
+
+ return l1if_gsm_req_compl(fl1h, msg, chmod_txpower_backoff_8psk_compl_cb, NULL);
+}
+
int l1if_set_txpower_c0_idle_pwr_red(struct lc15l1_hdl *fl1h, uint8_t red)
{
struct msgb *msg = sysp_msgb_alloc();
@@ -1468,6 +1473,7 @@ int l1if_set_txpower_c0_idle_pwr_red(struct lc15l1_hdl *fl1h, uint8_t red)
return l1if_req_compl(fl1h, msg, chmod_c0_idle_pwr_red_compl_cb, NULL);
}
+#endif
const enum GsmL1_CipherId_t rsl2l1_ciph[] = {
[0] = GsmL1_CipherId_A50,
@@ -1836,7 +1842,7 @@ int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg,
/* Did we go through MphInit yet? If yes fire and forget */
if (fl1h->hLayer1) {
power_ramp_start(trx, get_p_target_mdBm(trx, 0), 0);
-
+#if LITECELL15_API_VERSION >= LITECELL15_API(2,1,7)
if (fl1h->phy_inst->u.lc15.tx_pwr_red_8psk != trx->max_power_backoff_8psk) {
/* update current Tx power backoff for 8-PSK */
fl1h->phy_inst->u.lc15.tx_pwr_red_8psk = trx->max_power_backoff_8psk;
@@ -1850,6 +1856,7 @@ int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg,
/* instruct L1 to apply C0 idle slot power reduction */
l1if_set_txpower_c0_idle_pwr_red(fl1h, fl1h->phy_inst->u.lc15.tx_c0_idle_pwr_red);
}
+#endif
}
}
/* FIXME: we actually need to send a ACK or NACK for the OML message */