aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMinh-Quang Nguyen <minh-quang.nguyen@nutaq.com>2016-09-01 09:35:20 -0400
committerMinh-Quang Nguyen <minh-quang.nguyen@nutaq.com>2016-09-01 09:38:33 -0400
commitda30a797762a0113b75bcc6008d1b6699eb1278f (patch)
treeca9658f81cdfa2892d8d6e2de653e69075160680
parenta9cc822d9657101532683041846e5d17134c1aff (diff)
LC15: Implementation of LC15 specific features
-rw-r--r--include/osmo-bts/gsm_data.h6
-rw-r--r--include/osmo-bts/phy_link.h6
-rw-r--r--src/common/Makefile.am4
-rw-r--r--src/osmo-bts-litecell15/Makefile.am2
-rw-r--r--src/osmo-bts-litecell15/l1_if.c114
-rw-r--r--src/osmo-bts-litecell15/l1_if.h6
-rw-r--r--src/osmo-bts-litecell15/lc15bts.c5
-rw-r--r--src/osmo-bts-litecell15/lc15bts.h30
-rw-r--r--src/osmo-bts-litecell15/lc15bts_vty.c178
-rw-r--r--src/osmo-bts-litecell15/main.c2
10 files changed, 346 insertions, 7 deletions
diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index f1c96012..447d8d25 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -111,6 +111,12 @@ struct gsm_bts_role_bts {
struct {
char *sock_path;
} pcu;
+#ifdef ENABLE_LC15BTS
+ /* specific to LC15 BTS */
+ struct {
+ uint8_t led_ctrl_mode; /* 0: control by BTS, 1: not control by BTS */
+ } lc15;
+#endif
};
enum lchan_ciph_state {
diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h
index 82e73c8c..f40d487d 100644
--- a/include/osmo-bts/phy_link.h
+++ b/include/osmo-bts/phy_link.h
@@ -108,6 +108,12 @@ struct phy_instance {
int minTxPower;
int maxTxPower;
struct lc15l1_hdl *hdl;
+ uint8_t max_cell_size; /* 0:166 qbits*/
+ uint8_t diversity_mode; /* 0: SISO A, 1: SISO B, 2: MRC */
+ uint8_t pedestal_mode; /* 0: unused TS is OFF, 1: unused TS is in minimum Tx power */
+ uint8_t dsp_alive_period; /* DSP alive timer period */
+ uint8_t tx_pwr_adj_mode; /* 0: no auto adjust power, 1: auto adjust power using RMS detector */
+ uint8_t tx_pwr_red_8psk; /* 8-PSK maximum Tx power reduction level in dB */
} lc15;
} u;
};
diff --git a/src/common/Makefile.am b/src/common/Makefile.am
index fbb65729..e7ecebbd 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -2,6 +2,10 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR)
AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOTRAU_CFLAGS)
LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOTRAU_LIBS)
+if ENABLE_LC15BTS
+AM_CFLAGS += -DENABLE_LC15BTS
+endif
+
noinst_LIBRARIES = libbts.a libl1sched.a
libbts_a_SOURCES = gsm_data_shared.c sysinfo.c logging.c abis.c oml.c bts.c \
rsl.c vty.c paging.c measurement.c amr.c lchan.c \
diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am
index 3026e969..ea717caf 100644
--- a/src/osmo-bts-litecell15/Makefile.am
+++ b/src/osmo-bts-litecell15/Makefile.am
@@ -4,6 +4,8 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -I$(LI
AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS)
COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS)
+AM_CFLAGS += -DENABLE_LC15BTS
+
EXTRA_DIST = misc/lc15bts_mgr.h misc/lc15bts_misc.h misc/lc15bts_par.h \
misc/lc15bts_temp.h misc/lc15bts_power.h misc/lc15bts_clock.h \
misc/lc15bts_bid.h misc/lc15bts_nl.h \
diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index 3672b8f6..e0000a2b 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -1115,6 +1115,8 @@ static int activate_rf_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp,
GsmL1_Status_t status;
int on = 0;
unsigned int i;
+ struct gsm_bts *bts = trx->bts;
+ struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
if (sysp->id == Litecell15_PrimId_ActivateRfCnf)
on = 1;
@@ -1133,8 +1135,10 @@ static int activate_rf_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp,
LOGP(DL1C, LOGL_FATAL, "RF-ACT.conf with status %s\n",
get_value_string(lc15bts_l1status_names, status));
bts_shutdown(trx->bts, "RF-ACT failure");
- } else
- bts_update_status(BTS_STATUS_RF_ACTIVE, 1);
+ } else {
+ if(btsb->lc15.led_ctrl_mode == LC15_LED_CONTROL_BTS)
+ bts_update_status(BTS_STATUS_RF_ACTIVE, 1);
+ }
/* signal availability */
oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OK);
@@ -1145,7 +1149,8 @@ static int activate_rf_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp,
for (i = 0; i < ARRAY_SIZE(trx->ts); i++)
oml_mo_state_chg(&trx->ts[i].mo, NM_OPSTATE_DISABLED, NM_AVSTATE_DEPENDENCY);
} else {
- bts_update_status(BTS_STATUS_RF_ACTIVE, 0);
+ if(btsb->lc15.led_ctrl_mode == LC15_LED_CONTROL_BTS)
+ bts_update_status(BTS_STATUS_RF_ACTIVE, 0);
oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OFF_LINE);
oml_mo_state_chg(&trx->bb_transc.mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OFF_LINE);
}
@@ -1160,17 +1165,27 @@ int l1if_activate_rf(struct lc15l1_hdl *hdl, int on)
{
struct msgb *msg = sysp_msgb_alloc();
Litecell15_Prim_t *sysp = msgb_sysprim(msg);
+ struct phy_instance *pinst = hdl->phy_inst;
if (on) {
sysp->id = Litecell15_PrimId_ActivateRfReq;
sysp->u.activateRfReq.msgq.u8UseTchMsgq = 0;
sysp->u.activateRfReq.msgq.u8UsePdtchMsgq = pcu_direct;
- sysp->u.activateRfReq.u8UnusedTsMode = 0;
+ sysp->u.activateRfReq.u8UnusedTsMode = pinst->u.lc15.pedestal_mode;
sysp->u.activateRfReq.u8McCorrMode = 0;
+ /* diversity mode: 0: SISO-A, 1: SISO-B, 2: MRC */
+ sysp->u.activateRfReq.u8DiversityMode = pinst->u.lc15.diversity_mode;
+
/* maximum cell size in quarter-bits, 90 == 12.456 km */
- sysp->u.activateRfReq.u8MaxCellSize = 90;
+ sysp->u.activateRfReq.u8MaxCellSize = pinst->u.lc15.max_cell_size;
+
+ /* auto tx power adjustment mode 0:none, 1: automatic*/
+ sysp->u.activateRfReq.autoPowerAdjust.u8EnAutoPowerAdjust = pinst->u.lc15.tx_pwr_adj_mode;
+
+ /* PSK modulation scheme maximum power level */
+ sysp->u.activateRfReq.autoPowerAdjust.u8PowerReduction8Psk = pinst->u.lc15.tx_pwr_red_8psk;
} else {
sysp->id = Litecell15_PrimId_DeactivateRfReq;
}
@@ -1220,10 +1235,13 @@ static int mute_rf_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp,
oml_mo_rf_lock_chg(&trx->mo, fl1h->last_rf_mute, 0);
} else {
int i;
+ struct gsm_bts *bts = trx->bts;
+ struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
LOGP(DL1C, LOGL_INFO, "Rx RF-MUTE.conf with status=%s\n",
get_value_string(lc15bts_l1status_names, status));
- bts_update_status(BTS_STATUS_RF_MUTE, fl1h->last_rf_mute[0]);
+ if(btsb->lc15.led_ctrl_mode == LC15_LED_CONTROL_BTS)
+ bts_update_status(BTS_STATUS_RF_MUTE, fl1h->last_rf_mute[0]);
oml_mo_rf_lock_chg(&trx->mo, fl1h->last_rf_mute, 1);
osmo_static_assert(
@@ -1449,6 +1467,53 @@ int l1if_close(struct lc15l1_hdl *fl1h)
return 0;
}
+static void dsp_alive_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp, void *data)
+{
+ Litecell15_Prim_t *sysp = msgb_sysprim(resp);
+ Litecell15_IsAliveCnf_t *sac = &sysp->u.IsAliveCnf;
+ struct lc15l1_hdl *fl1h = trx_lc15l1_hdl(trx);
+
+ fl1h->hw_alive.dsp_alive_cnt++;
+ LOGP(DL1C, LOGL_NOTICE, "Rx SYS prim %s, status=%d (%d)\n",
+ get_value_string(lc15bts_sysprim_names, sysp->id), sac->status, trx->nr);
+
+ msgb_free(resp);
+}
+
+static int dsp_alive_timer_cb(void *data)
+{
+ struct lc15l1_hdl *fl1h = data;
+ struct gsm_bts_trx *trx = fl1h->phy_inst->trx;
+ struct msgb *msg = sysp_msgb_alloc();
+ int rc;
+
+ Litecell15_Prim_t *sys_prim = msgb_sysprim(msg);
+ sys_prim->id = Litecell15_PrimId_IsAliveReq;
+
+ if (fl1h->hw_alive.dsp_alive_cnt == 0) {
+
+ LOGP(DL1C, LOGL_ERROR, "Timeout waiting for SYS prim %s primitive (%d)\n",
+ get_value_string(lc15bts_sysprim_names, sys_prim->id + 1), trx->nr);
+
+ exit(23);
+ }
+
+ LOGP(DL1C, LOGL_NOTICE, "Tx SYS prim %s (%d)\n",
+ get_value_string(lc15bts_sysprim_names, sys_prim->id), trx->nr);
+
+ rc = l1if_req_compl(fl1h, msg, dsp_alive_compl_cb, NULL);
+ if (rc < 0) {
+ LOGP(DL1C, LOGL_FATAL, "Failed to send %s primitive\n", get_value_string(lc15bts_sysprim_names, sys_prim->id));
+ return -EIO;
+ }
+
+ /* restart timer */
+ fl1h->hw_alive.dsp_alive_cnt = 0;
+ osmo_timer_schedule(&fl1h->hw_alive.dsp_alive_timer, fl1h->hw_alive.dsp_alive_period, 0);
+
+ return 0;
+}
+
int bts_model_phy_link_open(struct phy_link *plink)
{
struct phy_instance *pinst = phy_instance_by_num(plink, 0);
@@ -1468,6 +1533,24 @@ int bts_model_phy_link_open(struct phy_link *plink)
return -EIO;
}
+ /* Set default PHY parameters */
+ if (!pinst->u.lc15.max_cell_size)
+ pinst->u.lc15.max_cell_size = LC15_BTS_MAX_CELL_SIZE_DEFAULT;
+
+ if (!pinst->u.lc15.diversity_mode)
+ pinst->u.lc15.diversity_mode = LC15_BTS_DIVERSITY_MODE_DEFAULT;
+
+ if (!pinst->u.lc15.pedestal_mode)
+ pinst->u.lc15.pedestal_mode = LC15_BTS_PEDESTAL_MODE_DEFAULT;
+
+ if (!pinst->u.lc15.dsp_alive_period)
+ pinst->u.lc15.dsp_alive_period = LC15_BTS_DSP_ALIVE_TMR_DEFAULT;
+
+ if (!pinst->u.lc15.tx_pwr_adj_mode)
+ pinst->u.lc15.tx_pwr_adj_mode = LC15_BTS_TX_PWR_ADJ_DEFAULT;
+
+ if (!pinst->u.lc15.tx_pwr_red_8psk)
+ pinst->u.lc15.tx_pwr_red_8psk = LC15_BTS_TX_RED_PWR_8PSK_DEFAULT;
struct lc15l1_hdl *fl1h = pinst->u.lc15.hdl;
fl1h->dsp_trace_f = dsp_trace;
@@ -1476,6 +1559,25 @@ int bts_model_phy_link_open(struct phy_link *plink)
phy_link_state_set(plink, PHY_LINK_CONNECTED);
+ /* Send first IS_ALIVE primitive */
+ struct msgb *msg = sysp_msgb_alloc();
+ int rc;
+
+ Litecell15_Prim_t *sys_prim = msgb_sysprim(msg);
+ sys_prim->id = Litecell15_PrimId_IsAliveReq;
+
+ rc = l1if_req_compl(fl1h, msg, dsp_alive_compl_cb, NULL);
+ if (rc < 0) {
+ LOGP(DL1C, LOGL_FATAL, "Failed to send %s primitive\n", get_value_string(lc15bts_sysprim_names, sys_prim->id));
+ return -EIO;
+ }
+
+ /* initialize DSP heart beat alive timer */
+ fl1h->hw_alive.dsp_alive_timer.cb = dsp_alive_timer_cb;
+ fl1h->hw_alive.dsp_alive_timer.data = fl1h;
+ fl1h->hw_alive.dsp_alive_cnt = 0;
+ fl1h->hw_alive.dsp_alive_period = pinst->u.lc15.dsp_alive_period;
+ osmo_timer_schedule(&fl1h->hw_alive.dsp_alive_timer, fl1h->hw_alive.dsp_alive_period, 0);
return 0;
}
diff --git a/src/osmo-bts-litecell15/l1_if.h b/src/osmo-bts-litecell15/l1_if.h
index 2d136af9..8a7b737c 100644
--- a/src/osmo-bts-litecell15/l1_if.h
+++ b/src/osmo-bts-litecell15/l1_if.h
@@ -59,6 +59,12 @@ struct lc15l1_hdl {
struct calib_send_state st;
uint8_t last_rf_mute[8];
+
+ struct {
+ struct osmo_timer_list dsp_alive_timer;
+ unsigned int dsp_alive_cnt;
+ uint8_t dsp_alive_period;
+ } hw_alive;
};
#define msgb_l1prim(msg) ((GsmL1_Prim_t *)(msg)->l1h)
diff --git a/src/osmo-bts-litecell15/lc15bts.c b/src/osmo-bts-litecell15/lc15bts.c
index 172a7e45..778b9ef1 100644
--- a/src/osmo-bts-litecell15/lc15bts.c
+++ b/src/osmo-bts-litecell15/lc15bts.c
@@ -121,6 +121,8 @@ 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;
default: return L1P_T_INVALID;
}
}
@@ -142,6 +144,8 @@ 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" },
{ 0, NULL }
};
@@ -155,6 +159,7 @@ 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;
default: return -1; // Weak
}
}
diff --git a/src/osmo-bts-litecell15/lc15bts.h b/src/osmo-bts-litecell15/lc15bts.h
index 4c40db0f..39a81686 100644
--- a/src/osmo-bts-litecell15/lc15bts.h
+++ b/src/osmo-bts-litecell15/lc15bts.h
@@ -22,6 +22,27 @@ enum l1prim_type {
L1P_T_IND,
};
+enum lc15_diversity_mode{
+ LC15_DIVERSITY_SISO_A = 0,
+ LC15_DIVERSITY_SISO_B,
+ LC15_DIVERSITY_MRC,
+};
+
+enum lc15_pedestal_mode{
+ LC15_PEDESTAL_OFF = 0,
+ LC15_PEDESTAL_ON,
+};
+
+enum lc15_led_control_mode{
+ LC15_LED_CONTROL_BTS = 0,
+ LC15_LED_CONTROL_EXT,
+};
+
+enum lc15_auto_pwr_adjust_mode{
+ LC15_TX_PWR_ADJ_NONE = 0,
+ LC15_TX_PWR_ADJ_AUTO,
+};
+
enum l1prim_type lc15bts_get_l1prim_type(GsmL1_PrimId_t id);
const struct value_string lc15bts_l1prim_names[GsmL1_PrimId_NUM+1];
GsmL1_PrimId_t lc15bts_get_l1prim_conf(GsmL1_PrimId_t id);
@@ -61,4 +82,13 @@ enum pdch_cs {
const uint8_t pdch_msu_size[_NUM_PDCH_CS];
+/* LC15 default parameters */
+#define LC15_BTS_MAX_CELL_SIZE_DEFAULT 166 /* 166 qbits is default value */
+#define LC15_BTS_DIVERSITY_MODE_DEFAULT 0 /* SISO-A is default mode */
+#define LC15_BTS_PEDESTAL_MODE_DEFAULT 0 /* Unused TS is off by default */
+#define LC15_BTS_LED_CTRL_MODE_DEFAULT 0 /* LED is controlled by BTS by default */
+#define LC15_BTS_DSP_ALIVE_TMR_DEFAULT 5 /* Default DSP alive timer is 5 seconds */
+#define LC15_BTS_TX_PWR_ADJ_DEFAULT 0 /* Default Tx power auto adjustment is none */
+#define LC15_BTS_TX_RED_PWR_8PSK_DEFAULT 0 /* Default 8-PSK maximum power level is 0 dB */
+
#endif /* LC15BTS_H */
diff --git a/src/osmo-bts-litecell15/lc15bts_vty.c b/src/osmo-bts-litecell15/lc15bts_vty.c
index c5d404cc..7b0f79b7 100644
--- a/src/osmo-bts-litecell15/lc15bts_vty.c
+++ b/src/osmo-bts-litecell15/lc15bts_vty.c
@@ -65,6 +65,31 @@ extern int lchan_deactivate(struct gsm_lchan *lchan);
static struct gsm_bts *vty_bts;
+static const struct value_string lc15_diversity_mode_strs[] = {
+ { LC15_DIVERSITY_SISO_A, "siso-a" },
+ { LC15_DIVERSITY_SISO_B, "siso-b" },
+ { LC15_DIVERSITY_MRC, "mrc" },
+ { 0, NULL }
+};
+
+static const struct value_string lc15_pedestal_mode_strs[] = {
+ { LC15_PEDESTAL_OFF, "off" },
+ { LC15_PEDESTAL_ON, "on" },
+ { 0, NULL }
+};
+
+static const struct value_string lc15_led_mode_strs[] = {
+ { LC15_LED_CONTROL_BTS, "bts" },
+ { LC15_LED_CONTROL_EXT, "external" },
+ { 0, NULL }
+};
+
+static const struct value_string lc15_auto_adj_pwr_strs[] = {
+ { LC15_TX_PWR_ADJ_NONE, "none" },
+ { LC15_TX_PWR_ADJ_AUTO, "auto" },
+ { 0, NULL }
+};
+
/* configuration */
DEFUN(cfg_phy_cal_path, cfg_phy_cal_path_cmd,
@@ -321,8 +346,132 @@ DEFUN(cfg_trx_nominal_power, cfg_trx_nominal_power_cmd,
return CMD_SUCCESS;
}
+DEFUN(cfg_phy_max_cell_size, cfg_phy_max_cell_size_cmd,
+ "max-cell-size <0-166>",
+ "Set the maximum cell size in qbits\n")
+{
+ struct phy_instance *pinst = vty->index;
+ int cell_size = (uint8_t)atoi(argv[0]);
+
+ if (( cell_size > 166 ) || ( cell_size < 0 )) {
+ vty_out(vty, "Max cell size must be between 0 and 166 qbits (%d) %s",
+ cell_size, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ pinst->u.lc15.max_cell_size = (uint8_t)cell_size;
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_phy_diversity_mode, cfg_phy_diversity_mode_cmd,
+ "diversity-mode (siso-a|siso-b|mrc)",
+ "Set reception diversity mode \n"
+ "Reception diversity mode can be (siso-a, siso-b, mrc)\n")
+{
+ struct phy_instance *pinst = vty->index;
+ int val = get_string_value(lc15_diversity_mode_strs, argv[0]);
+
+ if((val < LC15_DIVERSITY_SISO_A) || (val > LC15_DIVERSITY_MRC)) {
+ vty_out(vty, "Invalid reception diversity mode %d%s", val, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ pinst->u.lc15.diversity_mode = (uint8_t)val;
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_phy_pedestal_mode, cfg_phy_pedestal_mode_cmd,
+ "pedestal-mode (on|off)",
+ "Set unused time-slot transmission in pedestal mode\n"
+ "Transmission pedestal mode can be (off, on)\n")
+{
+ struct phy_instance *pinst = vty->index;
+ int val = get_string_value(lc15_pedestal_mode_strs, argv[0]);
+
+ if((val < LC15_PEDESTAL_OFF) || (val > LC15_PEDESTAL_ON)) {
+ vty_out(vty, "Invalid unused time-slot transmission mode %d%s", val, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ pinst->u.lc15.pedestal_mode = (uint8_t)val;
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_bts_led_mode, cfg_bts_led_mode_cmd,
+ "led-control-mode (bts|external)",
+ "Set LED controlled by BTS or external software\n"
+ "LED can be controlled by (bts, external)\n")
+{
+ struct gsm_bts *bts = vty->index;
+ struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
+ int val = get_string_value(lc15_led_mode_strs, argv[0]);
+
+ if((val < LC15_LED_CONTROL_BTS) || (val > LC15_LED_CONTROL_EXT)) {
+ vty_out(vty, "Invalid LED control mode %d%s", val, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ btsb->lc15.led_ctrl_mode = (uint8_t)val;
+ return CMD_SUCCESS;
+}
+
+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")
+{
+ struct phy_instance *pinst = vty->index;
+ uint8_t period = (uint8_t)atoi(argv[0]);
+
+ if (( period > 60 ) || ( period < 0 )) {
+ vty_out(vty, "DSP heart beat alive timer period must be between 0 and 60 seconds (%d) %s",
+ period, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ pinst->u.lc15.dsp_alive_period = period;
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_phy_auto_tx_pwr_adj, cfg_phy_auto_tx_pwr_adj_cmd,
+ "pwr-adj-mode (none|auto)",
+ "Set output power adjustment mode\n")
+{
+ struct phy_instance *pinst = vty->index;
+ int val = get_string_value(lc15_auto_adj_pwr_strs, argv[0]);
+
+ if((val < LC15_TX_PWR_ADJ_NONE) || (val > LC15_TX_PWR_ADJ_AUTO)) {
+ vty_out(vty, "Invalid output power adjustment mode %d%s", val, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ pinst->u.lc15.tx_pwr_adj_mode = (uint8_t)val;
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_phy_tx_red_pwr_8psk, cfg_phy_tx_red_pwr_8psk_cmd,
+ "tx-red-pwr-8psk <0-40>",
+ "Set reduction output power for 8-PSK scheme in dB unit\n")
+{
+ struct phy_instance *pinst = vty->index;
+ int val = atoi(argv[0]);
+
+ if ((val > 40) || (val < 0)) {
+ vty_out(vty, "Reduction Tx power level must be between 0 and 40 dB (%d) %s",
+ val, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ pinst->u.lc15.tx_pwr_red_8psk = (uint8_t)val;
+ return CMD_SUCCESS;
+}
+
void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts)
{
+ struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
+
+ vty_out(vty, " led-control-mode %s%s",
+ get_value_string(lc15_led_mode_strs, btsb->lc15.led_ctrl_mode), VTY_NEWLINE);
+
}
void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx)
@@ -343,8 +492,27 @@ static void write_phy_inst(struct vty *vty, struct phy_instance *pinst)
}
}
if (pinst->u.lc15.calib_path)
- vty_out(vty, " trx-calibration-path %s%s",
+ vty_out(vty, " trx-calibration-path %s%s",
pinst->u.lc15.calib_path, VTY_NEWLINE);
+
+ vty_out(vty, " max-cell-size %d%s",
+ pinst->u.lc15.max_cell_size, VTY_NEWLINE);
+
+ vty_out(vty, " diversity-mode %s%s",
+ get_value_string(lc15_diversity_mode_strs, pinst->u.lc15.diversity_mode), VTY_NEWLINE);
+
+ vty_out(vty, " pedestal-mode %s%s",
+ get_value_string(lc15_pedestal_mode_strs, pinst->u.lc15.pedestal_mode) , VTY_NEWLINE);
+
+ vty_out(vty, " dsp-alive-period %d%s",
+ pinst->u.lc15.dsp_alive_period, VTY_NEWLINE);
+
+ vty_out(vty, " pwr-adj-mode %s%s",
+ get_value_string(lc15_auto_adj_pwr_strs, pinst->u.lc15.tx_pwr_adj_mode), VTY_NEWLINE);
+
+ vty_out(vty, " tx-red-pwr-8psk %d%s",
+ pinst->u.lc15.tx_pwr_red_8psk, VTY_NEWLINE);
+
}
void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink)
@@ -405,12 +573,20 @@ int bts_model_vty_init(struct gsm_bts *bts)
install_element(BTS_NODE, &cfg_bts_auto_band_cmd);
install_element(BTS_NODE, &cfg_bts_no_auto_band_cmd);
+ install_element(BTS_NODE, &cfg_bts_led_mode_cmd);
install_element(TRX_NODE, &cfg_trx_nominal_power_cmd);
install_element(PHY_INST_NODE, &cfg_phy_dsp_trace_f_cmd);
install_element(PHY_INST_NODE, &cfg_phy_no_dsp_trace_f_cmd);
install_element(PHY_INST_NODE, &cfg_phy_cal_path_cmd);
+ 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);
+ 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);
+
return 0;
}
diff --git a/src/osmo-bts-litecell15/main.c b/src/osmo-bts-litecell15/main.c
index 352949b4..a74da8a4 100644
--- a/src/osmo-bts-litecell15/main.c
+++ b/src/osmo-bts-litecell15/main.c
@@ -72,6 +72,8 @@ int bts_model_init(struct gsm_bts *bts)
btsb = bts_role_bts(bts);
btsb->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3);
+ /* specific default values for LC15 platform */
+ btsb->lc15.led_ctrl_mode = LC15_BTS_LED_CTRL_MODE_DEFAULT;
rc = oml_router_init(bts, OML_ROUTER_PATH, &accept_fd, &read_fd);
if (rc < 0) {